1<?xml version="1.0"?> 2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 3 4 <!-- FileName: namedtemplate09 --> 5 <!-- Document: http://www.w3.org/TR/xslt --> 6 <!-- DocVersion: 19991116 --> 7 <!-- Section: 6 Named Templates --> 8 <!-- Creator: David Marston --> 9 <!-- Purpose: Test of nested template calls. --> 10 11<xsl:template match="doc"> 12 <out> 13 <xsl:call-template name="tmplt1"> 14 <xsl:with-param name="par1" select="0"/> 15 </xsl:call-template> 16 </out> 17</xsl:template> 18 19<xsl:template name="tmplt1"> 20 <xsl:param name="par1">par1 default data</xsl:param> 21 <in1> 22 <xsl:value-of select="$par1"/> 23 <xsl:call-template name="tmplt2"> 24 <xsl:with-param name="par1" select="1"/> 25 </xsl:call-template> 26 </in1> 27</xsl:template> 28 29<xsl:template name="tmplt2"> 30 <xsl:param name="par1">par1 default in tmplt2</xsl:param> 31 <in2> 32 <xsl:value-of select="$par1"/> 33 <xsl:call-template name="tmplt3"> 34 <xsl:with-param name="par1" select="2"/> 35 </xsl:call-template> 36 </in2> 37</xsl:template> 38 39<xsl:template name="tmplt3"> 40 <xsl:param name="par1">par1 default in tmplt3</xsl:param> 41 <in3> 42 <xsl:value-of select="$par1"/> 43 <xsl:call-template name="tmplt4"> 44 <xsl:with-param name="par1" select="3"/> 45 </xsl:call-template> 46 </in3> 47</xsl:template> 48 49<xsl:template name="tmplt4"> 50 <xsl:param name="par1">par1 default in tmplt4</xsl:param> 51 <in4> 52 <xsl:value-of select="$par1"/> 53 <xsl:call-template name="tmplt5"> 54 <xsl:with-param name="par1" select="4"/> 55 </xsl:call-template> 56 </in4> 57</xsl:template> 58 59<xsl:template name="tmplt5"> 60 <xsl:param name="par1">par1 default in tmplt5</xsl:param> 61 <in5> 62 <xsl:value-of select="$par1"/> 63 <xsl:call-template name="tmplt6"> 64 <xsl:with-param name="par1" select="5"/> 65 </xsl:call-template> 66 </in5> 67</xsl:template> 68 69<xsl:template name="tmplt6"> 70 <xsl:param name="par1">par1 default in tmplt6</xsl:param> 71 <in6> 72 <xsl:value-of select="$par1"/><xsl:text> - all the way in</xsl:text> 73 </in6> 74</xsl:template> 75 76 77 <!-- 78 * Licensed to the Apache Software Foundation (ASF) under one 79 * or more contributor license agreements. See the NOTICE file 80 * distributed with this work for additional information 81 * regarding copyright ownership. The ASF licenses this file 82 * to you under the Apache License, Version 2.0 (the "License"); 83 * you may not use this file except in compliance with the License. 84 * You may obtain a copy of the License at 85 * 86 * http://www.apache.org/licenses/LICENSE-2.0 87 * 88 * Unless required by applicable law or agreed to in writing, software 89 * distributed under the License is distributed on an "AS IS" BASIS, 90 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 91 * See the License for the specific language governing permissions and 92 * limitations under the License. 93 --> 94 95</xsl:stylesheet> 96