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

conditional tree variables

Subject: conditional tree variables
From: "Mattias Konradsson" <preacher@xxxxxxxxxxx>
Date: Sat, 26 May 2001 16:25:27 +0200
conditional tree
Hmm, I want a variable to contain a different nodeset depending on some
conditions, using  a where-clause surrounding the variable doesn't work of
course because of scope, but shouldnt this work?

      <xsl:variable name="selection_all" select="//header[Sender =
$current_user]"/>
      <xsl:variable name="selection_unread"
select="$selection_all[not(DateRead)]"/>
      <xsl:variable name="selection_unreplied"
select="$selection_all[RepliedTo = 'False']"/>

      <xsl:variable name="selection">
           <xsl:choose>
                <xsl:when test="filter='unread'"><xsl:copy-of
select="$selection_unread"/></xsl:when>
                <xsl:when test="filter='unreplied'"><xsl:copy-of
select="$selection_unreplied" /></xsl:when>
                <xsl:otherwise><xsl:copy-of
select="$selection_all"/></xsl:otherwise>
           </xsl:choose>
      </xsl:variable>

Best Regards
---
Mattias Konradsson



 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.