/[formed]/trunk/contrib/convert-choices.xsl
ViewVC logotype

Contents of /trunk/contrib/convert-choices.xsl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (show annotations)
Sat Aug 11 11:24:04 2007 UTC (17 years, 6 months ago) by teichmann
File MIME type: application/xml
File size: 894 byte(s)
Simplified convert-choices.xsl
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3 (c) 2007 by Intevation GmbH
4 Author: Sascha L. Teichmann
5 Converts <choice value="" options="xxx" other="..."/>
6 to <choice value="xxx" other="..."/>
7 -->
8 <xsl:stylesheet version="1.0"
9 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
10 <xsl:output method="xml" encoding="UTF-8"/>
11
12 <xsl:template match="choice">
13 <choice>
14 <!-- copy all attributes except 'value' and 'options' -->
15 <xsl:copy-of select="@*[local-name() != 'value' and local-name() != 'options']"/>
16 <!-- generate 'value' attribute with value of 'options' -->
17 <xsl:attribute name="value">
18 <xsl:value-of select="@options"/>
19 </xsl:attribute>
20 </choice>
21 </xsl:template>
22
23 <!-- copy thru all other stuff -->
24 <xsl:template match="@*|node()">
25 <xsl:copy>
26 <xsl:apply-templates select="@*|node()"/>
27 </xsl:copy>
28 </xsl:template>
29
30 </xsl:stylesheet>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26