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