I have a XMl document that needs to transform to string. What I need is to
get all of each value from each xml node and separate each value by coma. To
do this, I created a XML document and xsl file. I get results as what I
needed if I validate xml document using the xsl file with IE 6.0. However, if
I do this in VB.net, I can not get coma or any other charactors to separate
value. Any one can help?
Here is the XSL code:
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:variable name="coma" select="','" />
<xsl:param name="strArray"
select="'string1,string2,string3,string4,string5,s tring6'" />
<xsl:param name="elm" select="substring-before($strArray,$coma)" />
<xsl:param name="pattern" select="$coma"/>
<xsl:template name="test" match="TenderAuthorization/Fields">
<xsl:call-template name="getNext">
<xsl:with-param name="string" select="$strArray" />
</xsl:call-template>
</xsl:template>
<xsl:template name="getNext">
<xsl:param name="string" />
<xsl:if test="$string" >
<xsl:call-template name="getMatch" >
<xsl:with-param name="nodeName" select="substring-before($string,
$pattern)" />
</xsl:call-template>
<xsl:call-template name="getNext">
<xsl:with-param name="string" select="substring-after($string, $pattern)"
/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="getMatch" >
<xsl:param name="nodeName"/>
<xsl:for-each select="child::node()">
<xsl:if test="name(.)=$nodeName">
<xsl:value-of select="." />
<xsl:value-of select="$coma" />
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Thanks in advance
John