Re: [xml] parser add '0x0a' around CDATA content, why?

On Mon, Nov 25, 2002 at 11:13:15AM +0800, Li Zhao wrote:

I read a xml document and found that:

after parsing, the contents in CDATA sections have been added a char, '0x0a' at head and tail.
in 1.xml , a CDATA section like:

parse it, then read using 
the CDATA string appears in memory as:

Why the parser add '0x0a',
How to prevent xml parser from doing this?
or can I choose whether the parse add or not?

  Sorry, I looked at the code and there no such character added within
the library. I cannot reproduce your problem:

paphio:~/XML -> cat tst.xml
paphio:~/XML -> ./xmllint tst.xml
<?xml version="1.0"?>
paphio:~/XML ->

  even when formatting the output the CDATA are preserved

paphio:~/XML -> ./xmllint --format tst.xml
<?xml version="1.0"?>
paphio:~/XML ->

  Please read the instructions at
on the way to report bugs, including:
 "Make sure you can reproduce the bug with xmllint or one of the
  test programs found in source in the distribution."


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]