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