Re: Dyanmicaly Determine Mode
Martin Honnen <[email protected]> Thu, 25 Jan 2007 14:13:20 +0100
| Newsgroups | gmane.comp.mozilla.devel.layout.xslt |
|---|---|
| Organization | Liberty Development |
| Message-ID | <[email protected]> |
Scott wrote:
> Dynamically Determine Mode
>
> Is there a way in which I could specify which mode to use by passing it
> in through using a node in the xml
>
>
> My example is
>
> <xsl:apply-templates select="List/StoreCoupons" mode="<xsl:value-of
> select="List/Logos/mode"/>"> The two option would multicolumn and
> normal
> <xsl:with-param name="numCols" select="$numCols"/>
> <xsl:with-param name="nodes" select="List/StoreCoupons"/>
> </xsl:apply-templates>
All you can do use e.g.
<xsl:choose>
<xsl:when test="List/Logos/mode = 'multicolumn'">
<xsl:apply-templates select="List/StoreCoupons" mode="multicolumn">
<xsl:with-param name="numCols" select="$numCols"/>
<xsl:with-param name="nodes" select="List/StoreCoupons"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="List/Logos/mode = 'normal'">
<xsl:apply-templates select="List/StoreCoupons" mode="normal">
<xsl:with-param name="numCols" select="$numCols"/>
<xsl:with-param name="nodes" select="List/StoreCoupons"/>
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
--
Martin Honnen
http://JavaScript.FAQTs.com/