Re: [xml] XML_CATALOG_DEBUG enhancement suggestion and yet another question



Daniel Veillard wrote:
On Tue, Feb 21, 2006 at 05:56:27PM -0800, Rick Jones wrote:

while I've been blundering through bootstrapping /etc/xml/catalog, I've come across something that may be a useful enhancement. If one sets XML_CATALOG_DEBUG, the output looks rather like:

# xmllint --dtdattr --valid test_config.xml
Resolve: sysID http://www.netperf.org/netperf_docs.dtd/1.0
1 Parsing catalog file:///etc/xml/catalog
file:///etc/xml/catalog added to file hash
Found system match http://www.netperf.org/netperf_docs.dtd/1.0

It might be nice if the debug output stated what it was going to use based on that match.


  okay, I take patch, this is debug output so I'm fine extending it !


Also, while I was trying to decipher the OASIS stuff on XML catalogs I came away with the impression that if a match target (?) failed to load it would keep trying to match until it found a target that would load or hit the end of the catalog. however, xmllint didn't seem to do that for this catalog:


   Depends, if you hit a delegate, you don't backtrack, triple check the
7 steps described in the spec I'm fairly sure I followed then very precisely.

That would be this right?
http://www.oasis-open.org/committees/entity/spec.html#s.ext.resx

You are, of course, correct, that spec says nothing at all about the match being for somethig that can further resolve. I guess I extrapolated too much.

Bummer.

It would be nice to be able to have some sort of order of preference in the resolution, _sort_ of like variable scoping I suppose, but the spec doesn't seem to address that. First look for a DTD in the CWD, then elsewhere, that sort of thing. Anyway, not a big deal.

# cat /etc/xml/catalog
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd";>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<system systemId="http://www.netperf.org/netperf_docs.dtd/1.0"; uri="file:///usr/local/share/netperf/nonesuch.dtd"/> <system systemId="http://www.netperf.org/netperf_docs.dtd/1.0"; uri="file:///usr/local/share/netperf/netperf_docs.dtd"/>
</catalog>


Not a very good construction usually you should use Delegates to point to a specialized catalog (usually stored in /usr/share/sgml IIRC)
to avoid filling up /etc/catalog with too specific entries, see how
docbook-dtds package on Fedora/Red Hat set up its catalogs.

If I cannot build-up some sort of order of preference via the catalog, I'll likely just have the one entry (the second one in the example above), in which case delegation would seem to be overkill wouldn't it?

rick



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]