I think the previous advice to ask on the xsl-list (Mulberry) is sound. I don't know for sure, but it strikes me that iterating over records may not be the best approach. Perhaps something like the following structure (untested) would help make things clearer.
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" version="2.0"> <xsl:variable name="current_year" select="year-from-date( current-date() )"/> <xsl:template match="/document"> <!-- generate "J F M A M J J A S O N D Total" heading here --> <xsl:apply-templates select="usage[record/year[ number( . ) + 4 > $current_year ] ]"> <xsl:sort select="record/year"/> </xsl:apply-templates> </xsl:template> <xsl:template match="usage"> <output-row-element> <!-- generate cell with year label here --> <xsl:apply-templates select="record"> <xsl:sort select="month"/> </xsl:apply-templates> <!-- generate cell w/ total here --> </output-row-element> </xsl:template> <xsl:template match="record"> <!-- generate cell w/ quantity here --> </xsl:template> </xsl:stylesheet> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
