Antw: RE: [xsl] flatten a hierachy and change positions

Subject: Antw: RE: [xsl] flatten a hierachy and change positions
From: "Elke Naraschewski" <e.naraschewski@xxxxxxxxxxxxx>
Date: Thu, 25 Sep 2003 11:54:44 +0200
Hallo Jenni, Andreas, Michael, 
my Mailsystem had a Problem so I recieved your answers just a few minutes ago. Thanks for your anwsers.
This is just an extract from a longer document.
I forgot the closing g1... And I should have added, like Andreas did, a root Element. g1 comes first because its content is the main text and u1 ist the headline. My root is <handbuch><deckblatt>
<marginalie></marginalie>
</deckblatt
<g1>....
</handbuch>

My hierachy needs to be flattened because it has to be imported into a content management system. I have to change the names:

for Example:

<xsl:template match="g1">
<field name="g1" type="text_plain">
<xsl:apply-templates/>
</field>
</xsl:template>

<xsl:template match="u1">
<field name="u1" type="text_plain">
<xsl:apply-templates/>
</field>
</xsl:template>

and than I thought about how to put the Elemtents out of their hierachy in a special order. That's where I got stuck.

Elke


****************************************************************************************************
Elke Naraschewski - Ernst Klett Verlag GmbH Stuttgart - Leistungscenter
Mediengestaltung - Rotebühlstr.77 - 70178 Stuttgart
Tel.: 0711/6672-1116 - Fax: 0711/6672-2023 - eMail: 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)
****************************************************************************************************

>>> mhk@xxxxxxxxx 24.09.03 18:39:23 >>>
> I looked up the list and books but still don't get a clue 
> which method to choose.  I want to flatten a hierachy and 
> change positions, the way the following example shows:
> 
> I have:
> 
<handbuch>
<deckblatt>
<marginalie></marginalie>
</deckblatt
> <g1>
> <u1><s></s></u1>
></g1>
> <g2>
> <u2></u2>
> </g2>
</handbuch>
> 
> I need:
> 
> <u1></u1>
> <s></s>
> <g1></g1>
> <u2></u2>
> <g2></g2>
> 

It's not possible (for me at any rate) to deduce from this input and
output what your transformation rules are. Why exactly does <u1> come
first in your output and <g1> come third? And where is the closing </g1>
tag?

Michael Kay


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



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


Current Thread