CDATA question

Discussion in 'XML' started by Razvan, Jan 11, 2005.

  1. Razvan

    Razvan Guest

    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
    Razvan, Jan 11, 2005
    #1
    1. Advertising

  2. "Razvan" <> writes:

    > 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
    David Carlisle, Jan 11, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Schmidt

    CDATA in XMLout

    Stefan Schmidt, Dec 28, 2003, in forum: Perl
    Replies:
    1
    Views:
    1,270
    Andy R
    Dec 31, 2003
  2. John Davison
    Replies:
    1
    Views:
    568
    Hal Rosser
    Jul 7, 2004
  3. Replies:
    3
    Views:
    736
    Joe Kesselman
    Mar 6, 2006
  4. Dilip
    Replies:
    3
    Views:
    419
    Joseph Kesselman
    Oct 25, 2006
  5. mike

    CDATA Question

    mike, Jan 23, 2007, in forum: XML
    Replies:
    5
    Views:
    445
Loading...

Share This Page