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

RE: Xsl:import and param

Subject: RE: Xsl:import and param
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 1 Oct 2003 11:31:10 +0100
xsl import param
> i would like to import an xsl file according to the value of a param :
> 
> <xsl:stylesheet
>      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>  
> 	<xsl:param name="xsl_criteria"/>
> 	<xsl:import>
> 	  <xsl:attribute name="href">
>             <xsl:text>file:</xsl:text><xsl:value-of
> select="$xsl_criteria"/>
>           </xsl:attribute>
> 	</xsl:import>
> 

Come on, stop and think. Since when did xsl:attribute ever write
anything *to the stylesheet*?

> 
> Is there a solution for my problem ?
> 

You haven't told us anything about your problem, only your highly
imaginative attempt to solve it.

xsl:import is a compile-time facility. It takes effect long before the
stylesheet is evaluated, which is when parameters are examined and
instructions like xsl:attribute are executed. You can't modify your
source code while the program is running.

You could write a stylesheet that generates a new stylesheet, but I
suspect you don't need to. Usually when people ask for dynamic
xsl:import it's because they are doing import the wrong way around. You
should import the general-purpose stylesheet modules into the
special-purpose modules, not the other way around.

Michael Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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
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.