Re: [xslt] XML Catalog search ordering

In message <>
   on 17 Sep 2001, you wrote:

> On Mon, Sep 17, 2001 at 04:55:36PM +0100, Justin Fletcher wrote:
> > The relevant section of the catalog is :
> >
> > <rewriteSystem systemIdStartString="" rewritePrefix="file:///%3CXMLCatalog$Dir%3E/gerph/"/>
> > <public publicId="-//Gerph//DTD PRM documentation 1.00//EN" uri=""/>
> >
> > and the requested identifiers are "-//Gerph//DTD PRM documentation 1.00//EN"
> > and "".
> >
> > My understanding runs thus...
> >
> > Ok
> > System ID was provided. No matching system entry, so skip this
> >          rule.
> > System ID was provided. Matching rewriteSystem entry, so re-write
> >          to file:///%3CXMLCatalog$Dir%3E/gerph/prm.dtd
> >          The re-written string is returned.
> >
> > That's my understanding... There may be something else that I'm missing
> > here.
>   Sounds right:
> orchis:~/XML -> xmlcatalog --shell
> > add rewriteSystem "" "file:///%3CXMLCatalog$Dir%3E/gerph/"
> > add public "-//Gerph//DTD PRM documentation 1.00//EN" ""
> > dump
> <?xml version="1.0"?>
> <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "">
> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
> <rewriteSystem systemIdStartString="" rewritePrefix="file:///%3CXMLCatalog$Dir%3E/gerph/"/>
> <public publicId="-//Gerph//DTD PRM documentation 1.00//EN" uri=""/>
> </catalog>
> > resolve "-//Gerph//DTD PRM documentation 1.00//EN" ""
> file:///%3CXMLCatalog$Dir%3E/gerph/prm.dtd
> > exit
> orchis:~/XML ->
>   Seems to work here ... strange,

Same behaviour here, too, so my port hasn't broken those bits.

I know the /reason/; I can't say what to do about it.

In the xsltproc code we use the xsltNoNetExternalEntityLoader which we enter
with "-//Gerph//DTD PRM documentation 1.00//EN" and
This seems fine.

At the end of the routine, we have processed ID and now have a resource that
is set to "file:///%3CXMLCatalog$Dir%3E/gerph/prm.dtd". Then we hit :

    if (defaultLoader != NULL) {
	input = defaultLoader((const char *) resource, ID, ctxt);

Which calls defaultLoader with "file:///%3CXMLCatalog$Dir%3E/gerph/prm.dtd",
and "-//Gerph//DTD PRM documentation 1.00//EN".

defaultLoader at this point is (or eventually calls)
xmlDefaultExternalEntityLoader - debug from that prints :

xmlDefaultExternalEntityLoader(file:///%3CXMLCatalog$Dir%3E/gerph/prm.dtd, xxx)
Resolve: pubID -//Gerph//DTD PRM documentation 1.00//EN
Found public match -//Gerph//DTD PRM documentation 1.00//EN
Resolve URI

So, it knows that we have the right URI but it has passed in the public
identifier. The public identifier is then matched with the 'public' entry in
the Catalog, and so resolves back to the http://... entry, losing the
(correctly resolved in xsltproc) file:///... entry.

I'm wondering why we try to do this resolution in xsltproc ourselves, and then
call the defaultLoader (which should always be valid because we always get
back a entity loader from libxml).

Does that make sense ?

Gerph {djf0-.3w6e2w2.226,6q6w2q2,2.3,2m4}
... Eyes to the heavens, screaming at the sky;
    Trying to send you messages, but choking on goodbye.

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