Re: [xsl] The document() function and Base URIs

Subject: Re: [xsl] The document() function and Base URIs
From: "andrew welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 25 Apr 2006 17:04:08 +0100
On 4/25/06, MrDemeanour <mrdemeanour@xxxxxxxxxxxxxx> wrote:
> Hi, list.
>
> I have a stylesheet that is loaded into Xalan using an http:// URL,
> which happens to point to a Java servlet. The stylesheet contains an
> import instruction:
>
> <xsl:import href="genhtml.xsl"/>
>
> Xalan is attempting to retrieve the imported stylesheet from the
> filesystem, and failing - it seems to be using the docBase of the
> servlet context, which I suppose is equivalent to using an empty Base URI.
>
> So how does a stylesheet come to know what its URI is? How do you 'tell'
> a stylesheet where it came from?

How are you loading the stylesheet - via a processing instruction in
the XML, via the command line, or using a host application?  If it's
the latter then what objects are you using?

If it's a StreamSource then you'll need to call setSystemId() to give
the stylesheet a location.

Current Thread