Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Added queries
Browse files Browse the repository at this point in the history
  • Loading branch information
HelenaSabel committed Dec 6, 2018
1 parent 1efc590 commit 3e1d3a5
Show file tree
Hide file tree
Showing 43 changed files with 23,285 additions and 0 deletions.
49 changes: 49 additions & 0 deletions XQuery/XSLT/dub.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs tei" version="2.0">
<xsl:output method="xml" encoding="utf-8" indent="no" omit-xml-declaration="yes"/>
<xsl:param name="rdg"/>
<xsl:template match="tei:app">
<xsl:apply-templates select="tei:rdg[. = $rdg][1]" mode="init"/>
</xsl:template>
<xsl:template match="tei:rdg" mode="init">
<xsl:apply-templates/>
<xsl:text>] </xsl:text>
<xsl:apply-templates
select="../tei:rdg[@wit ne current()/@wit][not(@cert)][1]" mode="second"/>
<xsl:if test="../count(tei:rdg[not(@cert)]) eq 2">
<xsl:text> // </xsl:text>
<xsl:apply-templates
select="../tei:rdg[@wit ne current()/@wit][not(@cert)][2]"
mode="second"/>
</xsl:if>
<xsl:if test="../count(tei:rdg) eq 1">
<xsl:text>--</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="tei:choice">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="tei:reg"/>
<xsl:template match="tei:ex"/>
<xsl:template match="tei:supplied"/>
<xsl:template match="tei:gap">
<xsl:text>--</xsl:text>
</xsl:template>
<xsl:template match="tei:del">
<xsl:value-of select="concat('(', ., ')')"/>
</xsl:template>
<xsl:template match="tei:add">
<xsl:value-of select="concat('\', ., '/')"/>
</xsl:template>
<xsl:template match="tei:rdg" mode="second">
<xsl:choose>
<xsl:when test="contains(@ana, '#error')">
<span class="ex">error</span>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
46 changes: 46 additions & 0 deletions XQuery/XSLT/ex.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs tei" version="2.0">
<xsl:output method="xml" encoding="utf-8" indent="no" omit-xml-declaration="yes"/>
<xsl:param name="rdg"/>
<xsl:param name="ana"/>
<xsl:template match="tei:app">
<xsl:apply-templates select="tei:rdg[. = $rdg]" mode="init"/>
</xsl:template>
<xsl:template match="tei:rdg" mode="init">
<xsl:apply-templates/>
<xsl:text>] </xsl:text>
<xsl:apply-templates select="../tei:rdg[@wit ne current()/@wit][not(tokenize(@ana, '\s+') = $ana)][1]" mode="second"/>
<xsl:if test="../count(tei:rdg[not(contains(@ana, $ana))]) eq 2">
<xsl:text> // </xsl:text>
<xsl:apply-templates select="../tei:rdg[@wit ne current()/@wit][not(tokenize(@ana, '\s+') = $ana)][2]" mode="second"/>
</xsl:if>
<xsl:if test="../count(tei:rdg) eq 1">
<xsl:text>--</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="tei:choice">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="tei:expan"/>
<xsl:template match="tei:reg"/>
<xsl:template match="tei:ex"/>
<xsl:template match="tei:supplied"/>
<xsl:template match="tei:gap">
<xsl:text>--</xsl:text>
</xsl:template>
<xsl:template match="tei:del">
<xsl:value-of select="concat('(', ., ')')"/>
</xsl:template>
<xsl:template match="tei:add">
<xsl:value-of select="concat('\', ., '/')"/>
</xsl:template>
<xsl:template match="tei:rdg" mode="second">
<xsl:choose>
<xsl:when test="contains(@ana, '#error')">
<span class="ex">error</span>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Loading

0 comments on commit 3e1d3a5

Please sign in to comment.