-
Notifications
You must be signed in to change notification settings - Fork 0
/
tei-stripper.xsl
30 lines (24 loc) · 1.16 KB
/
tei-stripper.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
30
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0" xmlns:eg="http://www.tei-c.org/ns/Examples">
<!-- remember to deselect xml:base fixup in XML Parser Preferences in oXygen-->
<!-- otherwise, included fragments will probably include xml:base, which we don't want-->
<!-- template to copy elements -->
<xsl:template match="*">
<xsl:element name="{local-name()}" namespace="http://www.tei-c.org/ns/Examples">
<xsl:apply-templates select="@* | node()"/>
</xsl:element>
</xsl:template>
<!-- template to copy attributes -->
<xsl:template match="@* except @xml:*">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="@xml:*">
<xsl:copy></xsl:copy>
</xsl:template>
<!-- template to copy the rest of the nodes -->
<xsl:template match="comment() | text() | processing-instruction()">
<xsl:copy/>
</xsl:template>
</xsl:stylesheet>