-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathStationXML-1.0to1.1.xslt
39 lines (31 loc) · 1.76 KB
/
StationXML-1.0to1.1.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fsx="http://www.fdsn.org/xml/station/1">
<!--
This XSLT 1.0 transform may be used to translate a StationXML version 1.0 document to version 1.1
Version: 2020-04-07
The document *must* declare the FDSN StationXML elements in a namespace of "http://www.fdsn.org/xml/station/1"
The following changes are applied by the transformation:
1) Change FDSNStationXML@schemaVersion from 1.0 to 1.1
2) Remove any .../Channel/StorageFormat elements, which are not allowed in 1.1
3) Remove any .../Channel/Response/Stage/StageGain elements when
.../Channel/Response/Stage/Polynomial elements are present,
which are not allowed in 1.1 as they are nearly always incompatible.
Note: This tranformation assumes the StageGain elements are in the document by
error (to stricly conform to 1.0) and the Polynomial is the intended filter.
-->
<!-- Identity template: copy all input to output and apply the included templates -->
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<!-- Change schemaVersion from 1.0 to 1.1 -->
<xsl:template match="/fsx:FDSNStationXML/@schemaVersion[. = '1.0']">
<xsl:attribute name="schemaVersion">1.1</xsl:attribute>
</xsl:template>
<!-- Remove StorageFormat -->
<xsl:template match="/fsx:FDSNStationXML/fsx:Network/fsx:Station/fsx:Channel/fsx:StorageFormat"/>
<!-- Remove StageGain element from Stage that contains Polynomial -->
<xsl:template match="/fsx:FDSNStationXML/fsx:Network/fsx:Station/fsx:Channel/fsx:Response/fsx:Stage[fsx:Polynomial]/fsx:StageGain"/>
</xsl:transform>