![]() |
How to detect CDATA in XPATH ?
Hi !
I need to isolate some nodes without CDATA inside, the problem is that I can not get an XPATH to differentiate simple text nodes and CDATA nodes. Sample XML : <nodes> <node>some text</node> <node><![CDATA[some other text]]></node> </nodes> I want to get the first node but not the last one ! Obviously nodes/node/text() will give me both of them, so how could I do that ? Thanx in advance ! |
Re: How to detect CDATA in XPATH ?
Nold Fuchs wrote: > I need to isolate some nodes without CDATA inside, > the problem is that I can not get an XPATH to differentiate simple > text nodes and CDATA nodes. > > Sample XML : > <nodes> > <node>some text</node> > <node><![CDATA[some other text]]></node> > </nodes> > > I want to get the first node but not the last one ! > Obviously nodes/node/text() will give me both of them, > so how could I do that ? I don't think the XPath 1.0 data model distinguishes text nodes from CDATA text nodes. -- Martin Honnen http://JavaScript.FAQTs.com/ |
Re: How to detect CDATA in XPATH ?
* Nold Fuchs wrote in comp.text.xml:
>I need to isolate some nodes without CDATA inside, >the problem is that I can not get an XPATH to differentiate simple >text nodes and CDATA nodes. Indeed, that is not possible using XPath 1.0. |
| All times are GMT. The time now is 02:41 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.