|
Subject: attributes and template modes From: Greg Bylenok <gbylenok@xxxxxxxxxxxxx> Date: Wed, 03 Nov 1999 20:42:52 -0800 |
Hi,
Is anyone using template modes extensively? I've been struggling with
template modes, and I'm hoping someone can explain what's happening
here. I'm trying to make one template dispatch to one of several others
based on the value of an attribute. Here are my first three attempts,
none of which succeeded. Any insight into why my first three guesses
failed?
<xsl:apply-templates match="." mode="@type" />
<xsl:apply-templates match="." mode="{@type}"/>
< xsl:apply-templates match=".[@type='text']" mode="text"/>
I finally broke down and resorted to the "choose" directive, which is
not elegant but works correctly:
<xsl:choose>
<xsl:when test=" @type='text' ">
<xsl:apply-templates select="." mode="text"/>
</xsl:when>
</xsl:choose>
thanks for any insights,
Greg
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: attributes and template modes, Mark Hayes | Thread | RE: attributes and template modes, Kay Michael |
| any ideas?, TaNiA | Date | Re: Variable Scoping, James Clark |
| Month |