The usual solution is that instead of passing your stylesheet three
parameters x, y, and z, you should pass it an XML document
<param>
<x>1</x>
<y>2</y>
<z>3</z>
</param>
and then you can navigate this document at will using XPath.
Michael Kay
http://www.saxonica.com/
-----Original Message-----
From: Ed S [mailto:lists(_at_)highpeakssoftware(_dot_)com]
Sent: 25 August 2005 19:17
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] dynamic variable name/implementation question
Hi-
I'm trying to find a workaround or alternate implementation for a
particular problem I'm tring to solve. I have various parameters that
are passed into the processor, and I would like to use their values in
the stylesheet. However, I've found that XSLT 1.0 does not support
dynamic variables.
I would like to do the following:
XML:
...
<text-block>
this is some text. Folowing is dynamic- <external-value
parameter="someParam"/> -preceding was dynamic
</text-block>
...
XSL:
...
<xsl:template match="external-vaue">
<xsl:value-of select="$(_at_)parameter"/> <!-- this won't work -->
</xsl:template>
...
where there is a parameter "someParam" passed into the
stylesheet - say
someParam="foo". My output would be:
...
this is some text. Folowing is dynamic- foo -preceding was dynamic
...
Has anybody else ever needed this fuctionality?
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--