CDATA question

R

Razvan

Hi !





Quote from www.w3schools.com:

CDATA is text that will NOT be parsed by a parser. Tags inside the text
will NOT be treated as markup and entities will not be expanded.


However I just inserted a character entity inside an attribute and the
entity was expanded by XML Spy. Who's right ? XML SPY or the w3schools
?




Regards,
Razvan
 
D

David Carlisle

Razvan said:
Hi !





Quote from www.w3schools.com:

CDATA is text that will NOT be parsed by a parser. Tags inside the text
will NOT be treated as markup and entities will not be expanded.


However I just inserted a character entity inside an attribute and the
entity was expanded by XML Spy. Who's right ? XML SPY or the w3schools
?




Regards,
Razvan

The quote is presumably about CDATA sections <![CDATA[....]]> where it
is true that the (only) effect is that < and & no longer start markup
but are just treated as normal characters.

Entity and character references are expanded in attribute values. The
fact that the DTD declarations of attributes use the same word CDATA
is a historic artifact coming from SGML but there isn't really any
connection between these two uses of the word in an XML context.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top