Updated with changes to get multiple authors
Change-Id: Ifd0f634b3ae54b3319c5e82a4da067f1ebf3a49e
diff --git a/irish2tei.py b/irish2tei.py
index a840d2b..84c908c 100644
--- a/irish2tei.py
+++ b/irish2tei.py
@@ -46,7 +46,8 @@
# Store metadata and texts in lists
titles = root.find(".//*{http://www.tei-c.org/ns/1.0}bibl/{http://www.tei-c.org/ns/1.0}title")
uris = root.find(".//*{http://www.tei-c.org/ns/1.0}bibl/{http://www.tei-c.org/ns/1.0}pubPlace")
- authors = root.find(".//*{http://www.tei-c.org/ns/1.0}bibl/{http://www.tei-c.org/ns/1.0}author")
+ authors = root.findall(".//*{http://www.tei-c.org/ns/1.0}bibl/{http://www.tei-c.org/ns/1.0}author")
+
dates = root.find(".//*{http://www.tei-c.org/ns/1.0}bibl/{http://www.tei-c.org/ns/1.0}date")
texts = root.findall(".//*{http://www.tei-c.org/ns/1.0}body/{http://www.tei-c.org/ns/1.0}div")
domains = root.find(".//*[@type]")
@@ -78,8 +79,14 @@
analytic = ET.SubElement(sourceDesc, "analytic")
title = ET.SubElement(titleStmt, "title")
title.text = titles.text
- hauthor = ET.SubElement(analytic, "h.author")
- hauthor.text = authors.text
+
+ print(textSigle.text, end='\n')
+
+
+ for author in authors :
+ hauthor = ET.SubElement(analytic, "h.author")
+ hauthor.text = author.text
+ print(hauthor.text, end='\n')
imprint = ET.SubElement(sourceDesc, "imprint")
pubDateYear = ET.SubElement(imprint, "pubDate")
pubDateYear.set("type", "year")
@@ -107,7 +114,8 @@
'''
domain.text = domain.text.replace("_hobbies", "_Hobbies")
text = ET.SubElement(tei, "text")
- text.append(texts[i])
+ text.append(texts[i])
+
return tree
diff --git a/output/GA_corpus.p5.xml b/output/GA_corpus.p5.xml
index fd166d2..3a4e46b 100644
--- a/output/GA_corpus.p5.xml
+++ b/output/GA_corpus.p5.xml
@@ -12,6 +12,10 @@
<sourceDesc>
<analytic>
<h.author>Ó Duibhir, Pádraig</h.author>
+ <h.author>Ní Thuairisg, Laoise</h.author>
+ <h.author>Ó Ciardubháin, Colm</h.author>
+ <h.author>Ó Floinn, Cóilín</h.author>
+ <h.author>Uí Laighléis, Gearóidín</h.author>
</analytic>
<imprint>
<pubDate type="year">2020</pubDate>
@@ -552,6 +556,7 @@
<sourceDesc>
<analytic>
<h.author>Watson, Dorothy</h.author>
+ <h.author>Nolan, Brian</h.author>
</analytic>
<imprint>
<pubDate type="year">2011</pubDate>