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. > # 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. > # 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 > Resolve URI file:///usr/local/share/netperf/nonesuch.dtd > test_config.xml:2: I/O error : failed to load external entity the match is exact, there is only one return value possible, so it fails that's normal based on my understanding of the Catalog spec. Daniel -- Daniel Veillard | Red Hat http://redhat.com/ [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
