Skip to content
Permalink
93de43745e
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
51 lines (41 sloc) 1.25 KB
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:n="local"
>
<xsl:output
method="xml"
version="1.0"
indent="yes"
encoding='utf-8'
/>
<xsl:param name="debug">false</xsl:param>
<n:blacklist>
<n:entry>exemplum</n:entry>
<n:entry>desc</n:entry>
<n:entry>remarks</n:entry>
<n:entry>listRef</n:entry>
<n:entry>gloss</n:entry>
<n:entry>head</n:entry>
</n:blacklist>
<xsl:strip-space elements="tei:*"/>
<!-- delete these: -->
<xsl:template match="tei:*[name() = document('')/*/n:blacklist/n:entry]">
<xsl:if test="$debug = 'true'">
<xsl:message> deleting <xsl:value-of select="name(.)"/></xsl:message>
</xsl:if>
</xsl:template>
<xsl:template match="comment()"/>
<!-- (a div, which contains only blacklisted elements) -->
<xsl:template match="tei:div[not(.//*[not(name() = document('')/*/n:blacklist/n:entry or name() = 'div')])]">
<xsl:if test="$debug = 'true'">
<xsl:message> deleting div (only BLABLA) <xsl:value-of select="@xml:id"/></xsl:message>
</xsl:if>
</xsl:template>
<!-- copy everything else: -->
<xsl:template match="@*|element()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>