1<?xml version="1.0"?> 2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 3 4 <!-- FileName: namedtemplate03 --> 5 <!-- Document: http://www.w3.org/TR/xslt --> 6 <!-- DocVersion: 19991116 --> 7 <!-- Section: 6 --> 8 <!-- Creator: Paul Dick --> 9 <!-- Purpose: Test for recursion of xsl:call-template. --> 10 11<!-- <xsl:param name="pvar2" select="'stylesheet-var'"/> --> 12 13<xsl:template match="/doc"> 14 <out> 15 <xsl:variable name="ResultTreeFragTest" select="name(.)"/> 16 <xsl:call-template name="ntmp1"> 17 <xsl:with-param name="pvar1" select="$ResultTreeFragTest"/> 18 </xsl:call-template> 19 </out> 20</xsl:template> 21 22<xsl:template name="ntmp1"> 23 <xsl:param name="pvar1">def-text-1</xsl:param> 24 <xsl:param name="pvar2">def-text-2</xsl:param> 25 <xsl:value-of select="$pvar1"/><xsl:text>,</xsl:text> 26 <xsl:value-of select="$pvar2"/><xsl:text>,</xsl:text> 27 <xsl:apply-templates select="*"> 28 <xsl:with-param name="pvar1" select="$pvar1"/> 29 </xsl:apply-templates> 30</xsl:template> 31 32<xsl:template match="*"> 33 <xsl:param name="pvar1">def-text-1</xsl:param> 34 <xsl:call-template name="ntmp1"> 35 <xsl:with-param name="pvar1" select="$pvar1"/> 36 <xsl:with-param name="pvar2" select="name(.)"/> 37 </xsl:call-template> 38</xsl:template> 39 40 41 <!-- 42 * Licensed to the Apache Software Foundation (ASF) under one 43 * or more contributor license agreements. See the NOTICE file 44 * distributed with this work for additional information 45 * regarding copyright ownership. The ASF licenses this file 46 * to you under the Apache License, Version 2.0 (the "License"); 47 * you may not use this file except in compliance with the License. 48 * You may obtain a copy of the License at 49 * 50 * http://www.apache.org/licenses/LICENSE-2.0 51 * 52 * Unless required by applicable law or agreed to in writing, software 53 * distributed under the License is distributed on an "AS IS" BASIS, 54 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 55 * See the License for the specific language governing permissions and 56 * limitations under the License. 57 --> 58 59</xsl:stylesheet> 60