[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: grouping like items into one
[Please: Do not create a new thread by answering to a previous post, since many mail readers will group the post according to threads based on internal IDs and not subject lines.] Your requirement looks a lot like xsl:for-each-group. I wrote a template for DD (or /DD) that handles the border grouping. If you remove your <xsl:template match="text"> it gives the desired output. [Created with Kernows XSLT playground feature.] <xsl:template match="DD"> <xsl:copy> <xsl:for-each-group select="text" group-adjacent="if (self::text[@border='single']) then 1 else 0"> <xsl:choose> <xsl:when test="current-grouping-key() = 1"> <span class="border"> <xsl:apply-templates select="current-group()" mode="moreStyles"/> </span> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="current-group()" mode="moreStyles"/> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </xsl:copy> </xsl:template> - Michael Am 23.01.2009 um 02:37 schrieb Fred Christian: xmlns:xsl="http://www.w3.org/1999/XSL/TransformI know I have done this with xsl 1.0 before and could figure it out, but 1.0 is painful :) So I am trying to figure it out with 2.0 and am getting stuck. I am running into that "how do I know what to look up if I don't know how to spell it" jam. I looked at the xsl:for-each-group element, but I don't think that will work in this situation. Someone want to take a whack at it? " xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:saxon="http://saxon.sf.net/" exclude-result-prefixes="xs saxon">
|
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
|