[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to return a result for just the first group
I've got XML like this: <title_list> <title type="TITLE" language="de">Gummi- und Kunststoffschlaeuche und -schlauchleitungen mit Drahteinlage; Hydraulik-Impulspruefung mit wechselnder Biegung (ISO 6802:1991)</title> <title type="SUBTITLE" language="de">Deutsche Fassung EN 26802:1993</title> <title type="TITLE" language="en">Rubber and plastics hose and hose assemblies with wire reinforcements; hydraulic impulse test with flexing (ISO 6802:1991)</title></title> <title type="SUBTITLE" language="en">german version EN 26802:1993</title> </title_list> What I want to do is generate text by concatenating the title and subtitle of the first language: Gummi- und Kunststoffschlaeuche und -schlauchleitungen mit Drahteinlage; Hydraulik-Impulspruefung mit wechselnder Biegung (ISO 6802:1991) Deutsche Fassung EN 26802:1993 That is easy enough to do when the title and subtitle pairs are already grouped by language as above: <xsl:value-of select="concat(title_list/title[@type='TITLE'][1], $separator, title_list/title[@type='SUBTITLE'][1])"/> But if the order were to change, that wouldn't work: <title_list> <title type="TITLE" language="de">Gummi- und Kunststoffschlaeuche und -schlauchleitungen mit Drahteinlage; Hydraulik-Impulspruefung mit wechselnder Biegung (ISO 6802:1991)</title> <title type="TITLE" language="en">Rubber and plastics hose and hose assemblies with wire reinforcements; hydraulic impulse test with flexing (ISO 6802:1991)</title></title> <title type="SUBTITLE" language="en">german version EN 26802:1993</title> </title_list> <title type="SUBTITLE" language="de">Deutsche Fassung EN 26802:1993</title> To get that same result, I think I need to use for-each-group: <xsl:for-each-group select="mb3e:title_list/mb3e:title" group-by="@language"> <xsl:value-of select="concat(current-group()[@type='TITLE']", $separator, current-group()[@type='EXT']")/> </xsl:for-each-group> But I don't know how to restrict it so that value-of is only applied to the first group... Thanks, -- Kevin
|
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
|