aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2020-10-14 18:54:25 +0200
committerRobert Alessi <alessi@robertalessi.net>2020-10-14 18:54:25 +0200
commit9de32ed90cefe239de0e878c5acb8cbc96b3eda5 (patch)
tree057820d52d4e3a741743a25dbdba2bb07dc02b2b
parent85c24f3b6b937e91527e53dd911b9e6279552e09 (diff)
downloadekdosis-9de32ed90cefe239de0e878c5acb8cbc96b3eda5.tar.gz
insert a dummy statement in <sourceDesc> if no source has been declared
-rw-r--r--ekdosis.dtx172
1 files changed, 90 insertions, 82 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index e9247a1..f8c2dc8 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -8943,104 +8943,112 @@ function ekdosis.openteistream()
8943 f:write("<distributor><!-- Distributor name --></distributor>", "\n") 8943 f:write("<distributor><!-- Distributor name --></distributor>", "\n")
8944 f:write("</publicationStmt>", "\n") 8944 f:write("</publicationStmt>", "\n")
8945 f:write("<sourceDesc>", "\n") 8945 f:write("<sourceDesc>", "\n")
8946 f:write("<listWit>", "\n") 8946 if next(listWit) == nil and next(listPerson) == nil
8947 for i = 1,#listWit do 8947 then
8948 f:write('<witness xml:id=\"', listWit[i].xmlid, "\">", "\n") 8948 f:write("<p>No source, born digital</p>", "\n")
8949 f:write('<abbr type="siglum">', textotei(listWit[i].abbr), "</abbr>", "\n") 8949 else
8950 f:write(textotei(listWit[i].detailsDesc), "\n") 8950 if next(listWit) ~= nil
8951 f:write("<msDesc>", "\n")
8952 if listWit[i].msIdentifier.settlement == ""
8953 and listWit[i].msIdentifier.institution == ""
8954 and listWit[i].msIdentifier.repository == ""
8955 and listWit[i].msIdentifier.collection == ""
8956 and listWit[i].msIdentifier.idno == ""
8957 and listWit[i].msIdentifier.msName == ""
8958 then 8951 then
8959 f:write("<msIdentifier/>", "\n") 8952 f:write("<listWit>", "\n")
8960 else 8953 for i = 1,#listWit do
8961 f:write("<msIdentifier>", "\n") 8954 f:write('<witness xml:id=\"', listWit[i].xmlid, "\">", "\n")
8962 if listWit[i].msIdentifier.settlement ~= "" then 8955 f:write('<abbr type="siglum">', textotei(listWit[i].abbr), "</abbr>", "\n")
8963 f:write("<settlement>", textotei(listWit[i].msIdentifier.settlement), "</settlement>", "\n") 8956 f:write(textotei(listWit[i].detailsDesc), "\n")
8957 f:write("<msDesc>", "\n")
8958 if listWit[i].msIdentifier.settlement == ""
8959 and listWit[i].msIdentifier.institution == ""
8960 and listWit[i].msIdentifier.repository == ""
8961 and listWit[i].msIdentifier.collection == ""
8962 and listWit[i].msIdentifier.idno == ""
8963 and listWit[i].msIdentifier.msName == ""
8964 then
8965 f:write("<msIdentifier/>", "\n")
8966 else
8967 f:write("<msIdentifier>", "\n")
8968 if listWit[i].msIdentifier.settlement ~= "" then
8969 f:write("<settlement>", textotei(listWit[i].msIdentifier.settlement), "</settlement>", "\n")
8964 else end 8970 else end
8965 if listWit[i].msIdentifier.institution ~= "" then 8971 if listWit[i].msIdentifier.institution ~= "" then
8966 f:write("<institution>", textotei(listWit[i].msIdentifier.institution), "</institution>", "\n") 8972 f:write("<institution>", textotei(listWit[i].msIdentifier.institution), "</institution>", "\n")
8967 else end 8973 else end
8968 if listWit[i].msIdentifier.repository ~= "" then 8974 if listWit[i].msIdentifier.repository ~= "" then
8969 f:write("<repository>", textotei(listWit[i].msIdentifier.repository), "</repository>", "\n") 8975 f:write("<repository>", textotei(listWit[i].msIdentifier.repository), "</repository>", "\n")
8970 else end 8976 else end
8971 if listWit[i].msIdentifier.collection ~= "" then 8977 if listWit[i].msIdentifier.collection ~= "" then
8972 f:write("<collection>", textotei(listWit[i].msIdentifier.collection), "</collection>", "\n") 8978 f:write("<collection>", textotei(listWit[i].msIdentifier.collection), "</collection>", "\n")
8973 else end 8979 else end
8974 if listWit[i].msIdentifier.idno ~= "" then 8980 if listWit[i].msIdentifier.idno ~= "" then
8975 f:write("<idno>", textotei(listWit[i].msIdentifier.idno), "</idno>", "\n") 8981 f:write("<idno>", textotei(listWit[i].msIdentifier.idno), "</idno>", "\n")
8976 else end 8982 else end
8977 if listWit[i].msIdentifier.msName ~= "" then 8983 if listWit[i].msIdentifier.msName ~= "" then
8978 f:write("<msName>", textotei(listWit[i].msIdentifier.msName), "</msName>", "\n") 8984 f:write("<msName>", textotei(listWit[i].msIdentifier.msName), "</msName>", "\n")
8979 else end 8985 else end
8980 f:write("</msIdentifier>", "\n") 8986 f:write("</msIdentifier>", "\n")
8981 end 8987 end
8982 if listWit[i].handDesc ~= nil then 8988 if listWit[i].handDesc ~= nil then
8983 f:write("<physDesc>", "\n") 8989 f:write("<physDesc>", "\n")
8984 f:write("<handDesc hands=\"", #listWit[i].handDesc, "\">", "\n") 8990 f:write("<handDesc hands=\"", #listWit[i].handDesc, "\">", "\n")
8985 local j = 1 8991 local j = 1
8986 while listWit[i].handDesc[j] 8992 while listWit[i].handDesc[j]
8987 do 8993 do
8988 f:write("<handNote xml:id=\"", listWit[i].handDesc[j].xmlid, "\">", "\n") 8994 f:write("<handNote xml:id=\"", listWit[i].handDesc[j].xmlid, "\">", "\n")
8989 f:write('<abbr type="siglum">', textotei(listWit[i].handDesc[j].abbr), "</abbr>", "\n") 8995 f:write('<abbr type="siglum">', textotei(listWit[i].handDesc[j].abbr), "</abbr>", "\n")
8990 f:write("<p>", textotei(listWit[i].handDesc[j].detailsDesc), "</p>", "\n") 8996 f:write("<p>", textotei(listWit[i].handDesc[j].detailsDesc), "</p>", "\n")
8991 f:write("</handNote>", "\n") 8997 f:write("</handNote>", "\n")
8992 j = j + 1 8998 j = j + 1
8993 end 8999 end
8994 f:write("</handDesc>", "\n") 9000 f:write("</handDesc>", "\n")
8995 f:write("</physDesc>", "\n") 9001 f:write("</physDesc>", "\n")
8996 else end 9002 else end
8997 if listWit[i].history ~= nil then 9003 if listWit[i].history ~= nil then
8998 f:write("<history>", "\n") 9004 f:write("<history>", "\n")
8999 f:write("<origin>", "\n") 9005 f:write("<origin>", "\n")
9000 f:write("<origDate>", textotei(listWit[i].history.origin.origDate), "</origDate>", "\n") 9006 f:write("<origDate>", textotei(listWit[i].history.origin.origDate), "</origDate>", "\n")
9001 f:write("</origin>", "\n") 9007 f:write("</origin>", "\n")
9002 f:write("</history>", "\n") 9008 f:write("</history>", "\n")
9003 end
9004 f:write("</msDesc>", "\n")
9005 f:write("</witness>", "\n")
9006 end
9007 f:write("</listWit>", "\n")
9008 if next(listPerson) ~= nil
9009 then
9010 f:write("<listPerson xml:id=\"scholars\">", "\n")
9011 for i = 1,#listPerson do
9012 f:write('<person xml:id=\"', listPerson[i].xmlid, "\">", "\n")
9013 f:write('<persName>', "\n")
9014 f:write('<abbr type="siglum">', textotei(listPerson[i].abbr), "</abbr>", "\n")
9015 if listPerson[i].persName.name ~= nil
9016 then
9017 f:write(textotei(listPerson[i].persName.name))
9018 else
9019 if listPerson[i].persName.forename ~= ""
9020 then
9021 f:write("<forename>", textotei(listPerson[i].persName.forename), "</forename>", "\n")
9022 else
9023 f:write("<forename><!-- forename --></forename>", "\n")
9024 end 9009 end
9025 if textotei(listPerson[i].persName.surname) ~= "" 9010 f:write("</msDesc>", "\n")
9011 f:write("</witness>", "\n")
9012 end
9013 f:write("</listWit>", "\n")
9014 end
9015 if next(listPerson) ~= nil
9016 then
9017 f:write("<listPerson xml:id=\"scholars\">", "\n")
9018 for i = 1,#listPerson do
9019 f:write('<person xml:id=\"', listPerson[i].xmlid, "\">", "\n")
9020 f:write('<persName>', "\n")
9021 f:write('<abbr type="siglum">', textotei(listPerson[i].abbr), "</abbr>", "\n")
9022 if listPerson[i].persName.name ~= nil
9026 then 9023 then
9027 f:write("<surname>", textotei(listPerson[i].persName.surname), "</surname>", "\n") 9024 f:write(textotei(listPerson[i].persName.name))
9028 else 9025 else
9029 f:write("<surname><!-- surname --></surname>", "\n") 9026 if listPerson[i].persName.forename ~= ""
9027 then
9028 f:write("<forename>", textotei(listPerson[i].persName.forename), "</forename>", "\n")
9029 else
9030 f:write("<forename><!-- forename --></forename>", "\n")
9031 end
9032 if textotei(listPerson[i].persName.surname) ~= ""
9033 then
9034 f:write("<surname>", textotei(listPerson[i].persName.surname), "</surname>", "\n")
9035 else
9036 f:write("<surname><!-- surname --></surname>", "\n")
9037 end
9038 if textotei(listPerson[i].persName.addName) ~= ""
9039 then
9040 f:write("<addName>", textotei(listPerson[i].persName.addName), "</addName>", "\n")
9041 end
9030 end 9042 end
9031 if textotei(listPerson[i].persName.addName) ~= "" 9043 if listPerson[i].note ~= ""
9032 then 9044 then
9033 f:write("<addName>", textotei(listPerson[i].persName.addName), "</addName>", "\n") 9045 f:write("<note>", textotei(listPerson[i].note), "</note>", "\n")
9034 end 9046 end
9047 f:write('</persName>', "\n")
9048 f:write('</person>', "\n")
9035 end 9049 end
9036 if listPerson[i].note ~= "" 9050 f:write("</listPerson>", "\n")
9037 then
9038 f:write("<note>", textotei(listPerson[i].note), "</note>", "\n")
9039 end
9040 f:write('</persName>', "\n")
9041 f:write('</person>', "\n")
9042 end 9051 end
9043 f:write("</listPerson>", "\n")
9044 end 9052 end
9045 f:write("</sourceDesc>", "\n") 9053 f:write("</sourceDesc>", "\n")
9046 f:write("</fileDesc>", "\n") 9054 f:write("</fileDesc>", "\n")