1 <?xml version=
"1.0" encoding=
"UTF-8"?> <!-- -*- nxml -*- -->
3 Copyright (C) 2005 Universitat d'Alacant / Universidad de Alicante
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 <xsl:stylesheet version=
"1.0" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
21 <xsl:output method=
"text" encoding=
"UTF-8"/>
22 <xsl:param name=
"alt"/>
24 <xsl:template match=
"/">
25 <xsl:value-of select=
"string('<?xml version="1.0" encoding="UTF-8"?>
')"/>
26 <xsl:apply-templates select=
"*|text()"/>
29 <xsl:template match=
"*">
30 <xsl:if test=
"not(count(./@alt)=1) or ./@alt=$alt">
31 <xsl:if test=
"not(local-name(.)=string('group'))">
32 <xsl:value-of select=
"string('<')"/>
33 <xsl:value-of select=
"local-name(.)"/>
34 <xsl:for-each select=
"./@*">
35 <xsl:if test=
"not(local-name(.)=string('alt'))">
36 <xsl:value-of select=
"string(' ')"/>
37 <xsl:value-of select=
"local-name(.)"/>
38 <xsl:value-of select=
"string('="')"/>
39 <xsl:value-of select=
"string(.)"/>
40 <xsl:value-of select=
"string('"')"/>
45 <xsl:when test=
"count(text()[normalize-space(.)] | *)=0">
46 <xsl:if test=
"not(local-name(.)=string('group'))">
47 <xsl:value-of select=
"string('/>')"/>
51 <xsl:if test=
"not(local-name(.)=string('group'))">
52 <xsl:value-of select=
"string('>')"/>
54 <xsl:apply-templates/>
55 <xsl:if test=
"not(local-name(.)=string('group'))">
56 <xsl:value-of select=
"string('</')"/>
57 <xsl:value-of select=
"local-name(.)"/>
58 <xsl:value-of select=
"string('>')"/>
65 <xsl:template match=
"text()">
66 <xsl:value-of select=
"."/>