GNOME Bugzilla – Bug 126817
Entity definition serialization bug
Last modified: 2009-08-15 18:40:50 UTC
XInclude processing produce invalid result tree. Entity definitions must be checking and string <!ENTITY percnt "%"> must be <!ENTITY percnt "%"> 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.
Created attachment 21388 [details] Testcase for possible bug in entity definition serialization
I can't normally download my attachment so I put testcase to http://www.vzljot.ru/vyt/xinclude-test-2.tar.bz2
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 "%"> <!-- 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.
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 "%"> ]> <test>hello <test>hello</test> </test> paphio:~/XML/tmp -> thanks for the report ! Daniel
This should be closed in release of libxml2-2.6.5, Daniel