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