This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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@unisvr.net.tw

**  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="." />'&#xA;<xsl:text />
</xsl:template>
</xsl:stylesheet>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]