Subject: RE: [xsl] Grouping similar elements and putting out information about the first and the last member From: "Huditsch Roman" <Roman.Huditsch@xxxxxxxxxxxxx> Date: Thu, 24 Feb 2005 10:59:59 +0100 |
Solved it. Thanks. wbr, Roman > -----Urspr|ngliche Nachricht----- > Von: Huditsch Roman [mailto:Roman.Huditsch@xxxxxxxxxxxxx] > Gesendet: Donnerstag, 24. Februar 2005 09:25 > An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Betreff: [xsl] Grouping similar elements and putting out > information about the first and the last member > > Hi group, > > I am once again catched in a grouping problem. > I have a structure like this one: > > > <norm xmlns="http://www.lexisnexis.at/schema/norm" id="dv_eheg"> > ... > <jur_block id="p13" v_ref="v0" v_marker="dazu"> > <zaehlung zaehlungsart="Paragraf">13</zaehlung> > <absatz>Das Verbot der Doppelehe (' 8 des > Ehegesetzes) steht einer Wiederholung der Eheschlie_ung nicht > entgegen, wenn die Ehegatten Zweifel an der G|ltigkeit oder > an dem Fortbestand ihrer Ehe hegen.</absatz> > </jur_block> > <jur_block id="p14_1" v_ref="v0" v_marker="dazu"> > <zaehlung zaehlungsart="Paragraf">14</zaehlung> > <absatz>[Text ist nicht vorhanden.]</absatz> > <anmerkung>(aufgehoben, StGBl 1945/31 und BGBl > 1976/331)</anmerkung> > </jur_block> > <jur_block id="p15_1" v_ref="v0" v_marker="dazu"> > <zaehlung zaehlungsart="Paragraf">15</zaehlung> > <absatz>[Text ist nicht vorhanden.]</absatz> > <anmerkung>(aufgehoben, StGBl 1945/31 und BGBl > 1976/331)</anmerkung> > </jur_block> > <jur_block id="p16" v_ref="v0" v_marker="dazu"> > <zaehlung zaehlungsart="Paragraf">16</zaehlung> > <absatz>Soweit auf die vermvgensrechtlichen > Beziehungen der Ehegatten aus einer f|r nichtig erkldrten Ehe > die im Falle der Scheidung geltenden Vorschriften > entsprechende Anwendung finden (' 31 Abs. 1 des Ehegesetzes), > kann im Falle des <version v_ref="v8"/> ' 69 Abs. 3 des > Ehegesetzes jeder Ehegatte Unterhalt ohne R|cksicht darauf > verlangen, wer die Nichtigkeitsklage erhoben hatte.</absatz> > </jur_block> > ... > </norm> > > For each <jur_block> which has an <anmerkung> starting with > "(aufgehoben" I need to put out the <zaehlung> of the first > preceding <jur_block> element with <absatz>[Text ist nicht > vorhanden.]</absatz> and the last following <jur_block>. > > For example, the stylesheet should produce a string like "13 > bis 15 (aufgehoben, StGBl 1945/31 und BGBl 1976/331)". > > I tried to solve this issue with <xsl:for-each-group> but I > was unable to get the <zaehlung> of the first and last group > member.... > > Here is my XSLT code snippet: > > <xsl:template match="ln:anmerkung"> > <xsl:variable name="val" select="."/> > <xsl:choose> > <xsl:when test="starts-with(., '(aufgehoben') > and preceding-sibling::ln:absatz[.='[Text ist nicht vorhanden.]']"> > <xsl:for-each-group > select="../../ln:jur_block" group-by="ln:anmerkung[.=$val]"> > <xsl:value-of > select="current-group()/ln:jur_block[1]/ln:zaehlung"/> > <xsl:text> bis </xsl:text> > <xsl:value-of > select="current-group()/ln:jur_block[last()]/ln:zaehlung"/> > </xsl:for-each-group> > <xsl:text> </xsl:text> > <xsl:apply-templates/> > </xsl:when> > <xsl:otherwise> > <inline style="*fettkursiv"> > <xsl:text>Anm. d. Red.: </xsl:text> > </inline> > <xsl:apply-templates/> > </xsl:otherwise> > </xsl:choose> > </xsl:template> > > Can you help me with this problem? > Thank you very much. > > wbr, > Roman
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Grouping similar elements and, Huditsch Roman | Thread | [xsl] Predicate on root node?, Mark Lundquist |
Re: [xsl] xsl recursion, Dimitre Novatchev | Date | Re: [xsl] xsl transform issue, David Carlisle |
Month |