On Fri, Mar 23, 2007 at 02:38:27PM +0100, Peter Kullmann wrote:
> I have two problems with catalogs that use delegateSystem, delegatePublic or
> both. I'm not at all sure whether this is a problem of the libxml
> implementation or in my understanding of catalogs.

  The semantic is defined there:
http://www.oasis-open.org/committees/entity/spec-2001-08-06.html#s.semantics

> So here's the setup:
> 
> 1. catalog.xml:
> 
> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
>     <delegatePublic
>        publicIdStartString="-//My Pub//Id"
>        catalog="delegate-catalog.xml"/>
>     <delegateSystem
>        systemIdStartString="http://doesnt.exist";
>        catalog="delegate-catalog.xml"/>
> </catalog>

  Don't expect both to be used, on delegates at most one is followed,
but if that fails the algorithm never backtracks

> 2. delegate-catalog.xml:
> 
> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
>   <rewriteURI
>     uriStartString="http://doesnt.exist";
>     rewritePrefix="." />
>   <public
>     publicId="-//My Pub//Id//EN"
>     uri="a.dtd" />
> </catalog>
> 
> 
> Here is the first problem: 
> 
> xmlcatalog catalog.xml "http://doesnt.exist/a.dtd";
>   does not resolve! It tries the delegate, but fails to use the rewrite URI
> rule.  

  at one time either URI or Public resolution is used, but not both at the
time see the algorithm

> xmlcatalog delegate-catalog.xml "http://doesnt.exist/a.dtd";
>   resolves correctly (just to check)
> 
> The second problem is related to the first and occurs when validating a
> document. The catalog system fails to resolve the dtd in a document that
> contains a public id and a system id: 
> <?xml version="1.0" encoding="iso-8859-1"?>
> <!DOCTYPE root PUBLIC "-//My Pub//Id//EN"
> "http://doesnt.exist/a.dtd";>
> <root />
> 
> On the other hand, the resolution of the public id seems to work:
> xmlcatalog catalog.xml "-//My Pub//Id//EN"
>   resolves correctly
> 
> 
> I'm grateful for any hints and tips.

  Tip: http://xmlsoft.org/catalog.html#validate
  export XML_DEBUG_CATALOG environment variable

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
[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

Reply via email to