Skip to content

Commit e7ec39b

Browse files
Emmanuelle-MorlockEmmanuelle-Morlock
Emmanuelle-Morlock
authored and
Emmanuelle-Morlock
committed
fix SF Bugs #183 default transformation for milestones
1 parent 0b3d8af commit e7ec39b

File tree

4 files changed

+137
-3
lines changed

4 files changed

+137
-3
lines changed

htm-teimilestone.xsl

+12-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,18 @@
6868
<xsl:text>|</xsl:text>
6969
</xsl:when>
7070
<xsl:otherwise>
71-
<br/>
72-
<xsl:value-of select="@rend"/>
71+
<!-- same as @unit='fragment' or @unit='block' -->
72+
<!-- adds pipe for block, flanked by spaces if not within word, and with @n as exposant if exists -->
73+
<xsl:if test="not(ancestor::t:w)">
74+
<xsl:text> </xsl:text>
75+
</xsl:if>
76+
<xsl:text>|</xsl:text>
77+
<xsl:if test="@n">
78+
<sup><xsl:value-of select="@n"/></sup>
79+
</xsl:if>
80+
<xsl:if test="not(ancestor::t:w)">
81+
<xsl:text> </xsl:text>
82+
</xsl:if>
7383
</xsl:otherwise>
7484
</xsl:choose>
7585
</xsl:template>

teimilestone.xsl

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
<!-- General template in [htm|txt]teimilestone.xsl -->
77

88
<xsl:template match="t:milestone[@unit='block' or @unit='fragment']">
9-
<!-- adds pipe for block, flanked by spaces if not within word -->
9+
<!-- adds pipe for block, flanked by spaces if not within word, and with @n as exposant if exists -->
1010
<xsl:if test="not(ancestor::t:w)">
1111
<xsl:text> </xsl:text>
1212
</xsl:if>
1313
<xsl:text>|</xsl:text>
14+
<xsl:if test="@n">
15+
<sup><xsl:value-of select="@n"/></sup>
16+
</xsl:if>
1417
<xsl:if test="not(ancestor::t:w)">
1518
<xsl:text> </xsl:text>
1619
</xsl:if>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<html>
3+
<head>
4+
<title>title of document</title>
5+
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
6+
<link rel="stylesheet" type="text/css" media="screen, projection" href="../xsl/global.css"
7+
/>
8+
</head>
9+
<body>
10+
<div id="edition" lang="en">
11+
<div class="textpart" lang="en">
12+
<span class="ab">
13+
<a id="al1"><!--0--></a>ex. 1 (GL): – abc |<sup>23</sup> def <br id="al2" />ex.
14+
2 (GL): – abc |<sup>24</sup> def <br id="al3" />ex. 3 (fragment) – abc | def <br
15+
id="al4" />ex. 4 (bloc) – abc | def <br id="al5" /><span class="linenumber"
16+
>5</span>ex. 5 (unnumbered) – abc | def <br id="al6" />ex. 6 (fragment with
17+
@n) – abc |<sup>2</sup> def <br id="al7" />ex. 7 (inword fragment) –
18+
abc|<sup>1</sup>def <br id="al8" />ex. 8 (inword block) –
19+
abc|<sup>1</sup>def </span>
20+
</div>
21+
</div>
22+
<div id="apparatus">
23+
<h4>Apparatus criticus</h4>
24+
<p>
25+
<p>external apparatus criticus (if applicable)</p>
26+
</div>
27+
<div id="translation">
28+
<h2> translation</h2>
29+
<p>translation(s)</p>
30+
</div>
31+
<div id="commentary">
32+
<h2>commentary</h2>
33+
<p>commentary</p>
34+
</div>
35+
<div id="bibliography">
36+
<h2>bibliography</h2>
37+
<p>bibliography of previous editions, discussion, etc.</p>
38+
</div>
39+
<div id="license"></div>
40+
</body>
41+
</html>

tests/data/source/ex-milestones.xml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?xml-model href="https://epidoc.stoa.org/schema/latest/tei-epidoc.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
3+
<?xml-model href="https://epidoc.stoa.org/schema/latest/tei-epidoc.rng" schematypens="http://purl.oclc.org/dsdl/schematron"?>
4+
<TEI xmlns="http://www.tei-c.org/ns/1.0" xml:space="preserve" xml:lang="en">
5+
<teiHeader>
6+
<fileDesc>
7+
<titleStmt>
8+
<title>title of document</title>
9+
</titleStmt>
10+
<publicationStmt>
11+
<authority></authority>
12+
<idno type="filename"></idno>
13+
</publicationStmt>
14+
<sourceDesc>
15+
<msDesc>
16+
<msIdentifier>
17+
<repository>museum/archive</repository>
18+
<idno>inventory number</idno>
19+
</msIdentifier>
20+
<physDesc>
21+
<objectDesc>
22+
<supportDesc>
23+
<support>description of object/monument (likely to include <material/>
24+
and <objectType/> information, <dimensions/>, etc.)</support>
25+
</supportDesc>
26+
<layoutDesc>
27+
<layout>description of text field/campus</layout>
28+
</layoutDesc>
29+
</objectDesc>
30+
<handDesc>
31+
<handNote>description of letters, possibly including <height>letter-heights</height>
32+
</handNote>
33+
</handDesc>
34+
</physDesc>
35+
<history>
36+
<origin>
37+
<origPlace>Place of origin</origPlace>
38+
<origDate>Date of origin</origDate>
39+
</origin>
40+
<provenance type="found"> Findspot and circumstances/context
41+
</provenance>
42+
<provenance type="observed">Modern location(s) (if different from repository, above)
43+
</provenance>
44+
</history>
45+
</msDesc>
46+
</sourceDesc>
47+
</fileDesc>
48+
</teiHeader>
49+
<!--<facsimile>
50+
<graphic url="photograph of text or monument"/>
51+
</facsimile>-->
52+
<text>
53+
<body>
54+
<div type="edition" xml:space="preserve">
55+
<ab>
56+
<lb n="1"/>ex. 1 (GL): – abc<milestone n="23" ed="La" unit="Dreissiger"/>def
57+
<lb n="2"/>ex. 2 (GL): – abc<milestone n="24" ed="AV" unit="verse"/>def
58+
<lb n="3"/>ex. 3 (fragment) – abc<milestone unit="fragment"/>def
59+
<lb n="4"/>ex. 4 (bloc) – abc<milestone unit="block"/>def
60+
<lb n="5"/>ex. 5 (unnumbered) – abc<milestone unit="unnumbered"/>def
61+
<lb n="6"/>ex. 6 (fragment with @n) – abc<milestone unit="fragment" n="2"/>def
62+
<lb n="7"/>ex. 7 (inword fragment) – <w>abc<milestone unit="fragment" n="1"/>def</w>
63+
<lb n="8"/>ex. 8 (inword block) – <w>abc<milestone unit="block" n="1"/>def</w>
64+
</ab>
65+
</div>
66+
<div type="apparatus">
67+
<p>external apparatus criticus (if applicable)</p>
68+
</div>
69+
<div type="translation">
70+
<p>translation(s)</p>
71+
</div>
72+
<div type="commentary">
73+
<p>commentary</p>
74+
</div>
75+
<div type="bibliography">
76+
<p>bibliography of previous editions, discussion, etc.</p>
77+
</div>
78+
</body>
79+
</text>
80+
</TEI>

0 commit comments

Comments
 (0)