The only way to reference variables and parameters in XSLT is by explicit compile-time name. Variable names are not accessible at run-time from within the stylesheet. When you say "the names of the external documents are passed", it sounds to me as if you are passing the names of the variables to which the documents have been passed. This information can't be used at run-time. A better approach might be to pass the URIs of those documents, or a sequence containing the document nodes.
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of timothymarc@freenet.de
Sent: 15 February 2008 10:55
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Evaluating a string expression

Hi all,

i have a questions concerning the evaluating of a string value. I have several documents included as optional parameters into my stylesheet. Each parameter is a valid xml document. The names of the external documents are passed as a sequence of strings into the stylesheet.

To avoid duplicate code, i need something like

<xsl:for-each seelect="$names">
    <xsl:copy-of select="$."/>
</xsl:for-ech>

where $. is the parameter name. Is there a possibility in Saxon-B to evaluate a given name into a valid parameter call?

Thx for any hint.

--Timothy