xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kimberly Stewart" <Kimberly.Stew...@bsci.com>
Subject RE: ELEMENT_NODE appears as TEXT_NODE
Date Wed, 30 Sep 2009 17:06:39 GMT
Thanks Dave,

This solution gave me the output I was looking for.

~ Kim

-----Original Message-----
From: David Bertoni [mailto:dbertoni@apache.org] 
Sent: Friday, September 25, 2009 6:43 PM
To: c-users@xerces.apache.org
Subject: Re: ELEMENT_NODE appears as TEXT_NODE

You're asking the DOMTreeWalker to only show you text nodes, so there's
no way you'll get any element nodes. Of course, you can always call
getParent() on each text node, but perhaps you should instead have the
DOMTreeWalker show you element and text nodes:

DOMTreeWalker* walker =
     document->createTreeWalker(
         docRoot,
         DOMNodeFilter::SHOW_ELEMENT | DOMNodeFilter::SHOW_TEXT,
         NULL,
         true);

Dave

Mime
View raw message