[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: attributes and template modes

Subject: RE: attributes and template modes
From: Mark Hayes <mark@xxxxxxxxxxx>
Date: Wed, 3 Nov 1999 18:44:53 -0800
hayes templates
The spec does not indicate that the mode attribute is an attribute value
template or an expression, which is why specifying an expression or
attribute value template doesn't work.  This attribute is a plain QName,
therefore there is no way to pass an expression as the mode argument value.
So using <xsl:choose> or <xsl:if> is the only way to do this that I know of.
--
mark

> -----Original Message-----
> From: Greg Bylenok [mailto:gbylenok@xxxxxxxxxxxxx]
> Sent: Wednesday, November 03, 1999 8:43 PM
> To: XSL-List@xxxxxxxxxxxxxxxx
> Subject: attributes and template modes
> 
> 
> 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
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.