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

Recursive apply-templates

Subject: Recursive apply-templates
From: Sam Saha <sam_saha1975@xxxxxxxx>
Date: Wed, 5 May 2004 10:01:49 -0400 (EDT)
apply templates recursive
I have this XML. I am doing a match on the nodes below
root/data.

<root>
    <data>
	<adress>
		<even>
			<phone cont="mobile">
				<code>099999</code>
				<number>55555</number>
				<prov>att</prov>
			</phone>
		</even>
	</address>
	<value1>aaaa</value1>
	<value2>bbbb</value2>
	<value3>cccc</value3>
	<value4>dddd</value4>
	<value5>eeee</value5>
    </data>
</root>

I do <xsl:apply-templates select="root/data/*" /> 

I have a template match like this:

<xsl:template match="node()">
	<xsl:element name="local-name()"><xsl:value-of
select="key('mykey',local-name())" /></xsl:element>
</xsl:template>

The key is defined as 
<xsl:key name="mykey" match="root/data/*"
use="local-name()" />

I'm outputting XML in name value pairs. At the moment
this template match only picks up all the data that is
under root/data but leaves off anythin that is
hierarchically under it (even/phone/code etc).

How do I write a template match so that all the output
XML looks exactly like the input XML. I do not know
how to recursively 
use apply-templates. Can someone help?

Thanks
Sam

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

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.