1 <?xml version="1.0"?> 2 <!-- 3 Copyright (C) 2005, 2007 Paul Boddie <paul@boddie.org.uk> 4 5 This program is free software; you can redistribute it and/or modify it under 6 the terms of the GNU Lesser General Public License as published by the Free 7 Software Foundation; either version 3 of the License, or (at your option) any 8 later version. 9 10 This program is distributed in the hope that it will be useful, but WITHOUT 11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 13 details. 14 15 You should have received a copy of the GNU Lesser General Public License along 16 with this program. If not, see <http://www.gnu.org/licenses/>. 17 --> 18 <xsl:stylesheet version="1.0" 19 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 20 xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"> 21 22 <xsl:output indent="yes"/> 23 24 <xsl:param name="element-id"/> 25 26 27 28 <!-- Start at the top, finding only the specified element. --> 29 30 <xsl:template match="/"> 31 <xsl:apply-templates select="//*[@template:section=$element-id]"/> 32 </xsl:template> 33 34 35 36 <!-- Replicate unknown elements. --> 37 38 <xsl:template match="@*|node()"> 39 <xsl:copy> 40 <xsl:apply-templates select="@*|node()"/> 41 </xsl:copy> 42 </xsl:template> 43 44 </xsl:stylesheet>