Thanks Dave,

This solution gave me the output I was looking for.

~ Kim

-----Original Message-----
From: David Bertoni [mailto:dbert...@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

Reply via email to