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

AW: Changing the strucur of a file

Subject: AW: Changing the strucur of a file
From: "Madlik, Monika (LNG-VIE)" <Monika.Madlik@xxxxxxxxxxxxx>
Date: Fri, 26 Sep 2008 07:25:52 +0200
 AW: Changing the strucur of a file
Hi,

sorry, I forgot. I use XSLT 2.0

Kind regards,
Monika

------------------------------

Date: Wed, 24 Sep 2008 10:46:43 +0200
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
From: "Madlik, Monika (LNG-VIE)" <Monika.Madlik@xxxxxxxxxxxxx>
Subject: Changing the structur of a file
Message-ID:
<AB4D914EE3A3254CA8F439925297E4C604BEEC80@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxxxxx
From: Martin Honnen <Martin.Honnen@xxxxxx>
Subject: Re:  Changing the structur of a file
Message-ID: <48DA3198.6060205@xxxxxx>

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/

------------------------------

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.