xref: /aosp_15_r20/external/apache-xml/test/tests/contrib/var/var01c.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
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<!-- var01.xsl: variations on a theme:Bugzilla#4218; input .xml is ignored-->
6
7<!-- Theme: passing with-param, somehow variable stack frame gets messed up -->
8<xsl:template match="/">
9    <out>
10      <!-- Variables declared at same level as call-template -->
11      <xsl:variable name="v1" select="'abc-should-appear-once'"/>
12      <xsl:variable name="v2" select="'def-should-appear-once'"/>
13
14      <xsl:call-template name="template1">
15        <!-- Param name is same in all cases -->
16        <xsl:with-param name="param1">
17          <xsl:call-template name="template2">
18            <xsl:with-param name="param1" select="$v1"/>
19          </xsl:call-template>
20          <!-- Theme change: use xsl:text instead of value-of: PASSES 18-Oct-01 -->
21          <xsl:text>def-should-appear-once</xsl:text>
22        </xsl:with-param>
23      </xsl:call-template>
24    </out>
25  </xsl:template>
26
27  <xsl:template name="template1">
28    <xsl:param name="param1" select="'error'"/>
29    <template1><xsl:value-of select="$param1"/></template1>
30  </xsl:template>
31
32  <xsl:template name="template2">
33    <xsl:param name="param1" select="'error'"/>
34    <template2><xsl:value-of select="$param1"/></template2>
35  </xsl:template>
36
37  <!--
38   * Licensed to the Apache Software Foundation (ASF) under one
39   * or more contributor license agreements. See the NOTICE file
40   * distributed with this work for additional information
41   * regarding copyright ownership. The ASF licenses this file
42   * to you under the Apache License, Version 2.0 (the  "License");
43   * you may not use this file except in compliance with the License.
44   * You may obtain a copy of the License at
45   *
46   *     http://www.apache.org/licenses/LICENSE-2.0
47   *
48   * Unless required by applicable law or agreed to in writing, software
49   * distributed under the License is distributed on an "AS IS" BASIS,
50   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51   * See the License for the specific language governing permissions and
52   * limitations under the License.
53  -->
54
55</xsl:stylesheet>
56