line end handling in CDATA section

Discussion in 'XML' started by Spacen Jasset, Jan 29, 2007.

  1. I've read the XML standard, and I wonder if someone can confirm this
    for me.

    Am I right in thinking that line endings are translated even within
    CDATA sections? The standard states that translation occurs before
    parsing so this appears to be the case.
    Spacen Jasset, Jan 29, 2007
    #1
    1. Advertising

  2. Spacen Jasset wrote:
    > Am I right in thinking that line endings are translated even within
    > CDATA sections? The standard states that translation occurs before
    > parsing so this appears to be the case.


    That's how I'm reading it. CDATA sections are something of a minor
    abomination anyway; it's generally better to use character-by-character
    escaping where needed. (Or, if you're trying to pass a block of binary
    data, to encode it as base-64 or something of that sort.)

    CDATA Sections were provided to let people more easily cut-and-paste
    some -- not all! -- non-XML data into XML documents. But these days,
    given decent XML editing tools which automate the escaping task, there's
    really very little need for the <![[CDATA[]]> kluge. The one exception
    is working with tools that don't support XML properly, and I would
    advise beating up the authors of those tools to get them fixed.


    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
    Joe Kesselman, Jan 29, 2007
    #2
    1. Advertising

  3. In article <>,
    Spacen Jasset <> wrote:

    >Am I right in thinking that line endings are translated even within
    >CDATA sections? The standard states that translation occurs before
    >parsing so this appears to be the case.


    Yes. The idea is that you get the same results whatever line-ending
    convention your system uses. If you want to force a particular
    character, you have to use a character reference.

    -- Richard



    --
    "Consideration shall be given to the need for as many as 32 characters
    in some alphabets" - X3.4, 1963.
    Richard Tobin, Jan 29, 2007
    #3
    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. John Davison
    Replies:
    1
    Views:
    565
    Hal Rosser
    Jul 7, 2004
  2. CarlosRivera
    Replies:
    5
    Views:
    779
    CarlosRivera
    Jan 16, 2005
  3. Replies:
    2
    Views:
    1,633
    Richard Tobin
    Nov 27, 2003
  4. Tak Sze
    Replies:
    2
    Views:
    4,239
    Patrick TJ McPhee
    Apr 30, 2004
  5. Replies:
    3
    Views:
    728
    Joe Kesselman
    Mar 6, 2006
Loading...

Share This Page