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

add elements

Subject: add elements
From: "Naraschewski, E." <e.naraschewski@xxxxxxxxxxxxx>
Date: Wed, 4 Sep 2002 14:11:25 +0200
how to add elements
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@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)


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


Current Thread
  • add elements
    • Naraschewski, E. - Wed, 4 Sep 2002 08:10:32 -0400 (EDT) <=
      • Mike Brown - Wed, 4 Sep 2002 12:41:35 -0400 (EDT)

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.