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