8.4: <xsl:include href="{$calculated-url}" />
Added by Anonymous over 19 years ago
Legacy ID: #3123317 Legacy Poster: Boris Kaminer (boris_kaminer)
Is it possible in saxon to calculate URL for xsl:include/@href or xsl:import/@href in some way? Or may be another possibility to choose including script at runtime..
Replies (5)
Please register to reply
RE: 8.4: <xsl:include href="{$calculated-url} - Added by Anonymous over 19 years ago
Legacy ID: #3123419 Legacy Poster: Michael Kay (mhkay)
This is a FAQ over on the xsl-list at mulberrytech.com (which is where you should really be asking such questions, as it's a general XSLT question, nothing specific to Saxon). xsl:include and xsl:import are compile-time directives, their effect occurs entirely while the stylesheet is being assembled for compilation. Therefore, there's no way their effect can depend on data that's only available at run time. I suggest you ask the question on xsl-list, explaining what problem you have that you were hoping such a construct might solve. (In fact, it might be an idea to read the FAQ for the list first...) Michael Kay
RE: 8.4: <xsl:include href="{$calculated-url}" /> - Added by Anonymous over 19 years ago
Legacy ID: #3125050 Legacy Poster: Boris Kaminer (boris_kaminer)
Thank you. I've realized that my question was not that i want to get to know. I try to ask here. Is it possible to set paths list for saxon to search includes like in C/C++ compilers?
RE: 8.4: <xsl:include href="{$calculated-url} - Added by Anonymous over 19 years ago
Legacy ID: #3125186 Legacy Poster: Michael Kay (mhkay)
You can set the base URI used to resolve relative URIs using the xml:base attribute, but that's not a very flexible mechanism. The most flexible way to do this is to write a URIResolver, a Java class which takes the URI as written and can interpret it any way it likes, including, for example, looking at the values of environment variables. MK
RE: 8.4: URIResolver - Added by Anonymous over 19 years ago
Legacy ID: #3125230 Legacy Poster: Boris Kaminer (boris_kaminer)
Thank you in advance! Is there any way to pass a command line argument to URIResolver?
RE: 8.4: URIResolver - Added by Anonymous over 19 years ago
Legacy ID: #3125293 Legacy Poster: Michael Kay (mhkay)
You can nominate your URIResolver on the command line using the -r option, and you could pass it information through Java system properties (which can be set on the command line using -Dproperty=value before the name of the class you are invoking).
Please register to reply