comparison etl/doc/repair.xsl @ 5838:5aa05a7a34b7

Rename modules to more fitting names.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 15:23:37 +0200
parents flys-aft/doc/repair.xsl@44dc38ca8492
children
comparison
equal deleted inserted replaced
5837:d9901a08d0a6 5838:5aa05a7a34b7
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
4 <xsl:output method="xml"/>
5
6 <xsl:key name="gauge-name" match="/STATIONEN/STATION" use="@NAME"/>
7
8 <xsl:template name="lookup-gauge-number">
9 <xsl:param name="name"/>
10 <xsl:param name="number"/>
11 <xsl:variable name="fixed-number">
12 <xsl:for-each select="document('pegelstationen.xml')">
13 <xsl:value-of select="key('gauge-name', $name)/@NUMMER"/>
14 </xsl:for-each>
15 </xsl:variable>
16 <xsl:choose>
17 <xsl:when test="$fixed-number != ''">
18 <xsl:value-of select="$fixed-number"/>
19 </xsl:when>
20 <xsl:otherwise>
21 <xsl:value-of select="$number"/>
22 </xsl:otherwise>
23 </xsl:choose>
24 </xsl:template>
25
26 <xsl:template match="/DIPSFLYS/STATIONEN/PEGELSTATION">
27 <PEGELSTATION>
28 <xsl:attribute name="NUMMER">
29 <xsl:call-template name="lookup-gauge-number">
30 <xsl:with-param name="name" select="@NAME"/>
31 <xsl:with-param name="number" select="@NUMMER"/>
32 </xsl:call-template>
33 </xsl:attribute>
34 <xsl:apply-templates select="@*[local-name() != 'NUMMER']"/>
35 <xsl:apply-templates select="node()"/>
36 </PEGELSTATION>
37 </xsl:template>
38
39 <xsl:template match="@*|node()">
40 <xsl:copy>
41 <xsl:apply-templates select="@*|node()"/>
42 </xsl:copy>
43 </xsl:template>
44
45 </xsl:stylesheet>

http://dive4elements.wald.intevation.org