This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
add elements
- From: "Naraschewski, E." <e dot naraschewski at klett-mail dot de>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 4 Sep 2002 14:11:25 +0200
- Subject: [xsl] add elements
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello,
thank you Joerg, now I got all the tags.
I get the right result when using saxon and the task line. But I don`t get the result using xml-spy. Are there any options to change?
I start my xml file with this template:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="ISO-8859-1" indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
but still don`t know how to continue, what to use where.
This is my xml file. It consists of numerous entries. Some entries do have the Element <UbNummer> and some don`t. I want to ask something like that: Every entry which does not contain the element <UbNummer> gets a new Element <texteintrag>.
<entry>
<MAT matid="687714453w">
<Sachgebiete></Sachgebiete>
<Fundstelle>
<Band>1</Band>
<Lektion>1</Lektion>
<LektionsKategorie>X</LektionsKategorie>
<AbsolutePos>1</AbsolutePos>
<IndividPos>10816</IndividPos>
<UbNummer>1</UbNummer>
</Fundstelle>
</MAT>
<LO><LO>
</entry>
...
This is the result I would like to get:
<entry>
<texteintrag>
<MAT matid="687714453w">
<Sachgebiete></Sachgebiete>
<Fundstelle>
<Band>1</Band>
<Lektion>1</Lektion>
<LektionsKategorie>X</LektionsKategorie>
<AbsolutePos>1</AbsolutePos>
<IndividPos>10816</IndividPos>
</Fundstelle>
</MAT>
<LO></LO>
</texteintrag>
</entry>
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@klett-mail.de
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