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

RE: Using XPath expressions in modes

Subject: RE: Using XPath expressions in modes
From: Benjamin Franz <snowhare@xxxxxxxxxxx>
Date: Tue, 24 Apr 2001 10:09:58 -0700 (PDT)
qname xpath mode
On Tue, 24 Apr 2001, Michael Kay wrote:

> > This seems like a very basic question, but I wasn't able to locate the
> > answer to this on any FAQs....
> 
> It's in the Dave Pawson FAQ under "things you can't do in XSLT".
> 
> > 		<xsl:apply-templates select="category-list"
> > mode="$mode"/>
> 
> > Using $mode doesn't seem to work.  Is it even legal?
> 
> No, it isn't legal. The mode attribute must be a QName, not an XPath
> expression.
> 
> Next question: no, mode="{$mode}" doesn't work either.

But you can probably work around the issue by using <xsl:choose> clauses.

<xsl:choose>
 <xsl:when test="$mode='blah'">
  <xsl:apply-templates select='category-list' mode='blah'/>
 </xsl:when>
 <xsl:when test="$mode='foo'">
  <xsl:apply-templates select='category-list' mode='foo'/>
 </xsl:when>
</xsl:choose>

-- 
Benjamin Franz

"Premature optimization is the root of all evil in programming."
                                         ---C.A.R. Hoare



 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.