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