![CDATA[

Discussion in 'XML' started by ranch99ranch99@gmail.com, May 2, 2007.

  1. Guest

    I always see ![CDATA[ in XML page, what does this mean?
     
    , May 2, 2007
    #1
    1. Advertising

  2. wrote:
    > I always see ![CDATA[ in XML page, what does this mean?


    http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-cdata-sect

    What it really means is that whoever wrote the XML file was sloppy.
    CDATA Sections are an ugly cluge intended to make manually
    copy-and-pasting non-XML data into an XML file a little easier. The
    proper solution is to use XML-aware tools, which will escape individual
    characters when necessarily (and only when necessary).

    If any tool actually requires the use of CDATA Sections rather than
    escaping on a character-by-character basis, it's badly broken and should
    be replaced.





    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
     
    Joseph Kesselman, May 2, 2007
    #2
    1. Advertising

  3. In article <4638e3b2$1@kcnews01>,
    Joseph Kesselman <> wrote:

    >What it really means is that whoever wrote the XML file was sloppy.
    >CDATA Sections are an ugly cluge intended to make manually
    >copy-and-pasting non-XML data into an XML file a little easier. The
    >proper solution is to use XML-aware tools, which will escape individual
    >characters when necessarily (and only when necessary).


    However, it also makes the data more human-readable, which seems very
    desirable when, for example, including a computer program in an XML
    document.

    -- Richard
    --
    "Consideration shall be given to the need for as many as 32 characters
    in some alphabets" - X3.4, 1963.
     
    Richard Tobin, May 2, 2007
    #3
  4. Richard Tobin wrote:
    > However, it also makes the data more human-readable, which seems very
    > desirable when, for example, including a computer program in an XML
    > document.


    Only if you're editing the document as XML source. If you're using an
    XML-aware editing tool, the content is simply the content and is as
    human-readable one way as the other. Escaping choices should be purely
    an artifact of the datastream rather than of the document semantics, and
    the user shouldn't have to look at them.


    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
     
    Joseph Kesselman, May 2, 2007
    #4
  5. In article <4638f180$1@kcnews01>,
    Joseph Kesselman <> wrote:

    >> However, it also makes the data more human-readable, which seems very
    >> desirable when, for example, including a computer program in an XML
    >> document.


    >Only if you're editing the document as XML source.


    Which I often am. As the design goals for XML put it, "XML documents
    should be human-legible and reasonably clear". XML is not just an
    internal format.

    >Escaping choices should be purely
    >an artifact of the datastream rather than of the document semantics,


    Yes...

    >and the user shouldn't have to look at them.


    .... but I don't see how that follows. Escaping choices should not
    affect document semantics, so they can be made for reasons such as
    human convenience.

    -- Richard
    --
    "Consideration shall be given to the need for as many as 32 characters
    in some alphabets" - X3.4, 1963.
     
    Richard Tobin, May 2, 2007
    #5
    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,285
    Andy R
    Dec 31, 2003
  2. chrisn
    Replies:
    1
    Views:
    3,600
    Bruce Barker
    Sep 13, 2005
  3. Forest
    Replies:
    0
    Views:
    321
    Forest
    Oct 20, 2003
  4. John Davison
    Replies:
    1
    Views:
    584
    Hal Rosser
    Jul 7, 2004
  5. Replies:
    3
    Views:
    757
    Joe Kesselman
    Mar 6, 2006
Loading...

Share This Page