List Info

Thread: Problems with catalogs using delegates




Problems with catalogs using delegates
country flaguser name
Switzerland
2007-03-23 08:38:27
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.

So here's the setup:

1. catalog.xml:

<catalog xmlns="urn:oasis:names:tc:entitymlns<
img
src='http://www.archivesat.com/images/love_struck.gif'>ml:ca
talog">
    <delegatePublic
       publicIdStartString="-//My Pub//Id"
       catalog="delegate-catalog.xml"/>
    <delegateSystem
       systemIdStartString="http://doesnt.exist"
       catalog="delegate-catalog.xml"/>
</catalog>

2. delegate-catalog.xml:

<catalog xmlns="urn:oasis:names:tc:entitymlns<
img
src='http://www.archivesat.com/images/love_struck.gif'>ml:ca
talog">
  <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.  

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.exi
st/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.

Peter


_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml

Re: Problems with catalogs using delegates
user name
2007-03-23 09:44:20
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:entitymlns<
img
src='http://www.archivesat.com/images/love_struck.gif'>ml:ca
talog">
>     <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:entitymlns<
img
src='http://www.archivesat.com/images/love_struck.gif'>ml:ca
talog">
>   <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.exi
st/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://xmlso
ft.org/catalog.html#validate
  export XML_DEBUG_CATALOG environment variable

Daniel

-- 
Red Hat Virtualization group http://redhat.com/v
irtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillardredhat.com  | 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/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )