Yes, you're right that the URIResolver is not used for import-query. This is because the result of the resolve() method in URIResolver is a Source, which always identifies an XML document, and a query module is not an XML document. (For similar reasons, the URIResolver is also not used for the unparsed-text() function).
 
You're also right that the base URI used is the base URI of the <saxon:import-query> element itself, which will normally be the URI of the stylesheet module containing this element (the exceptions are if you've used xml:base, or XML external entities). This is the standard way that relative URIs are resolved, and is correct behavior.
 
I'm not sure why you're using "URIs" consisting of a scheme name followed immediately by a path. I would expect a relative URI of the form "/a/b/c" - but when a URIResolver is used, you can more-or-less use anything you like.
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Roger Kovack
Sent: 12 February 2005 19:20
To: saxon-help@lists.sourceforge.net
Subject: Re: [saxon] Cannot resolve relative URI: <saxon:import-query>

The problem seems to be that the <saxon:import-query> element is in an included stylesheet. When I move this element into the including or "top" stylesheet the problem goes away.

But I also have to construct the DocumentWrapper with new DocumentWrapper(doc, "file:" + servletFilePath) or I get a "No protocol" error message. It does seem that <saxon:inport-query> does not use the URIResolver. What's more, the appearent base URI seesm to be the file path to the directory of the stylesheet that contains the <saxon:import-query> element, not the servletFilePath which is several directories above the stylesheet directory.

Does this seem like a correct statement for the href attribute on <saxon:import-query>?

Roger Kovack

Roger Kovack wrote:
Using Saxon 7.8 and a URIResolver that will correctly <xsl:include href="file:xsl/utils/temp1.xsl"/>

I get:

Transform error: Cannot resolve relative URI;
SystemID: xsl/utils/set-db.xsl; Line#: 7;
Column#: -1 in "xsl/utils/doc-manager.xsl"

<xsl:stylesheet version="2.0"  
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:saxon="http://saxon.sf.net/"
    extension-element-prefixes="saxon"
    exclude-result-prefixes="saxon" > 

<saxon:import-query href="file:/xsl/dev/books.xq"/>
<xsl:include href="file:xsl/utils/temp1.xsl"/>
...

I think this has been covered previously but I can't find anything about it. Any sample stylesheet of <saxon:import-query> would be of great help.

Roger Kovack
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ saxon-help mailing list saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ saxon-help mailing list saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help