xref: /aosp_15_r20/external/apache-xml/test/tests/extensions/library/libraryDistinct01.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:xalan="http://xml.apache.org/xalan"
4    exclude-result-prefixes="xalan">
5<!-- Indent just for readability -->
6<xsl:output indent="yes"/>
7
8  <!-- FileName: libraryDistinct01.xsl -->
9  <!-- Creator: Shane Curcuru -->
10  <!-- Purpose: Basic test of distinct(ns, ns) extension function -->
11
12<xsl:template match="doc">
13  <out>
14    <test desc="selects abc">
15      <xsl:copy-of select="xalan:distinct(list[@name='abc']/item)"/>
16      <xsl:text>, </xsl:text>
17      <xsl:value-of select="xalan:distinct(list[@name='abc']/item)"/>
18    </test>
19    <test desc="selects a from aaa">
20      <xsl:copy-of select="xalan:distinct(list[@name='aaa']/item)"/>
21    </test>
22    <test desc="selects xyz">
23      <xsl:copy-of select="xalan:distinct(list[@name='xyz']/item)"/>
24    </test>
25    <test desc="selects ab from aab">
26      <xsl:copy-of select="xalan:distinct(list[@name='aab']/item)"/>
27    </test>
28    <test desc="selects abc from abc|abc2">
29      <xsl:copy-of select="xalan:distinct(list[@name='abc']/item | list[@name='abc2']/item)"/>
30    </test>
31    <test desc="selects abcxyz from abc|aab|xyz">
32      <xsl:copy-of select="xalan:distinct(list[@name='abc']/item | list[@name='aab']/item | list[@name='xyz']/item)"/>
33    </test>
34  </out>
35</xsl:template>
36
37
38  <!--
39   * Licensed to the Apache Software Foundation (ASF) under one
40   * or more contributor license agreements. See the NOTICE file
41   * distributed with this work for additional information
42   * regarding copyright ownership. The ASF licenses this file
43   * to you under the Apache License, Version 2.0 (the  "License");
44   * you may not use this file except in compliance with the License.
45   * You may obtain a copy of the License at
46   *
47   *     http://www.apache.org/licenses/LICENSE-2.0
48   *
49   * Unless required by applicable law or agreed to in writing, software
50   * distributed under the License is distributed on an "AS IS" BASIS,
51   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
52   * See the License for the specific language governing permissions and
53   * limitations under the License.
54  -->
55
56</xsl:stylesheet>
57