-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
2,356 additions
and
2 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,274 @@ | ||
<?xml version="1.0"?> | ||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:tei="http://www.tei-c.org/ns/1.0" | ||
xmlns:cc="http://web.resource.org/cc/" | ||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
version="1.0" | ||
exclude-result-prefixes="tei cc rdf" | ||
> | ||
<!-- | ||
things missing: | ||
- EOAparthtml | ||
- numbering and ordering | ||
- footnotes have a sup above and are gathered below | ||
- | ||
--> | ||
|
||
<xsl:output method="xml" indent="yes" encoding="UTF-8"/> | ||
|
||
<xsl:template match="/"> | ||
<xsl:element name="EOAdocument"> | ||
<xsl:apply-templates select="//tei:div[@type='chapter']"/> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<!-- | ||
<div type="part" n="1" xml:id="part1"> | ||
<head>This is the first part</head> | ||
--> | ||
|
||
<xsl:template match="//tei:div[@type='part']/tei:head"> | ||
<xsl:element name="EOAparthtml"> | ||
<xsl:element name="head"> | ||
<xsl:value-of select="."/> | ||
</xsl:element> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="//tei:div[@type='chapter'][not(@rend='nonumber')]"> | ||
<xsl:element name="EOAchapter"> | ||
<xsl:attribute name="language"> | ||
<xsl:value-of select="//tei:langUsage/tei:language/@ident"/> | ||
</xsl:attribute> | ||
<xsl:attribute name="order"> | ||
<xsl:value-of select="position()"/> | ||
</xsl:attribute> | ||
<xsl:attribute name="number"> | ||
<xsl:value-of select="@n"/> | ||
</xsl:attribute> | ||
<xsl:apply-templates/> | ||
<xsl:element name="EOAsection"> | ||
<xsl:element name="head"> | ||
<xsl:text>Footnotes</xsl:text> | ||
</xsl:element> | ||
</xsl:element> | ||
<xsl:apply-templates select="//tei:note[@place='bottom']"/> | ||
<xsl:element name="EOAfootnote"> | ||
<xsl:attribute name="anchor"> | ||
<xsl:value-of select="tei:note/@n"/> | ||
</xsl:attribute> | ||
<xsl:value-of select="tei:note[@place='bottom']/tei:p"/> | ||
<!-- </xsl:template> --> | ||
</xsl:element> | ||
|
||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="//tei:div[@type='chapter'][@rend='nonumber']"> | ||
<xsl:element name="EOAchapter"> | ||
<xsl:attribute name="language"> | ||
<xsl:value-of select="//tei:langUsage/tei:language/@ident"/> | ||
</xsl:attribute> | ||
<xsl:attribute name="order"> | ||
<xsl:value-of select="@n"/> | ||
</xsl:attribute> | ||
<xsl:apply-templates/> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="//tei:div[@type='section'][not(@rend='nonumber')]/tei:head"> | ||
<xsl:element name="EOAsection"> | ||
<xsl:attribute name="number"> | ||
<xsl:value-of select="@n"/> | ||
</xsl:attribute> | ||
<xsl:attribute name="order"> | ||
<xsl:value-of select="@n"/> | ||
</xsl:attribute> | ||
<xsl:element name="head"> | ||
<xsl:value-of select="."/> | ||
</xsl:element> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="//tei:div[@type='section'][@rend='nonumber']/tei:head"> | ||
<xsl:element name="EOAsection"> | ||
<xsl:attribute name="order"> | ||
<xsl:value-of select="@n"/> | ||
</xsl:attribute> | ||
<xsl:element name="head"> | ||
<xsl:value-of select="."/> | ||
</xsl:element> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="//tei:div[@type='subsection'][not(@rend='nonumber')]/tei:head"> | ||
<xsl:element name="EOAsubsection"> | ||
<xsl:attribute name="order"> | ||
<xsl:value-of select="@n"/> | ||
</xsl:attribute> | ||
<xsl:attribute name="number"> | ||
<xsl:value-of select="@n"/> | ||
</xsl:attribute> | ||
<xsl:element name="head"> | ||
<xsl:value-of select="."/> | ||
</xsl:element> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="//tei:div[@type='subsection'][@rend='nonumber']/tei:head"> | ||
<xsl:element name="EOAsubsection"> | ||
<xsl:attribute name="order"> | ||
<xsl:value-of select="@n"/> | ||
</xsl:attribute> | ||
<xsl:element name="head"> | ||
<xsl:value-of select="."/> | ||
</xsl:element> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="//tei:div[@type='subsubsection']/tei:head"> | ||
<xsl:element name="EOAsubsubsection"> | ||
<xsl:attribute name="order"> | ||
<xsl:value-of select="@n"/> | ||
</xsl:attribute> | ||
<xsl:element name="head"> | ||
<xsl:value-of select="."/> | ||
</xsl:element> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="//tei:div[@type='chapter']/tei:head"> | ||
<xsl:element name="head"> | ||
<xsl:value-of select="."/> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="tei:p"> | ||
<xsl:element name="EOAparagraph"> | ||
<xsl:attribute name="order"> | ||
<xsl:value-of select="position()"/> | ||
</xsl:attribute> | ||
<!-- <xsl:value-of select="."/> --> | ||
<xsl:apply-templates/> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="tei:p[@rend='Quote']"> | ||
<xsl:element name="EOAparagraph"> | ||
<xsl:attribute name="order"> | ||
<xsl:value-of select="position()"/> | ||
</xsl:attribute> | ||
<xsl:attribute name="rend"> | ||
<xsl:text>quoted</xsl:text> | ||
</xsl:attribute> | ||
<!-- <xsl:value-of select="."/> --> | ||
<xsl:apply-templates/> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<!-- | ||
<span rel="popover" class="citation" data-toggle="popover" html="true" data-placement="bottom" data-title="Descartes 1644, 37–44" data-content="Principia philosophiae.">Descartes 1644, 37–44</span> | ||
--> | ||
|
||
<xsl:template match="tei:bibl/tei:abbr[@type='authoryear']"> | ||
<xsl:element name="span"> | ||
<xsl:attribute name="rel"> | ||
<xsl:text>popover</xsl:text> | ||
</xsl:attribute> | ||
<xsl:attribute name="class"> | ||
<xsl:text>citation</xsl:text> | ||
</xsl:attribute> | ||
<xsl:attribute name="data-toggle"> | ||
<xsl:text>popover</xsl:text> | ||
</xsl:attribute> | ||
<xsl:attribute name="html"> | ||
<xsl:text>true</xsl:text> | ||
</xsl:attribute> | ||
<xsl:attribute name="citekey"> | ||
<xsl:value-of select="substring-after(../tei:ref/@target, '#')"/> | ||
</xsl:attribute> | ||
<xsl:attribute name="data-placement"> | ||
<xsl:text>bottom</xsl:text> | ||
</xsl:attribute> | ||
<xsl:attribute name="data-title"> | ||
<xsl:value-of select="."/> | ||
</xsl:attribute> | ||
<xsl:attribute name="data-content"> | ||
<xsl:value-of select="../tei:abbr[@type='title']"/> | ||
<!-- <xsl:text>Here goes the title of the publication</xsl:text> --> | ||
</xsl:attribute> | ||
<xsl:apply-templates/> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="tei:figure"> | ||
<xsl:element name="EOAfigure"> | ||
<xsl:attribute name="file"> | ||
<xsl:value-of select="tei:graphic/@url"/> | ||
</xsl:attribute> | ||
<!-- <xsl:apply-templates/> --> | ||
<xsl:element name="caption"> | ||
<xsl:value-of select="tei:head/text()"/> | ||
</xsl:element> | ||
</xsl:element> | ||
</xsl:template> | ||
<!-- <EOAfigure file="images1.jpg" width="66px;" order="8" number="4.1"><caption>An image with a caption. It resembles a bird looking at you. Doesn't it? And do you think it looks angry?</caption></EOAfigure> --> | ||
|
||
<xsl:template match="tei:note[@place='bottom']/tei:p"> | ||
<xsl:element name="sup"> | ||
<xsl:attribute name="class"> | ||
<xsl:text>footnote</xsl:text> | ||
</xsl:attribute> | ||
<xsl:element name="a"> | ||
<xsl:attribute name="href"> | ||
<xsl:value-of select="concat('#fn', ../@n)"/> | ||
</xsl:attribute> | ||
<xsl:value-of select="../@n"/> | ||
</xsl:element> | ||
</xsl:element> | ||
</xsl:template> | ||
<!-- <sup class="footnote"><a href="#fn1">1</a></sup> --> | ||
|
||
<!-- | ||
<xsl:template match="tei:note[@place='bottom']/tei:p"> | ||
<xsl:element name="EOAfootnote"> | ||
<xsl:attribute name="anchor"> | ||
<xsl:value-of select="../@n"/> | ||
</xsl:attribute> | ||
<xsl:apply-templates/> | ||
</xsl:element> | ||
</xsl:template> | ||
--> | ||
|
||
<xsl:template match="tei:hi[@rend='italic']"> | ||
<xsl:element name="em"> | ||
<xsl:apply-templates/> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="tei:hi[@rend='sup']"> | ||
<xsl:element name="sup"> | ||
<xsl:apply-templates/> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
<xsl:template match="tei:hi[@rend='sub']"> | ||
<xsl:element name="sub"> | ||
<xsl:apply-templates/> | ||
</xsl:element> | ||
</xsl:template> | ||
<!-- | ||
<xsl:template match="tei:hi[@rend='math']"> | ||
<xsl:element name="em"> | ||
<xsl:apply-templates/> | ||
</xsl:element> | ||
</xsl:template> | ||
--> | ||
<xsl:template match="tei:hi[@rend='bold']"> | ||
<xsl:element name="b"> | ||
<xsl:apply-templates/> | ||
</xsl:element> | ||
</xsl:template> | ||
|
||
|
||
</xsl:stylesheet> |
Oops, something went wrong.