xref: /aosp_15_r20/external/apache-xml/test/tests/conf/lre/lre05.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
3    xmlns:ped="http://tester.com">
4
5<xsl:import href="implre05.xsl"/>
6<xsl:include href="inclre05.xsl"/>
7
8  <!-- FileName: lre05 -->
9  <!-- Document: http://www.w3.org/TR/xslt -->
10  <!-- DocVersion: 19991116 -->
11  <!-- Section: 7.1.1 Literal Result Elements-->
12  <!-- Creator: Paul Dick -->
13  <!-- Purpose: Show that exclude-result-prefixes is scoped to just it's LRE. -->
14
15  <!-- The designation of a namespace as an excluded namespace is
16       effective within the subtree of the stylesheet rooted at the element
17       bearing the exclude-result-prefixes or xsl:exclude-result-prefixes attribute.
18       A subtree rooted at an xsl:stylesheet element does not include any
19       stylesheets imported or included by children of that xsl:stylesheet element. -->
20
21  <!-- The ped namespace is excluded from main and foo, but not from the sub-elements that
22    got placed in main by other templates. In fact, it has to be re-declared for each of
23    those sub-elements. -->
24
25<xsl:template match="docs">
26  <main xsl:exclude-result-prefixes="ped">
27     <foo/>
28     <xsl:apply-templates/>
29  </main>
30</xsl:template>
31
32<xsl:template match="doc1">
33  <sub-element-in-main />
34</xsl:template>
35
36
37  <!--
38   * Licensed to the Apache Software Foundation (ASF) under one
39   * or more contributor license agreements. See the NOTICE file
40   * distributed with this work for additional information
41   * regarding copyright ownership. The ASF licenses this file
42   * to you under the Apache License, Version 2.0 (the  "License");
43   * you may not use this file except in compliance with the License.
44   * You may obtain a copy of the License at
45   *
46   *     http://www.apache.org/licenses/LICENSE-2.0
47   *
48   * Unless required by applicable law or agreed to in writing, software
49   * distributed under the License is distributed on an "AS IS" BASIS,
50   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51   * See the License for the specific language governing permissions and
52   * limitations under the License.
53  -->
54
55</xsl:stylesheet>
56