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

changing the nodeset

Subject: changing the nodeset
From: Michael Schäfer <MSchaefer@xxxxxxxxxxxx>
Date: Thu, 12 Jul 2001 17:00:04 +0200
mike schaefer
Hello,

I process a XML-doc, which contains several <EL1>-elements and
<EL2>-elements and so on. The processing adds numbers as elements to the
new tree.

Now I want to start with numbers, I load from another xml-file, let's
say calld start.xml
In the root of the target I want to add a entity, which contains
elements for all counted elements with the occurrences + the start
values.
So I try

<xsl:template match="/ROOT">
	<!-- now I am in the root-node -->
	<xsl:copy>
		<!-- I copy the root-node and all them children -->
		<xsl:apply-templates select="node()|@*" />

		<!-- now I create a new entity -->
		<xsl:element name="START">
			<!-- I process the nodes in document start.xml
-->
			<xsl:for-each
select="document('start.xml')/START/*">
				<!-- Now my context is a child of
start.xml/START -->
				<!-- I add a new element with the name
of the current node -->
				<xsl:element name="{name()}">
					<!-- and now I want to add the
content of context-node with the occurences of th original doc -->
					<!-- so I have to change context
but how ? -->
					<xsl:value-of
select="number(.)+count(//name())/">
				</xsl:element>
			</xsl:for-each>
		</xsl:element>
	</xsl:copy>
</xsl:template>





Mit freundlichen Grüßen
Michael Schäfer

---------------------------------------------------------------
Dipl.-Ing. Michael Schäfer
e-business

Pfeil GmbH
Obertorstr. 4-6
66111 Saarbrücken 

Tel.: 06 81/3 79 85-30
Fax: 06 81/3 79 85-13

e-Mail: mschaefer@xxxxxxxxxxxx
Internet: www.pfeilgmbh.de


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


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.