xref: /aosp_15_r20/external/apache-xml/test/tests/conf/predicate/predicate38.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3<xsl:output method="xml" indent="yes"/>
4
5  <!-- FileName: predicate38 -->
6  <!-- Document: http://www.w3.org/TR/xpath -->
7  <!-- DocVersion: 19991116 -->
8  <!-- Section: 3.4 -->
9  <!-- Purpose: Stress test of nested and multiple predicates. The production rules
10       allow such nesting. -->
11  <!-- Author: Paul Dick -->
12
13<xsl:template match="doc">
14<out>
15  <predicate1>
16   <xsl:apply-templates select="foo[(bar[2])='this']"/>
17  </predicate1>
18  <predicate2>
19   <xsl:apply-templates select="foo[(bar[2][(baz[2])='goodbye'])]"/>
20  </predicate2>
21</out>
22</xsl:template>
23
24<xsl:template match="foo[(bar[2])='this']">
25 <xsl:text>1 is </xsl:text>	<xsl:for-each select="*">
26    	<xsl:value-of select="@attr"/><xsl:text>,</xsl:text>
27	</xsl:for-each>
28</xsl:template>
29
30<xsl:template match="foo[(bar[(baz[2])='goodbye'])]">
31 <xsl:text>3 is </xsl:text>	<xsl:for-each select="*">
32    	<xsl:value-of select="@attr"/><xsl:text>,</xsl:text>
33	</xsl:for-each>
34</xsl:template>
35
36<xsl:template match="foo[(bar[2][(baz[2])='goodbye'])]">
37 <xsl:text>2 is </xsl:text>	<xsl:for-each select="*">
38    	<xsl:value-of select="@attr"/><xsl:text>,</xsl:text>
39	</xsl:for-each>
40</xsl:template>
41
42
43  <!--
44   * Licensed to the Apache Software Foundation (ASF) under one
45   * or more contributor license agreements. See the NOTICE file
46   * distributed with this work for additional information
47   * regarding copyright ownership. The ASF licenses this file
48   * to you under the Apache License, Version 2.0 (the  "License");
49   * you may not use this file except in compliance with the License.
50   * You may obtain a copy of the License at
51   *
52   *     http://www.apache.org/licenses/LICENSE-2.0
53   *
54   * Unless required by applicable law or agreed to in writing, software
55   * distributed under the License is distributed on an "AS IS" BASIS,
56   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
57   * See the License for the specific language governing permissions and
58   * limitations under the License.
59  -->
60
61</xsl:stylesheet>
62