xref: /aosp_15_r20/external/apache-xml/test/tests/conf/mdocs/mdocs06.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: MDocs06 -->
5  <!-- Document: http://www.w3.org/TR/xslt -->
6  <!-- DocVersion: 19991116 -->
7  <!-- Section: 12.1 Multiple Source Documents -->
8  <!-- Creator: David Marston -->
9  <!-- Purpose: Test document() function with two arguments: node-set, node-set. -->
10
11<xsl:template match="first"><!-- Document node of file passed to processor -->
12  <out>
13    <xsl:apply-templates/><!-- Should get defaultcontent element -->
14  </out>
15</xsl:template>
16
17<xsl:template match="defaultcontent"><!-- contains places and second -->
18  <!-- Two 'places' elements contain names of the other two files as text. -->
19  <xsl:apply-templates select="document(places,second)/*">
20    <xsl:with-param name="arg1" select="'top'" />
21  </xsl:apply-templates>
22</xsl:template>
23
24<xsl:template match="doc"><!-- Document node of file A -->
25  <xsl:param name="arg1">doc-start</xsl:param>
26  <xsl:value-of select="$arg1"/>
27  <xsl:text>, Done with doc
28</xsl:text>
29</xsl:template>
30
31<xsl:template match="outer"><!-- Document node of file B -->
32  <xsl:param name="arg1">outer-start</xsl:param>
33  <xsl:value-of select="$arg1"/>
34  <xsl:text>, Done with outer</xsl:text>
35</xsl:template>
36
37<xsl:template match="body"><!-- Other two files have body elements, but no apply goes here -->
38  <xsl:param name="arg1">problem</xsl:param>
39  <xsl:value-of select="$arg1"/>
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