xsl-list
[Top] [All Lists]

Re: [xsl] grouping problem

2011-02-17 04:22:40
There are zero "absatz[@typ='jur_start']" in the input.

There are either
abatz[@typ='jur_start'] (abatz and not absatz)
or
absatz[@typ="erltext"] (absatz, but with a different value for @typ)

If you replace abatz with absatz in the source I believe you get the
result you're expecting?

Regards,
EB


On Thu, Feb 17, 2011 at 10:59 AM, Szabo, Patrick (LNG-VIE)
<patrick(_dot_)szabo(_at_)lexisnexis(_dot_)at> wrote:
Hi,

I'm using XSLT 2.0 and Saxon 9

I got the following input:

<einzelvorschrift>
   <zaehlung normiert="Art. 2" nr="--TODO--" ordnungszeichen="--TODO--">Art. 
2</zaehlung>
   <abatz typ="jur_start"><gldsym>Artikel 2.</gldsym> (1) Österreich ist ein 
Bundesstaat.</abatz>
   <abatz typ="jur_start">(2) Der Bundesstaat wird gebildet aus den 
selbständigen Ländern:</abatz>
   <absatz typ="erltext" ct="text" halign="j">Burgenland, Kärnten, 
Niederösterreich, Oberösterreich,</absatz>
   <abatz typ="jur_start">(3) Änderungen im Bestand der </abatz>
</einzelvorschrift>

I did the following:

<xsl:template match="einzelvorschrift">
       <xsl:copy>
               <xsl:apply-templates select="zaehlung"/>
               <xsl:for-each-group select="* except zaehlung" 
group-starting-with="absatz[@typ='jur_start']">
                       <jurabsatz>
                               <xsl:apply-templates select="current-group()"/>
                       </jurabsatz>
               </xsl:for-each-group>
       </xsl:copy>
</xsl:template>

Output:

<einzelvorschrift>
  <zaehlung normiert="Art. 2" nr="--TODO--" ordnungszeichen="--TODO--">Art. 
2</zaehlung>
  <jurabsatz>
     <abatz typ="jur_start"><gldsym>Artikel 2.</gldsym> (1) Österreich ist 
ein Bundesstaat.</abatz>
     <abatz typ="jur_start">(2) Der Bundesstaat wird gebildet aus den 
selbständigen Ländern:</abatz>
     <absatz typ="erltext" ct="text" halign="j">Burgenland, Kärnten, 
Niederösterreich, Oberösterreich,</absatz>
     <abatz typ="jur_start">(3) Änderungen im Bestand der </abatz>
  <jurabsatz>
</einzelvorschrift>

Shouldn't each absatz[@typ='jur_start'] be wrapped in his own jurabsatz !?
How can i do that ?!

Kind regards


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT-Entwickler
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick(_dot_)szabo(_at_)lexisnexis(_dot_)at
Tel.: +43 (1) 534 52 - 1573
Fax: +43 (1) 534 52 - 146






--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>