oooh sorry i forgot to write what i want in the output:
the output shoud be like this:
<programlisting>
<HTML>
<HEAD>
<BODY>
</programlisting>
--- Ursprüngliche Nachricht ---
Von: "Silvia Liberto" <SLiberto(_at_)gmx(_dot_)de>
An: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Betreff: Re: [xsl] Grouping with keys
Datum: Wed, 8 Feb 2006 15:48:36 +0100 (MET)
Hi Wendell and all,
thanks for helping, i know what you mean when you say i should try a
simpler
solution, but i need this key! ;-)
so i have changed my syntax on the @use attribute for Programlisting.
generate-id(preceding-sibling::p[pPr/pStyle/@val='Heading1'][1])
but it still doesn´t works!? i have no grouping effect?
i can´t find the reason, have you another idea?
<xsl:key name="prog" match="p[pPr/pStyle/@val='Programlisting']"
use="generate-id(preceding-sibling::p[pPr/pStyle/@val='Programlisting'][1])"/>
<xsl:template match="p">
<xsl:choose>
<xsl:when test="pPr/pStyle/@val='Heading1'">
<title>
<xsl:value-of select="r/t"/>
</title>
</xsl:when>
<xsl:when test="pPr/pStyle/@val='Programlisting'">
<programlisting>
<xsl:for-each select="key('prog',generate-id())">
<xsl:value-of select="r/t"/>
</xsl:for-each>
</programlisting>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
XML:
<?xml version="1.0" encoding="UTF-8"?>
<!--<?mso-application progid="Word.Document"?>-->
<wordDocument>
<body>
<sect>
<p>
<pPr>
<pStyle val="Heading1"/>
</pPr>
<r>
<t>Erste Ueberschrift</t>
</r>
</p>
<p>
<pPr>
<pStyle val="Programlisting"/>
</pPr>
<r>
<t><HTML></t>
</r>
</p>
<p>
<pPr>
<pStyle val="Programlisting"/>
</pPr>
<r>
<t> <HEAD></t>
</r>
</p>
<p>
<pPr>
<pStyle val="Programlisting"/>
</pPr>
<r>
<t> <BODY></t>
</r>
</p>
</sect>
</body>
</wordDocument>
--
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie
--~------------------------------------------------------------------
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>
--~--
--
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner
--~------------------------------------------------------------------
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>
--~--