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

RE: Conditional counting

Subject: RE: Conditional counting
From: "Hunsberger, Peter" <Peter.Hunsberger@xxxxxxxxxx>
Date: Fri, 12 Oct 2001 09:04:13 -0500
RE:  Conditional counting
<snip>

>There are several possibilities, depending on your exact problem.
>If your extension methods produce a node-set with node for each table row,
>as yoursecond template suggests, you can try
>
> <xsl:if test="$gunk = 'x''">
>   <xsl:variable name="result" select="myExt.method1(*)"/>
>   <table border="1">
>     <xsl:apply-templates select="$result" mode="x" />
>   </table>
>   <xsl:value-of select="count($result)"/> rows generated.
> </xsl:if>
> <xsl:if test="$gunk != 'x'">
>   <table border="1">
>     <xsl:variable name="result" select="myExt.method2(*)"/>
>     <xsl:apply-templates select="$result" mode="x" />
>   </table>
>   <xsl:value-of select="count($result)"/> rows generated.
> </xsl:if>
>
>Note that you'll have to distribute a lot of stuff into the
>conditional statements, because of the way variables are scoped.

</snip>

Yes, that thought had occurred to me but I ruled it out for exactly that
reason.

<snip>

>Be warned this will also count rows of nested tables, you may have to
>fiddle with the expression a bit if you experience difficulties
>(xx:node-set($result)/tr might work, but i'm not sure).

</snip>

There won't be nested tables so either case should work.  Jeni also
suggested this solution, it seem like the most viable.


 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.