[xml] CDATA

Date view Thread view Subject view Author view

From: Stephane Conversy (Stephane.Conversy@lri.fr)
Date: Mon Dec 06 1999 - 10:10:13 EST


In xml specs, I saw that you can have text that contains
special characters as '&' and '<', using CDATA

this allows to write:
<definition>
<![CDATA[
    if(toto<1)
        then print("boo")
]]>
</definition>

where:
<definition>
    if(toto<1)
        then print("boo")
</definition>

whould have been wrong...
The question is: is it transparent to an implementor ? ie, in the second
case (the wrong one)
I can have the text by using:

xmlNodeListGetString(doc, cur->childs, 1);

but if I surround the text with CDATA stuff, there is no text here.
Is another child built ?
Is there a flag in libxml that says "transform CDATA in plain text such
that using
CDATA or not makes no difference for the programmer " ?

    stef

--
Stéphane Conversy
http://www-ihm.lri.fr/~conversy/
mailto:conversy@lri.fr

---- Message from the list xml@rufus.w3.org Archived at : http://rufus.w3.org/veillard/XML/messages to unsubscribe: echo "unsubscribe xml" | mail majordomo@rufus.w3.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:29:53 EDT