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="QUAS">
Qualitätssicherung/Qualitätsmanagement
</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="gerade">(engl.) </gentext>flow chart<gentext
type="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äuterung;<gentext/>
</bedeut.a>
<bedeut.zus.a>
<struk typ="verw" absatz="nein">
<titel>Verwendung</titel>
<text absatz="nein">z. B. im Qualitätsmanagement.</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>.
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äuterung;</absatz>
</gliederung1>
<gliederung1>
<ueberschrift>Verwendung</ueberschrift>
<absatz>z. B. im Qualitätsmanagement.</absatz>
</gliederung1>
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="titel">
<xsl:choose>
<xsl:when test="not(preceding::titel)">
<gliederung1>
<ueberschrift><xsl:apply-templates/></ueberschrift>
<xsl:apply-templates select="key('immediate-nodes_t1',
generate-id())" mode="gl1"/>
</gliederung1>
</xsl:when>
<xsl:when test="preceding::titel">
<gliederung1>
<ueberschrift><xsl:apply-templates/></ueberschrift>
<xsl:apply-templates select="key('immediate-nodes_t2',
generate-id())" mode="gl1"/>
</gliederung1>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:key name="immediate-nodes_t1"
match="node()[following::node()[not(self::titel)]]"
use="generate-id(preceding-sibling::*[self::titel][1])"/>
<xsl:key name="immediate-nodes_t2"
match="node()[not(self::titel) and not(descendant::titel)]"
use="generate-id(preceding-sibling::*[self::titel][1])"/>
I hope I find somebody that could help me :)
Kind regards,
Monika
--~------------------------------------------------------------------
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>
--~--