Run xslt pass 2 and three on the whole year volumes

very fast...
diff --git a/Makefile b/Makefile
index 209b19b..f69482e 100644
--- a/Makefile
+++ b/Makefile
@@ -21,8 +21,11 @@
 krill: $(TARGET_DIR)/dnb$(YY).krill.tar
 index: $(TARGET_DIR)/dnb$(YY).index.tar.xz
 
+$(TARGET_DIR)/dnb$(YY).i5.xml: $(TARGET_DIR)/dnb$(YY).pre.i5.xml
+	$(SAXON) -xsl:xslt/pass2.xsl $< | $(SAXON) -xsl:xslt/pass3.xsl - > $@
 
-$(TARGET_DIR)/dnb$(YY).i5.xml: $(patsubst $(SRC_DIR)/%.epub,$(TARGET_DIR)/%.i5.xml,$(wildcard $(SRC_DIR)/*.epub))
+
+$(TARGET_DIR)/dnb$(YY).pre.i5.xml: $(patsubst $(SRC_DIR)/%.epub,$(TARGET_DIR)/%.i5.xml,$(wildcard $(SRC_DIR)/*.epub))
 	@echo $(patsubst $(SRC_DIR)/%.epub,$(TARGET_DIR)/%.i5.xml,$(wildcard $(SRC_DIR)/*0.epub)) > $(TARGET_DIR)/filelist$(YY).txt
 	@echo $(patsubst $(SRC_DIR)/%.epub,$(TARGET_DIR)/%.i5.xml,$(wildcard $(SRC_DIR)/*1.epub)) >> $(TARGET_DIR)/filelist$(YY).txt
 	@echo $(patsubst $(SRC_DIR)/%.epub,$(TARGET_DIR)/%.i5.xml,$(wildcard $(SRC_DIR)/*2.epub)) >> $(TARGET_DIR)/filelist$(YY).txt
@@ -33,7 +36,7 @@
 	@echo $(patsubst $(SRC_DIR)/%.epub,$(TARGET_DIR)/%.i5.xml,$(wildcard $(SRC_DIR)/*7.epub)) >> $(TARGET_DIR)/filelist$(YY).txt
 	@echo $(patsubst $(SRC_DIR)/%.epub,$(TARGET_DIR)/%.i5.xml,$(wildcard $(SRC_DIR)/*8.epub)) >> $(TARGET_DIR)/filelist$(YY).txt
 	@echo $(patsubst $(SRC_DIR)/%.epub,$(TARGET_DIR)/%.i5.xml,$(wildcard $(SRC_DIR)/*9.epub)) >> $(TARGET_DIR)/filelist$(YY).txt
-	sed -i -e 's/ /\n/g' $(TARGET_DIR)/filelist$(YY).txt
+	sed -i -e 's/ /\n/g; /^$$/d' $(TARGET_DIR)/filelist$(YY).txt
 	head -n -1 xslt/idsCorpus-template.xml | sed -e 's/{YY}/$(YY)/' > $@
 	@while IFS= read -r f; do \
 		if head -500 "$$f" | grep -Eq '<pubDate type="year">..$(YY)'; then \
@@ -60,7 +63,7 @@
 $(TARGET_DIR)/%.i5.xml: $(BUILD_DIR)/% xslt/epub2i5.xsl xslt/idsCorpus-template.xml
 	mkdir -p $(TARGET_DIR)
 	echo "Converting $< to $@"
-	$(SAXON) -xsl:xslt/epub2i5.xsl $(shell find $< -name "*.opf") | $(SAXON) -xsl:xslt/unnest_p.xsl - > $@
+	$(SAXON) -xsl:xslt/epub2i5.xsl $(shell find $< -name "*.opf") > $@
 
 %.zip: %.i5.xml
 	tei2korapxml -l warn -s -tk - < $< > $@
diff --git a/xslt/pass2.xsl b/xslt/pass2.xsl
new file mode 100644
index 0000000..9aef8ca
--- /dev/null
+++ b/xslt/pass2.xsl
@@ -0,0 +1,37 @@
+<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+                xmlns:saxon="http://saxon.sf.net/"
+                exclude-result-prefixes="saxon">
+
+    <xsl:output method="xml" indent="yes" saxon:line-length="1000"
+    doctype-public="-//IDS//DTD IDS-I5 1.0//EN"
+    doctype-system="http://corpora.ids-mannheim.de/I5/DTD/i5.dtd"
+    />
+
+    <xsl:mode on-no-match="shallow-copy"/>
+
+
+    <xsl:template match="p[descendant::div|descendant::p]" priority="1.0">
+        <div type="section">
+            <xsl:apply-templates/>
+        </div>
+    </xsl:template>
+
+    <xsl:template match="(ref|emph|hi|text())[parent::div]" priority="1.0">
+        <p>
+            <xsl:apply-templates/>
+        </p>
+    </xsl:template>
+
+    <xsl:template match="head[parent::p]">
+        <hi rend="bold">
+            <xsl:value-of select="."/>
+        </hi>
+    </xsl:template>
+
+    <xsl:template match="hi[parent::div]">
+        <p>
+            <xsl:apply-templates/>
+        </p>
+    </xsl:template>
+
+</xsl:stylesheet>
diff --git a/xslt/pass3.xsl b/xslt/pass3.xsl
new file mode 100644
index 0000000..69ae2aa
--- /dev/null
+++ b/xslt/pass3.xsl
@@ -0,0 +1,18 @@
+<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+                xmlns:saxon="http://saxon.sf.net/"
+                exclude-result-prefixes="saxon">
+
+    <xsl:output method="xml" indent="yes" saxon:line-length="1000"
+    doctype-public="-//IDS//DTD IDS-I5 1.0//EN"
+    doctype-system="http://corpora.ids-mannheim.de/I5/DTD/i5.dtd"
+    />
+
+    <xsl:mode on-no-match="shallow-copy"/> 
+
+    <xsl:template match="hi[parent::div]">
+        <p>
+            <xsl:apply-templates/>
+        </p>
+    </xsl:template>
+
+</xsl:stylesheet>
diff --git a/xslt/unnest_p.xsl b/xslt/unnest_p.xsl
deleted file mode 100644
index 26e2cbd..0000000
--- a/xslt/unnest_p.xsl
+++ /dev/null
@@ -1,15 +0,0 @@
-<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-                xmlns:saxon="http://saxon.sf.net/"
-                exclude-result-prefixes="saxon">
-
-    <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" saxon:line-length="1000"/>
-
-    <xsl:template match="p/p">
-        <span>
-            <xsl:apply-templates/>
-        </span>
-    </xsl:template>
-
-    <xsl:mode on-no-match="shallow-copy"/>
-
-</xsl:stylesheet>