-
Notifications
You must be signed in to change notification settings - Fork 4
/
page-set-nsversion-2019.xsl
29 lines (26 loc) · 1.29 KB
/
page-set-nsversion-2019.xsl
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
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*[namespace-uri()=/*/namespace::*]">
<xsl:if test="not(starts-with(namespace-uri(),'http://schema.primaresearch.org/PAGE/gts/pagecontent/'))">
<xsl:message terminate="yes">
<xsl:text>input document is not of type http://schema.primaresearch.org/PAGE/gts/pagecontent, but </xsl:text>
<xsl:value-of select="namespace-uri()"/>
</xsl:message>
</xsl:if>
<xsl:element name="{local-name()}" namespace="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="//@xsi:schemaLocation">
<xsl:attribute name="xsi:schemaLocation" namespace="http://www.w3.org/2001/XMLSchema-instance">
<xsl:text>http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15 http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15/pagecontent.xsd</xsl:text>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>