This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
variable nodelist travarse how??
- From: "Tareq Rahman" <saif_1587 at hotmail dot com>
- To: XSL-List at lists dot mulberrytech dot com
- Date: Tue, 21 May 2002 14:31:47 +0600
- Subject: [xsl] variable nodelist travarse how??
- Reply-to: xsl-list at lists dot mulberrytech dot com
I have a variable declaerd as:
<xsl:variable name="varNodepkli">
<xsl:for-each select="$abc">
<xsl:element name="pkli">
<xsl:attribute name="pkli_oid">
<xsl:value-of select="@pkli_oid" />
</xsl:attribute>
<xsl:attribute name="pkli_ositem">
<xsl:value-of select="@pkli_ositem" />
</xsl:attribute>
<xsl:attribute name="pkli_clsz">
<xsl:value-of select="@pkli_clsz" />
</xsl:attribute>
<xsl:attribute name="pkli_colr">
<xsl:value-of select="@pkli_colr" />
</xsl:attribute>
<xsl:attribute name="pkli_size">
<xsl:value-of select="@pkli_size" />
</xsl:attribute>
<xsl:attribute name="pkli_qnty">
<xsl:value-of select="@pkli_qnty" />
</xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:variable>
Then i called a template as:
<xsl:call-template name="pkliAdd">
<xsl:with-param name="pk" select="$varNodepkli"/>
</xsl:call-template>
The template needs to travarse by recursion all the pkli nodes in the
variable. So i tried
<xsl:template name="pkliAdd">
<xsl:param name="pk"/>
<xsl:choose>
<xsl:when test="$pk">
<xsl:element name="pkli">
<xsl:attribute name="pkli_oid">
<xsl:value-of
select="msxsl:node-set($pk)/pkli/@pkli_oid" />
</xsl:attribute>
</xsl:element>
<xsl:call-template name="pkliAdd">
<xsl:with-param name="pk" select="following-sibling::$pk"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
It seems that i can access the value of pk by
"msxsl:node-set($pk)/pkli/@pkli_oid" in this manner but cant find way to
call the
next sibling.
Please can anybody help me with this?
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list