xref: /aosp_15_r20/external/apache-xml/test/tests/conf/variable/variable48.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3    version="1.0">
4
5<xsl:output method="xml" indent="no" encoding="UTF-8"/>
6
7  <!-- FileName: variable48 -->
8  <!-- Document: http://www.w3.org/TR/xslt -->
9  <!-- DocVersion: 19991116 -->
10  <!-- Section: 11.5 -->
11  <!-- Purpose: Check propagation of params down into templates -->
12  <!-- Author: Scott Boag -->
13
14<xsl:param name="request" select="'top'"/>
15
16<xsl:template match="/">
17  <xsl:apply-templates>
18    <xsl:with-param name="p1" select="$request"/>
19    <xsl:with-param name="p2" select="'root'"/>
20  </xsl:apply-templates>
21</xsl:template>
22
23<xsl:template match="*">
24  <xsl:param name="p1" select="'error1!'"/>
25  <xsl:param name="p2" select="'error2!'"/>
26
27  <xsl:copy>
28    <xsl:apply-templates select="node()|@*">
29      <xsl:with-param name="p1" select="$request"/>
30      <xsl:with-param name="p2" select="@id"/>
31    </xsl:apply-templates>
32    <from>
33      <xsl:call-template name="dump-values">
34        <xsl:with-param name="p1" select="$request"/>
35        <xsl:with-param name="p2" select="$p2"/>
36      </xsl:call-template>
37    </from>
38  </xsl:copy>
39</xsl:template>
40
41<xsl:template match="@*">
42  <xsl:param name="p1" select="'error3!'"/>
43  <xsl:param name="p2" select="'error4!'"/>
44
45  <xsl:attribute name="Value">
46    <xsl:call-template name="dump-values">
47      <xsl:with-param name="p1" select="$p1"/>
48      <xsl:with-param name="p2" select="concat('id=', string($p2))"/>
49    </xsl:call-template>
50  </xsl:attribute>
51</xsl:template>
52
53<xsl:template name="dump-values">
54  <xsl:param name="p1" select="'error5!'"/>
55  <xsl:param name="p2" select="'error6!'"/>
56
57  <xsl:value-of select="$p1"/>, <xsl:value-of select="$p2"/>
58</xsl:template>
59
60
61  <!--
62   * Licensed to the Apache Software Foundation (ASF) under one
63   * or more contributor license agreements. See the NOTICE file
64   * distributed with this work for additional information
65   * regarding copyright ownership. The ASF licenses this file
66   * to you under the Apache License, Version 2.0 (the  "License");
67   * you may not use this file except in compliance with the License.
68   * You may obtain a copy of the License at
69   *
70   *     http://www.apache.org/licenses/LICENSE-2.0
71   *
72   * Unless required by applicable law or agreed to in writing, software
73   * distributed under the License is distributed on an "AS IS" BASIS,
74   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75   * See the License for the specific language governing permissions and
76   * limitations under the License.
77  -->
78
79</xsl:stylesheet>
80