[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: using a parameter to modify part of the file path
Tracey Zellmann wrote:
I was able to resolve this.It should be that way in all cases (well: you can use either xsl:variable or xsl:param), you did the right thing. When you want to use an external parameter (one given to the xslt stylesheet by the processor, from the commandline or a program), the parameter must have been declared inside the xslt, at root level, with <xsl:param>, before you can use it. Afaik, this is also true for ATV (attribute value templates, the format you where referring to earlier, with the curly braces). Using a variable or a parameter which was not declared, is an error. In XPath 1.0 it is defined so: "A VariableReference evaluates to the value to which the variable name is bound in the set of variable bindings in the context. It is an error if the variable name is not bound to any value in the set of variable bindings in the expression context." (see: http://www.w3.org/TR/xpath#section-Basics), In understandable English I think this means: if the variable reference (the thing after the dollar sign) is not there in your document, in an imported document, or not in the scope of the current statement, an error will rise. If your processor does not treat it as an error when you reference a parameter or variable that is not declared, I think your processor has a bug. Cheers, Abel Braaksma http://abelleba.metacarpus.com
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|