cdata

Discussion in 'HTML' started by Richard Barnet, Jul 1, 2003.

  1. Regarding including escaped dynamic content (such as user-generated text
    from a <textarea>), when should I use <![CDATA[ ... ]]> as opposed to
    &lt;![CDATA[ ... ]]&gt; ?

    When I use the first one, I get a residual "]]>" that displays on the page.
    I've noticed this problem on others' pages, too. I've also seen some sites
    that use the latter, but this doesn't seem to make sense, and doesn't seem
    to be explained anywhere that I can find.

    -- Richard
     
    Richard Barnet, Jul 1, 2003
    #1
    1. Advertising

  2. Richard Barnet

    Dan Brussee Guest

    In article <bdspsk$t1l$>,
    says...
    > Regarding including escaped dynamic content (such as user-generated text
    > from a <textarea>), when should I use <![CDATA[ ... ]]> as opposed to
    > &lt;![CDATA[ ... ]]&gt; ?
    >
    > When I use the first one, I get a residual "]]>" that displays on the page.
    > I've noticed this problem on others' pages, too. I've also seen some sites
    > that use the latter, but this doesn't seem to make sense, and doesn't seem
    > to be explained anywhere that I can find.
    >
    > -- Richard
    >
    >
    >


    <CDATA> sections are used in XML to contain free entered text that the
    programmer has no control over. It's only purpose is to make sure that
    the contents will work in the XML structure since someone could type in
    <ABC>123</AABBCC> which would fail any XML parser.

    Making this <![CDATA[<ABC>123</AABBCC>]]> causes the parser to accept
    it. It is still up to the programmer to handle the text inside in a
    reasonable way.

    --

    Remove NOT from email address to reply. AntiSpam in action.
     
    Dan Brussee, Jul 1, 2003
    #2
    1. Advertising

  3. "Dan Brussee" <> wrote in message
    news:...
    >
    > <CDATA> sections are used in XML to contain free entered text that the
    > programmer has no control over. It's only purpose is to make sure that
    > the contents will work in the XML structure since someone could type in
    > <ABC>123</AABBCC> which would fail any XML parser.
    >
    > Making this <![CDATA[<ABC>123</AABBCC>]]> causes the parser to accept
    > it. It is still up to the programmer to handle the text inside in a
    > reasonable way.
    >


    This is precisely what I need it for (for content that is outside my
    control). Why is it, however, that the browser (IE 6.0 SP1 in strict mode)
    displays the "]]>" after the content?

    -- Richard
     
    Richard Barnet, Jul 1, 2003
    #3
  4. Richard Barnet

    Dan Brussee Guest

    In article <bdsvru$d9$>,
    says...
    > "Dan Brussee" <> wrote in message
    > news:...
    > >
    > > <CDATA> sections are used in XML to contain free entered text that the
    > > programmer has no control over. It's only purpose is to make sure that
    > > the contents will work in the XML structure since someone could type in
    > > <ABC>123</AABBCC> which would fail any XML parser.
    > >
    > > Making this <![CDATA[<ABC>123</AABBCC>]]> causes the parser to accept
    > > it. It is still up to the programmer to handle the text inside in a
    > > reasonable way.
    > >

    >
    > This is precisely what I need it for (for content that is outside my
    > control). Why is it, however, that the browser (IE 6.0 SP1 in strict mode)
    > displays the "]]>" after the content?
    >


    Can you give an example? I would think you would be sending this through
    an XSL transformation and not just trying to show it's value inside a
    text area :)



    --

    Remove NOT from email address to reply. AntiSpam in action.
     
    Dan Brussee, Jul 2, 2003
    #4
    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,300
    Andy R
    Dec 31, 2003
  2. chrisn
    Replies:
    1
    Views:
    3,645
    Bruce Barker
    Sep 13, 2005
  3. Forest
    Replies:
    0
    Views:
    330
    Forest
    Oct 20, 2003
  4. John Davison
    Replies:
    1
    Views:
    635
    Hal Rosser
    Jul 7, 2004
  5. Replies:
    3
    Views:
    797
    Joe Kesselman
    Mar 6, 2006
Loading...

Share This Page