Re: [xml] parser add '0x0a' around CDATA content, why?
- From: Daniel Veillard <veillard redhat com>
- To: Li Zhao <liz pmail ntu edu sg>
- Cc: xml gnome org
- Subject: Re: [xml] parser add '0x0a' around CDATA content, why?
- Date: Mon, 25 Nov 2002 04:46:09 -0500
On Mon, Nov 25, 2002 at 11:13:15AM +0800, Li Zhao wrote:
Sirs,
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.
e.g:
in 1.xml , a CDATA section like:
<![CDATA[<table>]]>
parse it, then read using
xmlNodeListGetString(doc,cur,1);
the CDATA string appears in memory as:
<![CDATA[
<table>
]]>
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
<doc><![CDATA[<table>]]></doc>
paphio:~/XML -> ./xmllint tst.xml
<?xml version="1.0"?>
<doc><![CDATA[<table>]]></doc>
paphio:~/XML ->
even when formatting the output the CDATA are preserved
paphio:~/XML -> ./xmllint --format tst.xml
<?xml version="1.0"?>
<doc>
<![CDATA[<table>]]>
</doc>
paphio:~/XML ->
Please read the instructions at http://xmlsoft.org/bugs.html
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."
thanks,
Daniel
--
Daniel Veillard | Red Hat Network https://rhn.redhat.com/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]