[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|