To know what is the output of a XSLT function or variable we can simply use <xsl:message> to do a print statement in the xslt transfromation script.
Eg: In the following template when we do the substring operation we might need to know, what is the input we are getting in our template.
Eg: In the following template when we do the substring operation we might need to know, what is the input we are getting in our template.
<xsl:template name="FindPhoneNum">Output will be like;
<xsl:param name="DigitsLength" />
<xsl:param name="PhoneNum" />
<xsl:message>
PhoneNum---------:
<xsl:value-of select="$PhoneNum" />
DigitsLength---------:
<xsl:value-of select="$DigitsLength" />
</xsl:message>
<xsl:variable name="number">
<xsl:value-of select="substring($PhoneNum, $DigitsLength -6, $DigitsLength)" />
</xsl:variable>
<xsl:value-of select="$number" />
</xsl:template>
PhoneNum---------: 18168918984
DigitsLength---------: 11
No comments:
Post a Comment