Reteriving name/text for the passing value
Hi Martin Honnen,
Thanks for your reply.
I am posting the dummy code for you to analyze it why it is not working in chrome. We did test the same in other browsers like safari, FF but it is not working in those browsers too.
A.xsl
<xsl:variable name="varLvl">
<xsl:call-template name="getval">
<xsl:with-param name="lookup">level</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="trans">
<xsl:with-param name="lookup" select="$varLvl"/>
<xsl:with-param name="mode">1</xsl:with-param>
<xsl:with-param name="value" select="level"/>
</xsl:call-template>
This is the first xsl which is being transfomred, the "getlookup" and "trans" templates are in the below (b.xsl) file :
b.xsl
<xsl:template name="getval">
<xsl:param name="lookup"/>
<xsl:copy-of select="/Message"/>
</xsl:template>
<xsl:template name="translate">
<xsl:param name="lookup"/>
<xsl:param name="mode"/>
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$mode=0">
<xsl:if test="string-length($blank)!=0">
<option value=""></option>
</xsl:if>
<xsl:copy-of select="$lookup/message/lookup"/>
</xsl:when>
<xsl:when test="$mode=1">
<xsl:value-of select="$lookup/message/lookup/option[@value=$value]"/>
</xsl:when>
</xsl:choose>
</xsl:template>
Source XML:
XML :
<message>
<lookup>
<option value="1">abc</option>
<option value="2">abc1</option>
<option value="3">abc2</option>
</lookup>
</message>
Hope this will enable you to investigate further.
|