forked from clarin-eric/ParlaMint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
list-element-attribute.xsl
39 lines (32 loc) · 1.16 KB
/
list-element-attribute.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
38
39
<?xml version="1.0" encoding="UTF-8"?>
<!-- -->
<xsl:stylesheet
xmlns="http://www.tei-c.org/ns/1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:et="http://nl.ijs.si/et"
xmlns:mk="http://ufal.mff.cuni.cz/matyas-kopp"
exclude-result-prefixes="tei et mk"
version="2.0">
<xsl:output encoding="utf-8" method="text"/>
<xsl:variable name="country" select="replace(replace(document-uri(/), '.+/([^/]+)\.xml', '$1'), 'ParlaMint-([^._]+).*', '$1')"/>
<xsl:template match="text()"/>
<xsl:template match="tei:*">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="@*">
<xsl:value-of select="mk:print_pair(./parent::tei:*/name(),name())"/>
</xsl:template>
<xsl:function name="mk:print_pair">
<xsl:param name="elem"/>
<xsl:param name="attr"/>
<xsl:message>
<xsl:value-of select="$country"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$elem"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$attr"/>
</xsl:message>
</xsl:function>
</xsl:stylesheet>