Skip to content

Commit

Permalink
Updated AT tei preprocessing to deal with glossary spread across mult…
Browse files Browse the repository at this point in the history
…iple files.
  • Loading branch information
geoffroy-noel-ddh committed Mar 15, 2024
1 parent b448820 commit 4a78033
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions responses/at-tei-to-tei.xsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<xsl:stylesheet version="1.0"
<xsl:stylesheet version="2.0"
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"
Expand All @@ -10,7 +10,7 @@
<xsl:variable name="places" select="document('places.xml')"/>
<xsl:key name="places" match="//tei:place" use="concat('place:', @xml:id)"/>

<xsl:variable name="glosses" select="document('glossary.xml')"/>
<xsl:variable name="glosses" select="document(tokenize('glossary.xml;glossary_book_one.xml;glossary_book_two.xml', ';'))"/>
<xsl:key name="glosses" match="//tei:item" use="concat('gloss:', @xml:id)"/>

<xsl:key name="notes" match="//tei:listAnnotation/tei:note" use="concat('#', @xml:id)"/>
Expand Down Expand Up @@ -102,7 +102,7 @@
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates />
<note type="entity"><xsl:apply-templates select="key('glosses', @ref, $glosses)/tei:gloss"/></note>
<note type="entity"><xsl:apply-templates select="$glosses/key('glosses', current()/@ref)/tei:gloss"/></note>
</xsl:copy>
</xsl:template>

Expand Down
4 changes: 3 additions & 1 deletion tests/settings-at.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"https://raw.githubusercontent.com/kingsdigitallab/alice-thornton/develop/frontend/assets/img/books/viewer/zoomify/images.xml",
"https://raw.githubusercontent.com/kingsdigitallab/alice-thornton/edition/entities/people.xml",
"https://raw.githubusercontent.com/kingsdigitallab/alice-thornton/edition/entities/places.xml",
"https://raw.githubusercontent.com/kingsdigitallab/alice-thornton/edition/entities/glossary.xml"
"https://raw.githubusercontent.com/kingsdigitallab/alice-thornton/edition/entities/glossary.xml",
"https://raw.githubusercontent.com/kingsdigitallab/alice-thornton/edition/entities/glossary_book_one.xml",
"https://raw.githubusercontent.com/kingsdigitallab/alice-thornton/edition/entities/glossary_book_two.xml"
]
}

0 comments on commit 4a78033

Please sign in to comment.