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

RE: XSLT: Variable href in <xsl:import>

  • To: "Gerben Rampaart" <gerben@n...>, <xml-dev@l...>
  • Subject: RE: XSLT: Variable href in <xsl:import>
  • From: "Hunsberger, Peter" <Peter.Hunsberger@S...>
  • Date: Wed, 11 Aug 2004 09:36:44 -0500
  • Thread-index: AcR/nnVHqAivO3rYToKBb7AodqXWPwAEW0Qw
  • Thread-topic: XSLT: Variable href in <xsl:import>

cocoon xsl import
Gerben Rampaart <gerben@n...> asks:
> 
> I have a big (and I mean BIG) xslt which I split up in about 
> 6 parts which all hold templates that are pretty much related 
> to each other. But, I am not ruling out that those 
> stylesheets will shift directories a couple of times (in my 
> VS.NET project) and on top of that I just don't like 
> hardcoded relative paths in my xslt.
> 
> For this reason, we have centered all the path information in 
> one file (the web.config for all you VS programmers out 
> there) and with a simple configuration in there, we change 
> the path for a xslt for the entire application.
> 
> Except, that darn <xsl:import> tag won't cooperate, It won't 
> accept extensionobject method returns, no param values, no nothing.
> 
> Summary:
> 
> This:
> 
> <xsl:import>
> 	<xsl:attribute 
> name="href">http://MyWebPage/MyXslt.xslt</xsl:attribute>
> </xsl:import>
> 
> Or this:
> 
> <xsl:import>
> 	<xsl:attribute name="href"><value-of name="$MyParam" 
> /></xsl:attribute> </xsl:import>
> 
> doesn't work.
> 
> How do I make that import tag have a variable path?

As has been pointed out, you can't. One thing you can do is use a
framework that allows relative paths to be resolved for your stylesheets
independently of the XSLT in use (IOW, one that includes URI resolvers
that do the dirty work for you). If you're in a position to do so you
might want to look at the Apache Cocoon project for such capabilities.
It would also give you the capability to dynamically generate a top
level XSLT that includes the lower level XSLTs; you'd generate the XSLT
and the relevant include paths at run time and then execute it...




PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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-2013 All Rights Reserved.