[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

?group? but keep order of elements

Subject: ?group? but keep order of elements
From: "Naraschewski, E." <e.naraschewski@xxxxxxxxxxxxx>
Date: Tue, 22 Oct 2002 16:28:10 +0200
ordering a list by stylesheet
Hallo again,
(my first mail today somehow did not get through to the list)
again I read through the faqs (to Bryan S. Schnabel: the list with the p in it) and without any result. There are partly answers but not the answer I am looking for. I am not sure whether grouping is the right direction. 
I can not really fix a position. I can only say: Use the node <texteintrag> for all entries up to the next <uebung>, than take the node <uebung> up to the point where <texteintrag> starts again. Actually I would think of xsl:if or xsl:when, but if I choose these how can I keep the strucure? I simply need an xslt that transforms my xml, adds new elements and comprises the child elements and following siblings. Do I need something completely different to my stylesheet or is there a way to continue?

I would be grateful just for a little hint, not a perfect solution.

This is my stylesheet:

<xsl:template match="entry[not(MAT/Fundstelle/UbNummer)]">
<xsl:copy>  
<texteintrag>
<xsl:apply-templates/>
</texteintrag>
</xsl:copy>
</xsl:template>
<xsl:template match="entry[(MAT/Fundstelle/UbNummer)]">
<xsl:copy>  
<uebung>
<xsl:apply-templates/>
</uebung>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

The result:

<total>
<texteintrag>
<entry></entry>
</texteintrag>
<texteintrag>
<entry></entry>
</texteintrag>
(I do not know how many)
<uebung>
<entry>
<UbNummer></UbNummer>
</entry>
</uebung>
<uebung>
<entry>
<UbNummer></UbNummer>
</entry>
</uebung>
(I do not know how many)
</total>

I want:

<total>
<texteintrag>
<entry></entry>
<entry></entry>
</texteintrag>
(I do not know how many)
<uebung>
<entry>
<UbNummer></UbNummer>
</entry>
<entry>
<UbNummer></UbNummer>
</entry>
</uebung>
(I do not know how many)
</total>

Thanks in advance
Elke
*******************************************************
Elke Naraschewski - Ernst Klett Verlag GmbH -
Leistungscenter Mediengestaltung

Rotebühlstr. 77 - 70178 Stuttgart
Tel.: 0711/6672-1116 - Fax: 0711/6672-2023 - E-mail:
e.naraschewski@xxxxxxxxxxxxx

Stuttgart HRB 10746 - Verleger: Dr.h.c. Michael Klett
Geschäftsführer: Johannes Leßmann - Harald Melcher - Dr. Tilmann Michaletz - Dr. Wolf Unkelbach (Vorsitz)


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.