[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

Subject: Re: using a parameter to modify part of the file path in document(...) function
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Sun, 17 Sep 2006 22:54:40 +0200
modi error registered
Tracey Zellmann wrote:
I was able to resolve this.

I needed to include in my stylesheet
<xsl:param name="buidlingDataFile"/>

Not exactly sure why I need this in this case, but not in others.

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

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.