From 10f004f3a698f27693462c0927703a3b0178b41f Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Mon, 22 Apr 2019 13:21:40 +0200
Subject: use <msDesc> inside <witness>

---
 ekdosis.dtx | 39 +++++++++++++++++++++++++++++++--------
 1 file changed, 31 insertions(+), 8 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index fdf582f..0840527 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -939,13 +939,23 @@ function ekdosis.openteistream()
    f:write('<?xml version="1.0" encoding="utf-8"?>', "\n")
    f:write("<TEI xmlns=\"http://www.tei-c.org/ns/1.0\">", "\n")
    f:write("<teiHeader>", "\n")
-   f:write("<encodingDesc>", "\n")
-   f:write('<variantEncoding method="parallel-segmentation" location="internal"/>', "\n")
-   f:write("</encodingDesc>", "\n")
+   f:write("<fileDesc>", "\n")
+   f:write("<titleStmt>", "\n")
+   f:write("<title><!-- Title --></title>", "\n")
+   f:write("<respStmt>", "\n")
+   f:write("<resp><!-- Edited by --></resp>", "\n")
+   f:write("<name><!-- Name --></name>", "\n")
+   f:write("</respStmt>", "\n")
+   f:write("</titleStmt>", "\n")
+   f:write("<publicationStmt>", "\n")
+   f:write("<distributor><!-- Distributor name  --></distributor>", "\n")
+   f:write("</publicationStmt>", "\n")
+   f:write("<sourceDesc>", "\n")
    f:write("<listWit>", "\n")
    for i = 1,#listWit do
-      f:write("<msDesc xml:id=\"", listWit[i].xmlid, "\">", "\n")
-      f:write("<abbr>", ekdosis.textotei(listWit[i].abbr), "</abbr>", "\n")
+      f:write('<witness xml:id=\"', listWit[i].xmlid, "\">", "\n")
+      f:write('<abbr type="siglum">', ekdosis.textotei(listWit[i].abbr), "</abbr>", "\n")
+      f:write("<msDesc>", "\n")
       if listWit[i].msIdentifier.settlement == ""
 	 and listWit[i].msIdentifier.repository == ""
 	 and listWit[i].msIdentifier.idno == ""
@@ -974,9 +984,16 @@ function ekdosis.openteistream()
 	 while listWit[i].handDesc[j]
 	 do
 	    f:write("<handDesc xml:id=\"", listWit[i].handDesc[j].xmlid, "\">", "\n")
-	    f:write("<abbr>", ekdosis.textotei(listWit[i].handDesc[j].abbr), "</abbr>", "\n")
-	    if listWit[i].handDesc[j].handNote == "" then else
-	       f:write("<handNote>\n<p>", ekdosis.textotei(listWit[i].handDesc[j].handNote), "</p>\n</handNote>", "\n")
+	    -- f:write('<p><abbr type="siglum">', ekdosis.textotei(listWit[i].handDesc[j].abbr), "</abbr></p>", "\n")
+	    if listWit[i].handDesc[j].handNote == ""
+	    then
+	       f:write('<handNote><abbr type="siglum">', ekdosis.textotei(listWit[i].handDesc[j].abbr), "</abbr></handNote>", "\n")
+	    else
+	       f:write("<handNote>", "\n")
+	       f:write('<abbr type="siglum">', ekdosis.textotei(listWit[i].handDesc[j].abbr), "</abbr>", "\n")
+	       f:write("<p>", ekdosis.textotei(listWit[i].handDesc[j].handNote), "</p>", "\n")
+	       f:write("</handNote>", "\n")
+	       -- f:write("<handNote>\n<p>", ekdosis.textotei(listWit[i].handDesc[j].handNote), "</p>\n</handNote>", "\n")
 	    end
 	    j = j + 1
 	    f:write("</handDesc>", "\n")
@@ -994,8 +1011,14 @@ function ekdosis.openteistream()
 	 f:write("<p>", ekdosis.textotei(listWit[i].detailsDesc), "</p>", "\n")
       end
       f:write("</msDesc>", "\n")
+      f:write("</witness>", "\n")
    end
    f:write("</listWit>", "\n")
+   f:write("</sourceDesc>", "\n")
+   f:write("</fileDesc>", "\n")
+   f:write("<encodingDesc>", "\n")
+   f:write('<variantEncoding method="parallel-segmentation" location="internal"/>', "\n")
+   f:write("</encodingDesc>", "\n")
    f:write("</teiHeader>", "\n")
    f:write("<text>", "\n")
    f:write("<body>", "\n")
-- 
cgit v1.2.3

