Hi,
sorry, I forgot. I use XSLT 2.0
Kind regards,
Monika
------------------------------
Date: Wed, 24 Sep 2008 10:46:43 +0200
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
From: "Madlik, Monika (LNG-VIE)" <Monika(_dot_)Madlik(_at_)lexisnexis(_dot_)at>
Subject: Changing the structur of a file
Message-ID:
<AB4D914EE3A3254CA8F439925297E4C604BEEC80(_at_)LNGVIEEXCP01VB(_dot_)legal(_dot_)regn(_dot_)net>
Hi,
I've a problem structuring a file in a special way.
This is an excerpt of my XML-file:
<Document>
<artikel>
<meta.p>
<fachgbt.p-alt>
<fachgbt.a-alt kuerzel=3D"QUAS">
Qualit=E4tssicherung/Qualit=E4tsmanagement
</fachgbt.a-alt>
</fachgbt.p-alt>
</meta.p>
<artikel-allg>
<stichwt.p>
<stichwt.a>Ablaufdiagramm</stichwt.a>
</stichwt.p>
<inhalt.p>
<variante.p>
<uebers.engl.a>
<gentext type=3D"gerade">(engl.) </gentext>flow =
chart<gentext type=3D"gerade">;</gentext>
</uebers.engl.a>
<variante.syn.a>
<gentext> syn. </gentext>Flussdiagramm<gentext>;</gentext>
</variante.syn.a>
</variante.p>
<titel>Definition</titel>
<bedeut.p>
<bedeut.a>
<gentext/>visuelle Darstellung von Prozessen in Form von =
graphischen Symbolen mit Erl=E4uterung;<gentext/>
</bedeut.a>
<bedeut.zus.a>
<struk typ=3D"verw" absatz=3D"nein">
<titel>Verwendung</titel>
<text absatz=3D"nein">z.=A0B. im =
Qualit=E4tsmanagement.</text>
</struk>
</bedeut.zus.a>
</bedeut.p>
</inhalt.p>
</artikel-allg>
</artikel>
</Document>
I have to structure the file the way, that every <titel> becomes =
<gliederung1>. But the second <titel> is not at the same hirarchy as the
=
first <titel>.=20
This is the excerpt how the XML-file should look like:
<gliederung1>
<ueberschrift>Definition</ueberschrift>
<absatz>visuelle Darstellung von Prozessen in Form von graphischen =
Symbolen mit Erl=E4uterung;</absatz>
</gliederung1>
<gliederung1>
<ueberschrift>Verwendung</ueberschrift>
<absatz>z.=A0B. im Qualit=E4tsmanagement.</absatz>
</gliederung1>=20
I tried to solve this via xsl:key, but either I got no text or I got all
=
text including the text under the second title.
The second <title> is no problem, but the first <titel> is ...
This is a part of my XSLT-file:
<xsl:template match=3D"titel">
<xsl:choose>
<xsl:when test=3D"not(preceding::titel)">
<gliederung1>
<ueberschrift><xsl:apply-templates/></ueberschrift>
<xsl:apply-templates select=3D"key('immediate-nodes_t1', =
generate-id())" mode=3D"gl1"/>
</gliederung1>
</xsl:when>
<xsl:when test=3D"preceding::titel">
<gliederung1>
<ueberschrift><xsl:apply-templates/></ueberschrift>
<xsl:apply-templates select=3D"key('immediate-nodes_t2', =
generate-id())" mode=3D"gl1"/>
</gliederung1>
</xsl:when>
</xsl:choose>
</xsl:template>
=09
<xsl:key name=3D"immediate-nodes_t1" =
match=3D"node()[following::node()[not(self::titel)]]"
use=3D"generate-id(preceding-sibling::*[self::titel][1])"/>=20
=09
<xsl:key name=3D"immediate-nodes_t2"=20
match=3D"node()[not(self::titel) and not(descendant::titel)]"
use=3D"generate-id(preceding-sibling::*[self::titel][1])"/>
I hope I find somebody that could help me :)
Kind regards,
Monika
=20
------------------------------
Date: Wed, 24 Sep 2008 14:24:56 +0200
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
From: Martin Honnen <Martin(_dot_)Honnen(_at_)gmx(_dot_)de>
Subject: Re: [xsl] Changing the structur of a file
Message-ID: <48DA3198(_dot_)6060205(_at_)gmx(_dot_)de>
Madlik, Monika (LNG-VIE) wrote:
I hope I find somebody that could help me :)
Please let us know whether you want to use XSLT 2.0 or 1.0 to solve
that.
--
Martin Honnen
http://JavaScript.FAQTs.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>
--~--