GNOME Bugzilla – Bug 485237
"--load-trace" omits documents loaded via XInclude
Last modified: 2020-08-17 21:55:26 UTC
xmllint will do XInclude processing if called with "--xinclude". Independently, it will report all documents loaded during processing if called with "--load-trace". However, when both of these flags are given, "--load-trace" list does not mention documents included via XInclude. I can imagine why this might be the case if XInclude processing happens in an earlier and very distinct phase. However, I am using "--load-trace" for dependency tracking and I need to know about *all* the external documents on which a given XML document depends. That definitely includes files included via XInclude. Is this a bug? If not a bug, is there some other way to obtain the list of documents pulled in via XInclude? I considered writing an XSLT script that operates with XInclude processing off and searches for <xi:include> elements, but that won't really work. It will only discover inclusions at the topmost level; it will miss inclusions within included fragments. As one might expect, the same problem affects xsltproc. [I originally asked about this issue on <xml@gnome.org>: <http://mail.gnome.org/archives/xml/2007-September/msg00038.html>. There were no replies about about three weeks, so I'm now putting this into the bug database instead.]
Works for me with libxml2 2.9.10: $ xmllint --xinclude --load-trace test/XInclude/docs/recursive.xml Loaded URL="test/XInclude/docs/recursive.xml" ID="(null)" Loaded URL="test/XInclude/ents/sub-inc.ent" ID="(null)" Loaded URL="test/XInclude/ents/inc.txt" ID="(null)" <?xml version="1.0"?> <this><sub-inc xml:base="../ents/sub-inc.ent">is a test </sub-inc></this>