ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gordon Tyler" <>
Subject Re: [OFF-TOPIC] XML Question
Date Mon, 12 Aug 2002 22:12:46 GMT
From: "Dominique Devienne" <>

> Can someone explain me the difference between the two lines of XML below:
> <sometag><![CDATA[some textual content]]></sometag>
> <sometag>[CDATA[some textual content]]</sometag>


The first line describes an element "sometag" which has a CDATA section
child containing "some textual content". The second line describes an
element "sometag" which has a text child containing "[CDATA[some textual
content]]". In other words, the first line is the correct way to use a CDATA

CDATA sections allow you to escape text that would otherwise be interpreted
as markup (e.g. <foo>).

> What the difference? Does it matter for the DTD?
> I use <!ELEMENT sometag (#PCDATA)> for that element.

Normal text and CDATA sections both qualify as PCDATA. However, you may need
to treat CDATA sections specially depending on the parser and API you use.

> PS: The XML spec is a little obtuse to me... And I did look at it!

It is rather. I have to read very slowly and carefully ;)


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message