GNOME Bugzilla – Bug 152623
xmllint does not display the right filename on errors in xincluded files
Last modified: 2009-08-15 18:40:50 UTC
Given these three files: -----BEGIN silly.dtd----- <!ELEMENT two (test*)> <!ELEMENT one (two)> <!ATTLIST test foo (bar|buz) "bar"> <!ELEMENT test (#PCDATA)> -----END silly.dtd----- -----BEGIN one.xml----- <?xml version='1.0'?> <!DOCTYPE one SYSTEM "silly.dtd"> <one> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="two.xml"/> </one> -----END one.xml----- -----BEGIN two.xml----- <?xml version='1.0'?> <two> <test>Testing.</test> <test foo="baz">This is a test.</test> </two> -----END two.xml----- Issue the following command: xmllint --nonet --noout --postvalid --xinclude one.xml xmllint outputs: one.xml:4: element test: validity error : Value "baz" for attribute foo of test is not among the enumerated set Document one.xml does not validate But the error is in two.xml:4 ("baz" instead of "bar" or "buz"), not in one.xml:4.
I added some code to the error printing routine to improve this. It depends upon the XML_XINCLUDE_START/END nodes, and should provide what you want as long as those nodes are not suppressed. Fixed code is in CVS (error.c) - thanks for the report.
This should be fixed in release 2.6.15, thanks, Daniel