[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Conditional counting
I've got an XSLt running under LotusXSLt (Xalan) that conditionally calls two different extensions: <table border="1"> <xsl:if test="$gunk = 'x''"> <xsl:apply-templates select="myExt.method1(*)" mode="x" /> </xsl:if> <xsl:if test="$gunk != 'x'"> <xsl:apply-templates select="myExt.method2(*)" mode="x"/> </xsl:if> </table> <xsl:value-of select="count(tr)"/> rows generated. The returned results will include a varying number of <tr> tags (table rows) independent of the passed XML I'd like to have the count reflect the number of tr tags returned from the extensions. As it is, the count is going to reflect the number of <tr> tags in the input XML (zero in our case). The child template simply resembles something like: <xsl:template match="row" mode="x"> <tr> <xsl:apply-templates select="*" mode="x"/> </tr> </xsl:template> I've tried a couple of differing approaches, in particular with placing the extension results into a variable and then parsing the variable and counting the tr elements in the variable, but so far no go. Peter Hunsberger 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
|