-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from dariok/parametrize
Parameters for various functions
- Loading branch information
Showing
17 changed files
with
4,839 additions
and
1,103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
/tests-wd/ | ||
/tests2/ | ||
AS/ | ||
page2tei-output/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?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:tei="http://www.tei-c.org/ns/1.0" | ||
xmlns:math="http://www.w3.org/2005/xpath-functions/math" | ||
xmlns="http://www.tei-c.org/ns/1.0" | ||
exclude-result-prefixes="#all" | ||
version="3.0"> | ||
|
||
<xsl:template match="*[tei:hi]" mode="combine-hi"> | ||
<xsl:copy> | ||
<xsl:sequence select="@*" /> | ||
<xsl:for-each-group select="node()" group-adjacent="@style or normalize-space() = ''"> | ||
<xsl:choose> | ||
<xsl:when test="current-group()[self::tei:hi]"> | ||
<xsl:variable name="firstHi" select="current-group()[self::tei:hi][1]" /> | ||
|
||
<xsl:sequence select="current-group() intersect $firstHi/preceding-sibling::node()" /> | ||
<hi> | ||
<xsl:sequence select="$firstHi/@style" /> | ||
<xsl:apply-templates | ||
select="$firstHi | current-group()[position() != last()] intersect $firstHi/following-sibling::node()" | ||
mode="do-combine-hi" /> | ||
<xsl:if test="count(current-group()) gt 1 and current-group()[last()] != ' ' and not(current-group()[last()] is $firstHi)"> | ||
<xsl:apply-templates select="current-group()[last()]" mode="do-combine-hi" /> | ||
</xsl:if> | ||
</hi> | ||
<xsl:if test="current-group()[last()] = ' '"> | ||
<xsl:text> </xsl:text> | ||
</xsl:if> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:apply-templates select="current-group()" mode="combine-hi"/> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:for-each-group> | ||
</xsl:copy> | ||
</xsl:template> | ||
|
||
<xsl:template match="tei:hi" mode="do-combine-hi"> | ||
<xsl:apply-templates mode="combine-hi"/> | ||
</xsl:template> | ||
|
||
<xsl:template match="@* | node()" mode="combine-hi do-combine-hi"> | ||
<xsl:copy> | ||
<xsl:apply-templates select="@* | node()" mode="#current"/> | ||
</xsl:copy> | ||
</xsl:template> | ||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.