[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] problem accessing parameters in templates without an <
In Xalan 1.2, i could pass a parameter from one template to another and then call a 3rd template with <xsl:with-param> without having another <xsl:param> in the 2nd template. it used to work in Xalan 1.2. but in Xalan 2.0, i have to first define an <xsl:param> and then pass it down. Is this a feature or a bug ? I know the XSLT spec says, parameters are ignored when there is no explcit <xsl:param> in a template. but i liked the default feature in previous version of Xalan. eg this works in Xalan 1.2.2 but not in Xalan 2.0 <xsl:template name="company" mode="process"> <xsl:param name="testVar" select="1"/> <xsl:apply-templates select="person" mode="process"> <xsl:with-param name="testVar" select="$testVar"/> </xsl:apply-templates> </xsl:template> <xsl:template name="person" mode="process"> <xsl:apply-templates select="address" mode="process"> <xsl:with-param name="testVar" select="$testVar"/> </xsl:apply-templates> </xsl:template> <xsl:template name="address" mode="process"> <xsl:value-of select="$testVar"/> </xsl:template> to make the above code work in Xalan 2.0 I had to do this <xsl:template name="person" mode="process"> <xsl:param name="testVar" select="$testVar"/> <xsl:apply-templates select="address" mode="process"> <xsl:with-param name="testVar" select="$testVar"/> </xsl:apply-templates> </xsl:template> <xsl:template name="address" mode="process"> <xsl:param name="testVar" select="$testVar"/> <xsl:value-of select="$testVar"/> </xsl:template> -Vasu XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|