You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by cu...@apache.org on 2001/10/19 00:22:05 UTC
cvs commit: xml-xalan/test/tests/contrib/var var02.xsl var02.xml
curcuru 01/10/18 15:22:05
Added: test/tests/contrib/var var02.xsl var02.xml
Log:
Variation on a theme of Bugzilla#4218: apply-templates instead of call-template
Revision Changes Path
1.1 xml-xalan/test/tests/contrib/var/var02.xsl
Index: var02.xsl
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- var02.xsl: variations on a theme:Bugzilla#4218 related stylesheets-->
<xsl:template match="doc">
<out>
<!-- Variables declared at same level as call-template -->
<xsl:variable name="v1" select="'abc-should-appear-once'"/>
<xsl:variable name="v2" select="'def-should-appear-once'"/>
<xsl:call-template name="template1">
<!-- Param name is same in all cases -->
<xsl:with-param name="param1">
<!-- Theme change: apply-templates instead of call-template -->
<xsl:apply-templates select="list[@number='1']">
<xsl:with-param name="param1" select="$v1"/>
</xsl:apply-templates>
<xsl:value-of select="$v2"/>
</xsl:with-param>
</xsl:call-template>
</out>
</xsl:template>
<xsl:template name="template1">
<xsl:param name="param1" select="'error'"/>
<template1><xsl:value-of select="$param1"/></template1>
</xsl:template>
<xsl:template name="template2" match="list">
<xsl:param name="param1" select="'error'"/>
<template2><xsl:value-of select="$param1"/></template2>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/contrib/var/var02.xml
Index: var02.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<doc>
<list number="1">
<item number="1">one</item>
<item number="2">two</item>
<item number="3">three</item>
</list>
<list number="2">
<item number="a">aaa</item>
<item number="b">bbb</item>
</list>
</doc>
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org