xref: /aosp_15_r20/external/apache-xml/test/tests/conf/modes/modes08.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: MODES08 -->
5  <!-- Document: http://www.w3.org/TR/xslt -->
6  <!-- DocVersion: 19991116 -->
7  <!-- Section: 5.7 Modes -->
8  <!-- Purpose: Test of several modes being available. -->
9
10<xsl:template match="doc">
11  <out><xsl:text>&#010;</xsl:text>
12    <xsl:apply-templates select="a" mode="a"/>
13    <xsl:apply-templates select="a" mode="b"/>
14    <xsl:apply-templates select="a" mode="c"/>
15    <xsl:apply-templates select="a" mode="d"/>
16    <xsl:apply-templates select="a" mode="e"/>
17    <xsl:apply-templates select="b" mode="a"/>
18    <xsl:apply-templates select="b" mode="b"/>
19  </out>
20</xsl:template>
21
22<xsl:template match="a" mode="a">
23  <xsl:text>modeA: </xsl:text><xsl:value-of select="."/>
24  <xsl:text>&#010;</xsl:text>
25</xsl:template>
26
27<xsl:template match="a" mode="b">
28  <xsl:text>modeB: </xsl:text><xsl:value-of select="."/>
29  <xsl:value-of select="@test"/>
30  <xsl:text>&#010;</xsl:text>
31</xsl:template>
32
33<xsl:template match="a" mode="c">
34  <xsl:text>modeC: </xsl:text><xsl:value-of select="."/>
35  <xsl:text>&#010;</xsl:text>
36</xsl:template>
37
38<xsl:template match="a" mode="d">
39  <xsl:text>modeD: </xsl:text><xsl:value-of select="."/>
40  <xsl:value-of select="@test"/>
41  <xsl:text>&#010;</xsl:text>
42</xsl:template>
43
44<xsl:template match="a" mode="e">
45  <xsl:text>modeE: </xsl:text><xsl:value-of select="."/>
46  <xsl:text>&#010;</xsl:text>
47</xsl:template>
48
49<xsl:template match="*" mode="a">
50  <xsl:text>modeA: </xsl:text><xsl:value-of select="."/>
51  <xsl:text>&#010;</xsl:text>
52</xsl:template>
53
54<xsl:template match="*" mode="b">
55  <xsl:text>modeB: </xsl:text><xsl:value-of select="."/>
56  <xsl:text>&#010;</xsl:text>
57</xsl:template>
58
59
60  <!--
61   * Licensed to the Apache Software Foundation (ASF) under one
62   * or more contributor license agreements. See the NOTICE file
63   * distributed with this work for additional information
64   * regarding copyright ownership. The ASF licenses this file
65   * to you under the Apache License, Version 2.0 (the  "License");
66   * you may not use this file except in compliance with the License.
67   * You may obtain a copy of the License at
68   *
69   *     http://www.apache.org/licenses/LICENSE-2.0
70   *
71   * Unless required by applicable law or agreed to in writing, software
72   * distributed under the License is distributed on an "AS IS" BASIS,
73   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74   * See the License for the specific language governing permissions and
75   * limitations under the License.
76  -->
77
78</xsl:stylesheet>
79