xref: /aosp_15_r20/external/apache-xml/test/tests/conf/axes/axes120.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:a="name-a"
4  				xmlns:b="name-b"
5  				xmlns:c="namc-c">
6
7  <!-- FileName: axes120 -->
8  <!-- Document: http://www.w3.org/TR/xpath -->
9  <!-- DocVersion: 19991116 -->
10  <!-- Section: 2.2 Axes-->
11  <!-- Creator: Paul Dick (Revision of axes118) -->
12  <!-- Purpose: Check that namespace nodes exist separately on each element. -->
13
14<xsl:template match="/">
15  <out>
16    <xsl:text>&#010;</xsl:text>
17    <xsl:apply-templates/>
18  </out>
19</xsl:template>
20
21<xsl:template match="a:root">
22  <xsl:for-each select="self::node()|child::*"><xsl:text>&#010;</xsl:text>
23    <xsl:element name="{name(.)}"/><xsl:text>&#010;</xsl:text>
24  	<xsl:for-each select="namespace::*">
25    	<xsl:sort select="name(.)"/><xsl:text>&#09;</xsl:text>
26    	<xsl:element name="{name(.)}"><xsl:value-of select="."/></xsl:element><xsl:text>,&#010;</xsl:text>
27  	</xsl:for-each>
28  </xsl:for-each>
29</xsl:template>
30
31<xsl:template match="text()"/><!-- To suppress empty lines -->
32
33
34  <!--
35   * Licensed to the Apache Software Foundation (ASF) under one
36   * or more contributor license agreements. See the NOTICE file
37   * distributed with this work for additional information
38   * regarding copyright ownership. The ASF licenses this file
39   * to you under the Apache License, Version 2.0 (the  "License");
40   * you may not use this file except in compliance with the License.
41   * You may obtain a copy of the License at
42   *
43   *     http://www.apache.org/licenses/LICENSE-2.0
44   *
45   * Unless required by applicable law or agreed to in writing, software
46   * distributed under the License is distributed on an "AS IS" BASIS,
47   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
48   * See the License for the specific language governing permissions and
49   * limitations under the License.
50  -->
51
52</xsl:stylesheet>
53