[Home] [By Thread] [By Date] [Recent Entries]



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/


  • References:
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member