View Single Post
  #2 (permalink)  
Old March 4th, 2012, 05:46 AM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 17,570, Level: 57
Points: 17,570, Level: 57 Points: 17,570, Level: 57 Points: 17,570, Level: 57
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,800
Thanks: 0
Thanked 260 Times in 255 Posts
Default

I think I would tackle this with something like

Code:
<xsl:variable name="rows" select="//Row"/>
<xsl:for-each select="distinct-values(for $n in $rows/Column/@name return substring-before($n, '_Month_Total')[. != '']">
  <xsl:variable name="month"
  <Row>
     ... create row for month $month ...
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote