Removing text nodes from a DOM Tree

2003-08-14 Thread David J Craigon
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 ---

Re: SV:Querying an XML File

2003-07-21 Thread David J Craigon
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

Re: Support for Namespaces in Xerces 2_2_0

2003-06-13 Thread David J Craigon
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.

Re: How to release memory

2003-06-06 Thread David J Craigon
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::

Re: help me get rid of some compile errors...

2003-03-25 Thread David J Craigon
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

Re: help me get rid of some compile errors...

2003-03-25 Thread David J Craigon
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

SAX2 Filters

2003-03-10 Thread David J Craigon
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

RE: path searching in a DOM tree

2002-10-31 Thread David J Craigon
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

RE: path searching in a DOM tree

2002-10-31 Thread David J Craigon
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