1<?xml version="1.0" encoding="utf-8"?> 2<xsl:stylesheet 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 4 version="1.0"> 5<!-- var02.xsl: variations on a theme:Bugzilla#4218 related stylesheets--> 6 7<xsl:template match="doc"> 8 <out> 9 <!-- Variables declared at same level as call-template --> 10 <xsl:variable name="v1" select="'abc-should-appear-once'"/> 11 <xsl:variable name="v2" select="'def-should-appear-once'"/> 12 13 <xsl:call-template name="template1"> 14 <!-- Param name is same in all cases --> 15 <xsl:with-param name="param1"> 16 <!-- Theme change: apply-templates instead of call-template --> 17 <xsl:apply-templates mode="singleton"> 18 <xsl:with-param name="param1" select="$v1"/> 19 </xsl:apply-templates> 20 <xsl:value-of select="$v2"/> 21 </xsl:with-param> 22 </xsl:call-template> 23 </out> 24 </xsl:template> 25 26 <xsl:template name="template1"> 27 <xsl:param name="param1" select="'error'"/> 28 <template1><xsl:value-of select="$param1"/></template1> 29 </xsl:template> 30 31 <xsl:template name="template2" match="//singleton" mode="singleton"> 32 <xsl:param name="param1" select="'error'"/> 33 <template2><xsl:value-of select="$param1"/></template2> 34 </xsl:template> 35 <xsl:template match="text()" mode="singleton"/> 36 37 38 <!-- 39 * Licensed to the Apache Software Foundation (ASF) under one 40 * or more contributor license agreements. See the NOTICE file 41 * distributed with this work for additional information 42 * regarding copyright ownership. The ASF licenses this file 43 * to you under the Apache License, Version 2.0 (the "License"); 44 * you may not use this file except in compliance with the License. 45 * You may obtain a copy of the License at 46 * 47 * http://www.apache.org/licenses/LICENSE-2.0 48 * 49 * Unless required by applicable law or agreed to in writing, software 50 * distributed under the License is distributed on an "AS IS" BASIS, 51 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 52 * See the License for the specific language governing permissions and 53 * limitations under the License. 54 --> 55 56</xsl:stylesheet> 57