[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL-FO group by problem
At 2009-10-27 11:00 -0700, Mark Wilson wrote:
In an XSLT-FO style sheet, I have created groups similar to the one shown at the end of this email. Fine. I have one template for formatting the <CatalogNumber> and another for formatting the remaining data. The <CatalogNumber> is always identical in a group, but the remaining information differs. I want a single copy of the <CatalogNumber> and one copy each of all of the remaining information from each <Item>as indicated in the output below (I can format everything, that's not my problem, I just can't get the single copy of the <CatalogNumber>). What you are missing is that your current node at the beginning of <xsl:for-each-group> is at the first member of the group selected. Output: At this point, <xsl:value-of select="CatalogNumber"/> will give you "4" because your current node is the first <Item> of the group of <Item> elements. In the classroom I tell students to read the instruction as if it were written: <xsl:for-the-first-member-of-each-group ..... ... and then to work with the other members of the group using current-group(). <fo:block xsl:use-attribute-sets="base"> <xsl:for-each select="current-group()"> You put the processing of the catalogue number before the <xsl:for-each>, not inside. <xsl:apply-templates select="CatalogNumber" mode="do"/> Move that line up before the <xsl:for-each/> <xsl:apply-templates select="Title" mode="do"/> I hope this helps. . . . . . . . . . . . . . . Ken
|
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
|