Re: [xml-dev] XPath help

From
Paul Brown <>
To
Stephen Stone <>
Date
2003-11-11T15:26:21Z
ID
<>
Thread
Re: [xml-dev] XPath help
On Nov 11, 2003, at 9:18 AM, Stephen Stone wrote:
> I use "./text()" to return all text nodes from the current node.
> I need to also return all CData sections from the current node.
> I assumed "./cdata()" would work. It does not.
> I know CData sections are dealt with differently. I'm just not sure 
> how.

CDATA sections are not distinct from text nodes in the XPath data 
model, so it all looks like text as far as XPath is concerned.  If you 
want access to CDATA sections separately, you'll have to go lower 
level, e.g., with SAX (http://www.saxproject.org) or with STX 
(http://stx.sourceforge.net/).

Paul
http://blog.fivesight.com/prb/