XSLT isn't quite that reflexive - there wouldn't be much point in declaring
the variables dynamically as you couldn't reference them dynamically either
(even with saxon:evaluate(), which doesn't give access to the stylesheet's
variables, only to the variables $p1 - $p9 passed in as arguments to
The answer to this I think is simply to pass the parameter document into
saxon:evaluate and reference its contents using path expressions:
<xsl:variable name="params" select="doc($PARAM-FILE)/param-list/param"/>
<xsl:value-of select="saxon:evaluate(xxx, $params)"
and inside the evaluated expression
[mailto:saxon-help-admin@...] On Behalf Of Cary Millsap
Sent: 28 February 2005 22:46
Subject: [saxon] Using evaluate() to define a list of params
I would like to be able to slurp a list of name/type/value tuples from an
external XML document, and then execute a loop to make all the assignments
found in that external document. I really want to do this:
<!-- Here's what I'm trying to do... -->
<xsl:variable name="@name" as="@as" select="."/>
...But of course, the "name" and "as" attributes of the xsl:variable and
xsl:param elements aren't allowed to be defined dynamically.
I want to avoid maintaining the variable names in both the external XML
document and in my XSLT. I feel like I ought to be able to use evaluate() to
take me there, but it's just not coming to me...
Hotsos Enterprises, Ltd.
Nullius in verba
- <http://www.hotsos.com/events/SYM05.php?event_id=36> Hotsos Symposium
2005: March 6-10 Dallas
- Visit <http://www.hotsos.com> http://www.hotsos.com for curriculum and schedule