Mega Code Archive

 
Categories / XML / XSLT StyleSheet
 

Change these global parameter values

File: Data.xml <x>    <input>7</input>    <input>27</input> </x> File: Transform.xslt <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"   version="1.0">   <xsl:output method="text" indent="yes" version="1.0" />   <xsl:param name="parInput_1" select="x/input[1]" />   <xsl:param name="parInput_2" select="x/input[2]" />   <xsl:template match="x">     <xsl:param name="total">       <xsl:call-template name="y">         <xsl:with-param name="z" select="$parInput_2" />       </xsl:call-template>     </xsl:param>     <xsl:value-of select="$total - $parInput_1" />   </xsl:template>   <xsl:template name="y">     <xsl:param name="z" select="$parInput_2" />     <xsl:value-of select="$z" />   </xsl:template> </xsl:stylesheet> Output: 20