472,353 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 !
Jul 20 '05 #1
2 5061


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/

Jul 20 '05 #2
* 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.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Max | last post by:
Hi I have an XML file which is something like this <XML> <FORMS> <FORM><!]></FORM> <FORM><!]></FORM> </FORMS> <MAIN>
4
by: Rich Wallace | last post by:
Hi all, I have an XML document fed to me from a third party app: <?xml version="1.0" encoding="WINDOWS-1252" ?> <GatewayPlan...
1
by: yosh | last post by:
Im recieving a XML file from a webserver wich contains a CDATA element wich contains more XML code... the problem is that i have no idea on how to...
15
by: aidy | last post by:
Hi, Is it possible to retrieve CDATA Sections from an XML document? If so, could someone give me a syntax example? Cheers Aidy
11
by: ericms | last post by:
Can anybody show me how to insert a CDATA section using XPathNavigator ? I have tried the follwing with no luck: XmlDocument docNav = new...
2
by: C | last post by:
Hi, I have an XML doc as below <WebSRFTemplate Version="1" Type="SERVICE"> <Data> <Field Name="SERVICEStaticRoute2IPnetwork1"><!]></Field>...
3
by: Dilip | last post by:
I have been out of the XML world for a while and have sort of forgotten the exact difference between: <Symbol><!]></Symbol> and just: ...
2
by: Pugi! | last post by:
Using AJAX I want to send some information from the server (php-page) as XML to the client. The contents can be very divers so I have to use XML...
6
by: dkyadav80 | last post by:
Hi sir, I'm new about xml, javascript. I have two selection field(html) first is city and second is state. the city and state values should be...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.