[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Grouping & Counting Attribures
The newbie is back at the fountain of knowledge - I thought I had this, first part was too easy, but...... Maybe I'm learning how to post hereto. My data looks like: <dsQueryResponse> <Rows> <Row AuditName="Cashbox II" State="ActionPlan" category="a" /> <Row AuditName="SNP" State="ActionPlan" category="a" /> <Row AuditName="Cashbox II" State="InReview" category="a" /> <Row AuditName="SNP" State="ActionPlan" category="b" /> </Rows> </dsQueryResponse> My current xslt follows with ### indicating experimental lines that do not work, and ??? indicating questions on specific lines. <xsl:key name="audits" match="Row" use="@AuditName" /> <xsl:template match="/dsQueryResponse/Rows"> <table> <tr><th>AUDIT</th><th># Rows</th> <th># ActionPlan</th><th># InReview</th> <th># FollowUp</th><th># Closed</th> </tr> <xsl:apply-templates select="*[@AuditName and generate-id(.)=generate-id(key('audits', @AuditName))]" /> ??? why didn't this need a [1] near end to get first occurance ??? </table> </xsl:template> <xsl:template match="*[@AuditName]"> <xsl:variable name="findings" select=key('audits', @AuditName)/> intention was to get sub-set of rows for 1 audit into a variable <tr> <td><xsl:value-of select="@AuditName" /></td> <td><xsl:value-of select="count(key('audits', @AuditName))" /></td> ### this works ### <td><xsl:value-of select="count($findings[@State='ActionPlan'])" /></td> ### above line does not work, was meant to go with above. ### <td><xsl:value-of select="count(key('audits', @State['InReview']))" /></td> ### this states what I am trying to do, but I know syntax is wrong ### ### cannot select on the 2D list returned by key ### </tr> </xsl:template> Output would be like: Audit # Rows ActionPlan InReview .......... CashboxII 2 1 1 SPN 2 2 0 Dick Penny
|
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
|