-
Notifications
You must be signed in to change notification settings - Fork 5
/
filter.htr.data.xsl
37 lines (35 loc) · 1.34 KB
/
filter.htr.data.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
31
32
33
34
35
36
37
<?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"
xmlns="http://www.loc.gov/standards/alto/ns-v4#"
xmlns:a="http://www.loc.gov/standards/alto/ns-v4#"
exclude-result-prefixes="xs"
version="1.0">
<xsl:template match="node()|comment()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|node()|comment()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="a:TextLine">
<xsl:choose>
<xsl:when test="key('IDREF', @TAGREFS)/@LABEL = 'MusicLine'"/>
<xsl:when test="key('IDREF', @TAGREFS)/@LABEL = 'DropCapitalLine'"/>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()|comment()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="a:TextBlock">
<xsl:choose>
<xsl:when test="key('IDREF', @TAGREFS)/@LABEL = 'MusicLine'"/>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()|comment()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:key name="IDREF" match="a:OtherTag" use="@ID"/>
</xsl:stylesheet>