1<?xml version="1.0"?> 2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 3 4 <!-- FileName: mdocs14 --> 5 <!-- Document: http://www.w3.org/TR/xslt --> 6 <!-- DocVersion: 19991116 --> 7 <!-- Section: 12.1 Multiple Source Documents --> 8 <!-- Author: Jeni Tennison --> 9 <!-- Purpose: Use document() to perform an include-like operation between two files. 10 At the conformance level, this shows that we can put the node-set from document() 11 into a variable, then reference where a node-set is required. --> 12 13<xsl:output method="xml"/> 14<xsl:variable name="xml-source" select="/" /> 15<xsl:variable name="html-template" select="document('x14template.html')" /> 16 17<xsl:template match="/"> 18 <xsl:apply-templates select="$html-template" mode="copy" /> 19</xsl:template> 20 21<xsl:template match="*" mode="copy"> 22 <xsl:copy> 23 <xsl:copy-of select="@*" /> 24 <xsl:apply-templates mode="copy" /> 25 </xsl:copy> 26</xsl:template> 27 28<xsl:template match="xml-content" mode="copy"> 29 <xsl:text>XML</xsl:text><xsl:apply-templates select="$xml-source" mode="copy"/> 30</xsl:template> 31 32 33 <!-- 34 * Licensed to the Apache Software Foundation (ASF) under one 35 * or more contributor license agreements. See the NOTICE file 36 * distributed with this work for additional information 37 * regarding copyright ownership. The ASF licenses this file 38 * to you under the Apache License, Version 2.0 (the "License"); 39 * you may not use this file except in compliance with the License. 40 * You may obtain a copy of the License at 41 * 42 * http://www.apache.org/licenses/LICENSE-2.0 43 * 44 * Unless required by applicable law or agreed to in writing, software 45 * distributed under the License is distributed on an "AS IS" BASIS, 46 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 47 * See the License for the specific language governing permissions and 48 * limitations under the License. 49 --> 50 51</xsl:stylesheet> 52