Xalan or Saxon have no 'base' from which to determine
the context for the css file, so you'll have to use
an absolute file reference from the stylesheet.
Came up on the Saxon list this week.
Its for the document() function, but the same logic applies.
HTH DaveP
<quote>
> It appears that I must use a full path when using the
> xsl:result-document command from a saxon servlet.
>
> For example: <xsl:result-document href="file:/c:/mywebdir/myfile.htm"
> format="web">
>
> rather than: <xsl:result-document href="file:/../../myfile.htm"
> format="web">
>
> Is this true, or is it possible to use a relative path?
Although it's possible in principle to use a relative path, this isn't
likely to be convenient in a servlet environment. Any relative URI is
resolved relative to the base URI of the principal output document, which in
the servlet case is going to the servlet output streat, which doesn't have a
meaningful URI. You could, when you allocate the principal output
destination, give it an arbitrary URI for this purpose:
ServletOutputStream out = res.getOutputStream(); StreamResult tout = new
StreamResult(out); tout.setSystemId("file:/c:/some/uri/");
transformer.transform(new StreamSource(sourceFile), tout);
However, I'm wondering what you're actually trying to do here. Where do you
want to put the extra output files? Is it a location associated with the
individual end user, or a location associated with the source document, or
what? Are you trying to split the source document into multiple result
documents the first time it is accessed, and cache the results for later
use? Do you actually want to serialize the multiple output documents to
disk, or do you really want them in (application or session) memory?
> Also, there is no
> 'c:' on Unix\Linux, so would I use something like
> 'href=file://mywebdir/myfile.html' ??
I think the correct syntax is file:///usr/dir/file.xml to reference the UNIX
file /user/dir/file.xml
>
> I'm new to the Servlet environment.. I'm not sure how to obtain the
> full path if I'm running my Servlet on a hosted machine. Do I have to
> ask the host provider and hard code the path or is there a dynamic way
> to do this?
>
If you're running on a hosted machine then you'll have to write the files to
a directory where the servlet has write permission. A Java call such as
getServletContext().getRealPath(source);
will give you path names to files within the directory structure visible to
users via a browser - it's not clear whether you want the XML files you
generate to be directly accessible to users or not.
Michael Kay
</quote>
--
DISCLAIMER:
NOTICE: The information contained in this email and any attachments is
confidential and may be privileged. If you are not the intended
recipient you should not use, disclose, distribute or copy any of the
content of it or of any attachment; you are requested to notify the
sender immediately of your receipt of the email and then to delete it
and any attachments from your system.
RNIB endeavours to ensure that emails and any attachments generated by
its staff are free from viruses or other contaminants. However, it
cannot accept any responsibility for any such which are transmitted.
We therefore recommend you scan all attachments.
Please note that the statements and views expressed in this email and
any attachments are those of the author and do not necessarily represent
those of RNIB.
RNIB Registered Charity Number: 226227
Website: http://www.rnib.org.uk
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]