This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

conditional tree variables


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]