A very easy question methinks:
Can anyone thing of a fast way of removing all of the text nodes from a
DOM tree, leaving just the element,attribute nodes etc. remaining? I'm
currently using a DOMTreeWalker but it's very slow.
Thanks,
David
---
Surely this is an FAQ by now! Any chance of adding it to the web site?
David
Gareth Reakes wrote:
Hi,
On 21 Jul 2003, Gröndal Daniel wrote:
Hi!
That's a thing for Xalan. I do it that way. First I use Xerces (DOM) to do some
stuff and then I wrap the DOM-tree and pass it to Xalan.
Or Pathan
Alternatively, if you mean XML namespaces, the answer is also yes! Look
at SAX2, or the DOM routines with an NS in the title.
David
[EMAIL PROTECTED] wrote:
Does anybody knows if there was support for Namespaces in this version
of Xerces?
yes
We are trying it but it does not seem to work.
Hello Hamada-san,
XMLString::transcode produces a string which belongs to you, and you
need to delete after use. So if you use something like:
DOMDocument* doc = impl->createDocument( XMLString::transcode("a" ),
XMLString::transcode("b:c"), NULL );
the two calls to XMLString::
The following code snippet should work:
#include
using namespace xercesc;
int foo()
{
DOMNode *anode;
if (anode->getNodeType()==DOMNode::ELEMENT_NODE)
{
DOMElement *elem= (DOMElement *)anode;
}
else
{
// Oh dear
}
}
This tatic has worked for me in the past
The following code snippet should work:
#include
using namespace xercesc;
int foo()
{
DOMNode *anode;
if (anode->getNodeType()==DOMNode::ELEMENT_NODE)
{
DOMElement *elem= (DOMElement *)anode;
}
else
{
// Oh dear
}
}
This tatic has worked for me in the past
Is there any functionality for doing SAX2 filters? (SAX handler sends
events to SAX handler, which sends events to SAX handler).
I didn't find any when looking through the API docs, so I wrote my own
filter like system. However, I've now got to the stage where I have to
modify the events I send to
Grovel. I appear to have sent this in HTML mail. Sorry.
-Original Message-
From: David J Craigon [mailto:david@;arabidopsis.info]
Sent: 31 October 2002 18:03
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: path searching in a DOM tree
Sounds like what you need is XPath, so what
Sounds
like what you need is XPath, so what you need is Pathan (free), from http://software.decisionsoft.com/.
Unfortunately the latest stable version (Pathan 1) only works with old style
xerces-c (no pointers). If you're using Xerces 2.1.0 (with pointers) (like me),
you'll have to wait unti