xsl-list
[Top] [All Lists]

re: [xsl] [xls] run-time variable name generation (e.g. "double de-referencing" {$($name)} )

2009-05-12 05:48:29

Vladimir Nesterovsky wrote:

  Hi,

<xsl:variable name="A" select="100"/>
<xsl:variable name="B" select="BBB"/>

<xsl:template mode="t:get-var" match="A">
  <xsl:sequence select="$A"/>
</xsl:template>

<xsl:template mode="t:get-var" match="B">
  <xsl:sequence select="$A"/>
</xsl:template>

  I guess you mean select="$B" ;-)

<xsl:variable name="VAR" as="element()">
  <xsl:element name="{$var}"/>
</xsl:variable/>

<xsl:variable name="value" as="item()">
  <xsl:apply-templates mode="t:get-var" select="$var"/>
</xsl:variable>

  Yes.  Actually, that's the idea of using first-class function
objects, as already noted by someone else (FCF as defined in
FXSL, at least.)

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/

























--~------------------------------------------------------------------
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>
--~--