|
next
|
Subject: Shed some light PLEASE!!!!!!! Author: Jeff Berney Date: 11 May 2007 10:37 PM
|
Hello All,
I have an XML that looks like this
<Table>
<node6>11111,22222,33333</node1>
</Table>
I want to substring the comma and use that as an attribute..kinda like this..
<MyNode id='111111' />
<MyNode id='22222' />
<MyNode id='33333' />
here's my code..
<PolicyDetail> <xsl:call-template name="splitbycomma">
<xsl:with-param name="string" select="PolicyDetailsID"/>
<xsl:with-param name="lobstring" select="LOBID"/>
</xsl:call-template>
</PolicyDetail>
<xsl:template name="splitbycomma">
<xsl:param name="string"/>
<xsl:param name="lobstring"/>
<xsl:element name="PolicyDetail">
<xsl:choose>
<xsl:when test="contains($string,',')">
<xsl:attribute name="pdid">
<xsl:value-of select="substring-before($string,',')"/>
</xsl:attribute>
<xsl:attribute name="lobid">
<xsl:value-of select="substring-before($lobstring,',')"/>
</xsl:attribute>
<xsl:call-template name="splitbycomma">
<xsl:with-param name="string" select="substring-after($string,',')"/> </xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:element>
</xsl:template>
Now I just get an ifinite loop.. i dont know what i'm doing wrong. Is there a way to get out of this or another way to work around this..please help..thanks jeff
|
|
|