-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_corpus.xsl
32 lines (29 loc) · 1.31 KB
/
generate_corpus.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
<?xml version="1.0" encoding="UTF-8"?>
<!-- This script reads data from tei_table.xml to create text corpus, suitable for analysis and debugging. -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xpath-default-namespace="http://www.tei-c.org/ns/1.0" xmlns="http://www.tei-c.org/ns/1.0">
<xsl:output indent="yes"/>
<xsl:template match="/">
<xsl:variable name="full_path" select="cell/text()"/>
<xsl:variable name="file" select="document($full_path)"/>
<teiCorpus xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>My Project: A Text Corpus</title>
</titleStmt>
<publicationStmt>
<p>Publication Information</p>
</publicationStmt>
<sourceDesc>
<p>Information about the source</p>
</sourceDesc>
</fileDesc>
</teiHeader>
<xsl:for-each select="//cell[@role='full_path']">
<xsl:variable name="full_path" select="."/>
<xsl:copy-of select="document($full_path)/TEI"/>
</xsl:for-each>
</teiCorpus>
</xsl:template>
</xsl:stylesheet>