|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re:recursive problem with full path and position info
Hi,
Dan, I found I got a different solution from yours while experimenting Jeni
method as you suggested.
I have root(2) instead of root(1) , perhaps you can correct me the missing
point.
I am using Msxml3, and ie5, the complete xsl are listing below fyi.
Thanks,
Sun-fu Yang
sfyang@xxxxxxxxxxxxx
** output result **
root(2).a(1).b(1) = '1'
root(2).a(1).b(2) = '2'
root(2).a(2).b(1) = '3'
root(2).a(2).b(2) = '4'
**xsl file **
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="*">
<xsl:param name="path" />
<xsl:apply-templates select="*">
<xsl:with-param name="path" select="concat($path, name(), '(',
position(), ').')" />
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*[not(*)]">
<xsl:param name="path" />
<xsl:value-of select="$path" />
<xsl:value-of select="name()" />(<xsl:value-of select="position()" />
<xsl:text>) = '</xsl:text>
<xsl:value-of select="." />'
<xsl:text />
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








