Subject: Re: [xsl] Group elements by two keys From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Mon, 21 Sep 2009 14:31:04 +0200 |
The desired output is: TEST COM N1-N_One, N2-N_Two, N3-N_Three Info1-1A N1-N_One, N2-N_Two Info3-3B
RAF N1-N_One, N4-N_Four Info2-2A N2-N_Two, N4-N_Four Info5-2A Info4-4B
As you can see the first group is the value of the fir/info/type element, the second group title should be a combined string created out of the data of itemA elements of a fir element.
I'd like to know if this is possible and if yes how.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output indent="yes"/> <xsl:strip-space elements="*"/>
<xsl:template match="/"> <html lang="en"> <head> <title>Test</title> </head> <body> <h1>Test</h1> <xsl:apply-templates/> </body> </html> </xsl:template>
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" exclude-result-prefixes="exsl" version="1.0">
<xsl:output indent="yes"/> <xsl:strip-space elements="*"/>
<xsl:key name="k1" match="fir/info" use="typ"/> <xsl:key name="k2" match="group/info" use="concat(../@key, '|', @key)"/>
<xsl:template match="/"> <html lang="en"> <head> <title>Test</title> </head> <body> <h1>Test</h1> <xsl:apply-templates/> </body> </html> </xsl:template>
Martin Honnen http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Group elements by two key, Andrew Welch | Thread | [xsl] calling java methods from a s, Garvin Riensche |
Re: [xsl] Problem with count iterat, Martin Honnen | Date | Re: [xsl] Problem with count iterat, Martin Honnen |
Month |