Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xml-dev] XSLT: Variable href in

From: "Hunsberger, Peter" <Peter.Hunsberger@------.--->
To: "Gerben Rampaart" <gerben@--------.-->, <xml-dev@-----.---.--->
Date: 8/11/2004 2:37:00 PM
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...


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent