xsl-list
[Top] [All Lists]

Re: computed <xsl:apply-templates mode=

2004-12-09 05:35:52
Does something as mundane as this work:

<xsl:choose>
  <xsl:when test="$variable = 'foo'">
    <xsl:apply-templates mode="foo"/>
  </xsl:when>
  <xsl:when test="$variable = 'bar'">
    <xsl:apply-templates mode="bar"/>
  </xsl:when>
  <!-- etc. -->
  <xsl:otherwise>
    <xsl:message>Invalid variable: <xsl:value-of select="$variable"/>
</xsl:message>
  </xsl:otherwise>
</xsl:choose>

That would work, but there are several dozen options, and it would get
tedious.  I ended up abandoning modes and matching the templates to
the attribute of the element.

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



<Prev in Thread] Current Thread [Next in Thread>