473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 5147


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 xmlns:xsd="http://www.w3.org/2001/XMLSchema"...
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 get the things in the cdata field so i can use...
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 XmlDocument(); docNav.LoadXml(xmlString);...
2
by: C | last post by:
Hi, I have an XML doc as below <WebSRFTemplate Version="1" Type="SERVICE"> <Data> <Field Name="SERVICEStaticRoute2IPnetwork1"><!]></Field> </Data> </WebSRFTemplate>
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: <Symbol>IBM</Symbol> Can anyone tell me why one is...
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 instead of text. On one occasion the contents is...
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 store in xml file. when user select city then all...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.