xsl-list
[Top] [All Lists]

How to return a result for just the first group

2005-01-24 17:20:06
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[(_at_)type='TITLE'][1],
                             $separator,
                             title_list/title[(_at_)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()[(_at_)type='TITLE']",
                               $separator,
                               current-group()[(_at_)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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>