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> |