Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Lxml uses the catalog support from <a href="http://xmlsoft.org/catalog.html" rel="nofollow">libxml2</a>. Use the environment variable <code>XML_CATALOG_FILES</code> to provide a list of catalogs (you could set this from python as well, using <a href="http://docs.python.org/library/os.html#os.environ" rel="nofollow">os.environ</a>), or, if this variable is not present, it checks for the existence of <code>/etc/xml/catalog</code> (can't use this one on windows of course).</p> <p>An alternative would be to use a custom URI resolver. You can find more information in the <a href="http://lxml.de/resolvers.html" rel="nofollow">lxml docs</a></p> <p>EDIT: apparently, the question was not about the actual xinclude processing, which works, but about a way to "query" the catalog, or ask it for the actual filenames that would be used for the inclusions.</p> <p>Lxml (at least currently) has no API to do that. The underlying libxml2 library does support this, however, and the "original" <a href="http://xmlsoft.org/python.html" rel="nofollow">libxml2 python bindings</a> allow you to do this (easy documentation is lacking though, the docstrings in the source code of the libxml2 help, however). So, although this module is not nearly as nice to use than lxml, it seems to be your best bet. Example which seems to work:</p> <pre><code>&gt;&gt;&gt; import libxml2 &gt;&gt;&gt; libxml2.loadCatalog('catalog.xml') &gt;&gt;&gt; print libxml2.catalogResolveURI('file:///common/logo.xml') file:///home/kst/svn/TOOLS/Docbook/common/logo.xml </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload