-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- basic TEI structure - use empty lines to create tei:div Cf. #29
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" | ||
xmlns:xstring = "https://github.com/dariok/XStringUtils" | ||
xmlns:wt="https://github.com/dariok/w2tei" | ||
xmlns="http://www.tei-c.org/ns/1.0" | ||
exclude-result-prefixes="#all" | ||
version="3.0"> | ||
|
||
<xsl:output indent="1" /> | ||
|
||
<xsl:include href="string-pack.xsl"/> | ||
<xsl:include href="word-pack.xsl"/> | ||
|
||
<xsl:variable name="titelei" select="string-join(//w:p[wt:is(., 'TBEE-Titel')])"/> | ||
<xsl:variable name="nr" select="normalize-space(xstring:substring-before(substring-after($titelei, 'ID'), ';'))" /> | ||
|
||
<xsl:template match="/"> | ||
<xsl:apply-templates select="//w:document" /> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:document"> | ||
<TEI> | ||
<teiHeader> | ||
<fileDesc> | ||
<sourceDesc> | ||
<p>Created from a MS Word file by <ref target="https://github.com/dariok/w2tei">W2TEI</ref>: | ||
<date when="{current-dateTime()}" type="created" /></p> | ||
</sourceDesc> | ||
</fileDesc> | ||
</teiHeader> | ||
<text> | ||
<body> | ||
<xsl:apply-templates select="//w:body"/> | ||
</body> | ||
</text> | ||
</TEI> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:body"> | ||
<xsl:for-each-group select="w:p" | ||
group-starting-with="w:p[not(descendant::w:t or descendant::w:sym)]"> | ||
<xsl:text> | ||
</xsl:text> | ||
<div> | ||
<xsl:apply-templates select="current-group()" /> | ||
</div> | ||
</xsl:for-each-group> | ||
</xsl:template> | ||
</xsl:stylesheet> |