Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   How to detect CDATA in XPATH ? (http://www.velocityreviews.com/forums/t165961-how-to-detect-cdata-in-xpath.html)

Nold Fuchs 10-30-2003 02:42 PM

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 !

Martin Honnen 10-30-2003 03:02 PM

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/


Bjoern Hoehrmann 10-30-2003 03:06 PM

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.