xref: /aosp_15_r20/external/apache-xml/test/tests/capi/params/params07.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0"?>
2<?xml-stylesheet type="text/xsl" href="#style1-23.34.123456789_345"?>
3<!DOCTYPE doc [
4<!ELEMENT doc (#PCDATA | head | body)*>
5
6<!ELEMENT head (#PCDATA | xsl:stylesheet)*>
7<!ELEMENT body (#PCDATA|para)*>
8
9<!ELEMENT xsl:stylesheet (#PCDATA | xsl:key | xsl:template)*>
10<!ATTLIST xsl:stylesheet
11		  id ID #REQUIRED
12		  xmlns:xsl CDATA #FIXED "http://www.w3.org/1999/XSL/Transform"
13		  version NMTOKEN #REQUIRED>
14
15<!ELEMENT xsl:key EMPTY>
16<!ATTLIST xsl:key
17    name NMTOKENS #REQUIRED
18    match CDATA #REQUIRED
19    use CDATA #REQUIRED>
20
21<!ELEMENT xsl:template (#PCDATA | out)*>
22<!ATTLIST xsl:template  match CDATA #IMPLIED>
23
24<!ELEMENT out (#PCDATA | xsl:value-of | xsl:text)*>
25
26<!ELEMENT xsl:value-of EMPTY>
27<!ATTLIST xsl:value-of select CDATA #REQUIRED>
28
29<!ELEMENT xsl:text (#PCDATA)>
30
31<!ELEMENT para (#PCDATA)*>
32<!ATTLIST para id ID #REQUIRED>
33]>
34
35<doc>
36  <head>
37	<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
38                id="style1-23.34.123456789_345">
39
40	<!-- FileName: embed01 -->
41	<!-- Document: http://www.w3.org/TR/xslt -->
42	<!-- DocVersion: 19991116 -->
43	<!-- Section: 2.7 Embedding Stylesheets. -->
44	<!-- Purpose: General test of embedded stylesheet using fragment identifier -->
45
46	  <xsl:key name="test" match="para" use="@id"/>
47
48		<xsl:template match="/">
49  			<out>
50    			<xsl:value-of select="doc/body/para"/>
51				<xsl:value-of select="key('test','foey')"/><xsl:text>&#10;</xsl:text>
52  			</out>
53		</xsl:template>
54	</xsl:stylesheet>
55  </head>
56
57  <body>
58  	<para id="foo">
59Hello
60	</para>
61	<para id="foey">
62Goodbye
63	</para>
64  </body>
65
66  <!--
67   * Licensed to the Apache Software Foundation (ASF) under one
68   * or more contributor license agreements. See the NOTICE file
69   * distributed with this work for additional information
70   * regarding copyright ownership. The ASF licenses this file
71   * to you under the Apache License, Version 2.0 (the  "License");
72   * you may not use this file except in compliance with the License.
73   * You may obtain a copy of the License at
74   *
75   *     http://www.apache.org/licenses/LICENSE-2.0
76   *
77   * Unless required by applicable law or agreed to in writing, software
78   * distributed under the License is distributed on an "AS IS" BASIS,
79   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
80   * See the License for the specific language governing permissions and
81   * limitations under the License.
82  -->
83
84</doc>
85