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 485237 - "--load-trace" omits documents loaded via XInclude
"--load-trace" omits documents loaded via XInclude
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: xinclude
2.6.27
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2007-10-10 00:09 UTC by Ben Liblit
Modified: 2020-08-17 21:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ben Liblit 2007-10-10 00:09:37 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.]
Comment 1 Nick Wellnhofer 2020-08-17 21:55:26 UTC
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>