xref: /aosp_15_r20/external/apache-xml/test/tests/api/xalanj1/ParamTest1.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
4  <!-- FileName: ParamTest1.xsl -->
5  <!-- Document: http://www.w3.org/TR/xslt -->
6  <!-- DocVersion: 19990922 -->
7  <!-- Section: 11.2 Values of Variables and Parameters  -->
8  <!-- Purpose: Verify xsl:param in stylesheet root, either set or not set via setStylesheetParam -->
9
10<xsl:param name="p1">
11    <B>ABC</B>
12</xsl:param>
13<xsl:param name="p2">
14    <B>DEF</B>
15</xsl:param>
16
17<xsl:param name="t1">notset</xsl:param>
18
19
20<xsl:param name="s1" select="'s1val'">
21</xsl:param>
22<xsl:param name="s2" select="'s2val'">
23</xsl:param>
24
25<xsl:template match="doc">
26  <xsl:param name="p3">
27    <B>GHI</B>
28  </xsl:param>
29  <xsl:param name="s3" select="'s3val'">
30  </xsl:param>
31   <outp>
32     <xsl:value-of select="$p1"/><xsl:text>,</xsl:text><xsl:copy-of select="$p1"/><xsl:text>; </xsl:text>
33     <xsl:value-of select="$p2"/><xsl:text>,</xsl:text><xsl:copy-of select="$p2"/><xsl:text>; </xsl:text>
34     <xsl:value-of select="$p3"/><xsl:text>,</xsl:text><xsl:copy-of select="$p3"/><xsl:text>; </xsl:text>
35   </outp>
36   <xsl:text>:
37   </xsl:text>
38   <outs>
39     <xsl:value-of select="$s1"/><xsl:text>,</xsl:text><xsl:copy-of select="$s1"/><xsl:text>; </xsl:text>
40     <xsl:value-of select="$s2"/><xsl:text>,</xsl:text><xsl:copy-of select="$s2"/><xsl:text>; </xsl:text>
41     <xsl:value-of select="$s3"/><xsl:text>,</xsl:text><xsl:copy-of select="$s3"/><xsl:text>; </xsl:text>
42   </outs>
43   <xsl:text>:
44   </xsl:text>
45   <outt>
46     <xsl:value-of select="$t1='notset'"/><xsl:text>,</xsl:text>
47     <xsl:value-of select="$t1=''"/><xsl:text>,</xsl:text>
48     <xsl:value-of select="$t1='a'"/><xsl:text>,</xsl:text>
49     <xsl:value-of select="$t1='1'"/><xsl:text>,</xsl:text>
50     <xsl:value-of select="$t1"/>
51   </outt>
52
53</xsl:template>
54
55
56  <!--
57   * Licensed to the Apache Software Foundation (ASF) under one
58   * or more contributor license agreements. See the NOTICE file
59   * distributed with this work for additional information
60   * regarding copyright ownership. The ASF licenses this file
61   * to you under the Apache License, Version 2.0 (the  "License");
62   * you may not use this file except in compliance with the License.
63   * You may obtain a copy of the License at
64   *
65   *     http://www.apache.org/licenses/LICENSE-2.0
66   *
67   * Unless required by applicable law or agreed to in writing, software
68   * distributed under the License is distributed on an "AS IS" BASIS,
69   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
70   * See the License for the specific language governing permissions and
71   * limitations under the License.
72  -->
73
74</xsl:stylesheet>
75