After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 126817 - Entity definition serialization bug
Entity definition serialization bug
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.2
Other Linux
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2003-11-12 15:59 UTC by vyt
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase for possible bug in entity definition serialization (6.45 KB, application/octet-stream)
2003-11-12 16:00 UTC, vyt
Details

Description vyt 2003-11-12 15:59:19 UTC
XInclude processing produce invalid result tree. Entity definitions must be
checking and string
<!ENTITY percnt "%">
must be
<!ENTITY percnt "&#x0025;">
as described in
http://www.oasis-open.org/docbook/xmlcharent/0.3/iso-num.ent

Testcase is attached.

$ xmllint --version
xmllint: using libxml version 20602
   compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer
XInclude Iconv Unicode Regexps Automata Schemas 

This is version from cvs head, 11 November 2003.
Comment 1 vyt 2003-11-12 16:00:42 UTC
Created attachment 21388 [details]
Testcase for possible bug in entity definition serialization
Comment 2 vyt 2003-11-20 16:03:32 UTC
I can't normally download my attachment so I put testcase to
http://www.vzljot.ru/vyt/xinclude-test-2.tar.bz2
Comment 3 Oleg Paraschenko 2003-11-23 20:15:40 UTC
Another test case, without dependency on docbook DTD:

----- <test.xml>
<!DOCTYPE test [
<!ELEMENT test (#PCDATA|test)*>
]>
<test>hello <xi:include href="included.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
</test>
----- </test.xml>

----- <included.xml>
<!DOCTYPE test [
<!ELEMENT test (#PCDATA)>
<!ENTITY percnt     "&#x0025;"> <!-- PERCENT SIGN -->
]>
<test>hello</test>
----- </included.xml>

Result of

xmllint --xinclude test.xml

is

----- <result>
<?xml version="1.0"?>
<!DOCTYPE test [
<!ELEMENT test (#PCDATA | test)*>
<!ENTITY percnt "%">
]>
<test>hello <test>hello</test>
</test>
----- </result>

Definition of "percnt" is corrupted.

Additional note: if I define "percnt" entity in main file, then
definition of "percnt" in result is correct.
Comment 4 Daniel Veillard 2003-12-09 22:52:29 UTC
Yes, the fact that original form is lost is really specific to
XInclude processing. I just fixed the problem in CVS:

paphio:~/XML/tmp -> ../xmllint --xinclude test.xml
test.xml:5: element include: XInclude warning : Deprecated XInclude
namespace found, use http://www.w3.org/2003/XInclude
<?xml version="1.0"?>
<!DOCTYPE test [
<!ELEMENT test (#PCDATA | test)*>
<!ENTITY percnt "&#x25;">
]>
<test>hello <test>hello</test>
</test>
paphio:~/XML/tmp ->

  thanks for the report !

Daniel
Comment 5 Daniel Veillard 2004-01-26 13:26:16 UTC
This should be closed in release of libxml2-2.6.5,
                                                                     
          
Daniel