[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSL Import using relative location from within a j

Subject: RE: XSL Import using relative location from within a jar.
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 30 May 2007 22:04:03 +0100
RE:  XSL Import using relative location from within a j
It doesn't depend on where the stylesheet actually is, it depends on what
it's base URI is, and that's essentially what you set it do, for example
when you did setSystemId() on the Source object.

If you're using the jar: URL scheme to address files inside the JAR, then
that might give you problems, because this URL scheme doesn't conform to the
RFC standards and isn't supported by the java.net.URI class.

Saxon has a few tweaks that allow you to use this schema and achieve
relative addressing within the JAR, but I doubt it would work to do relative
addressing that strays outside it.

You can always write your own URIResolver and try to do a better job
yourself.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Mah, Terry [mailto:terry.mah@xxxxxxxxxxx] 
> Sent: 30 May 2007 21:34
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  XSL Import using relative location from within a jar.
> 
> Hello All,
> I have a stylesheet that exists within a jar.  Is there a way 
> to write a relative href which points to a url outside of the jar?
>  
> Example: bar.xsl exists in: com.company.foo.bar.xsl location 
> of xsl I wish to import:
> ../../../user-defined-xsl/import_this_xsl.xsl  (the 
> user-defined-xsl directory is on the same level as the jar file).
>  
> ...
> <xsl:import href="../../../user-defined-xsl/import_this_xsl.xsl"/>
> ...
>  
> Gives an exception.  I am using Xalan.
>  
> Thanks.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.