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]

RE: 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?

the only problem with your solution is that you create copies of the
original nodes rather than references to them.

Try instead:

<xsl:variable name="selection"
	select="$selection_unread[filter='unread'] |
 		  $selection_unreplied[filter='unreplied'] |
		  $selection_all[not(filter='unread' or filter='unreplied')]"/>

Mike Kay

>
>       <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
>


 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]