openSUSE / dbxincluder

Transclusions for DocBook with XInclude 1.1
https://opensuse.github.io/dbxincluder
GNU General Public License v3.0
2 stars 3 forks source link

Support XML Catalogs #28

Closed tomschr closed 8 years ago

tomschr commented 8 years ago

Currently, URLs are resolved through the urllib. However, this doesn't take XML catalogs into account.

I would propose the following steps:

  1. Introduce an -c / --catalog option. If the user adds this, the given catalog is investigated.
  2. Check for the environment variable XML_CATALOG_FILES. This variable can contain one or more catalogs separated by space.
  3. If neither options given nor env variable is set, use the standard root catalog at /etc/xml/catalog.

ATM it seems there is no direct way to resolve a URI through lxml (see also http://stackoverflow.com/a/7229470). However, I've found http://lxml.de/resolvers.html which may be of some value. If there is no easy way we could use the xmlcatalog directly like this:

$ xmlcatalog CATALOG URI_TO_RESOLVE

Add the information about how to resolve URIs into the manpage.

Vogtinator commented 8 years ago

Implemented in feature/xmlcatalog, is that alright so far? It's a bit hard to test correctly and I'm not quite sure whether I got the order in dbxincluder.xinclude.get_target right.

Vogtinator commented 8 years ago

PR #29 created.