Subject: [xsl] Recursive apply-templates From: Sam Saha <sam_saha1975@xxxxxxxx> Date: Wed, 5 May 2004 10:01:49 -0400 (EDT) |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Positioning block-container i, Mark Williams | Thread | Re: [xsl] Recursive apply-templates, Mukul Gandhi |
[xsl] Positioning block-container i, Mark Williams | Date | RE: [xsl] Parameter entity must be , Andrew Welch |
Month |