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