Start with 2nd XSLT pass
diff --git a/Makefile b/Makefile
index 8ca118c..2652f39 100644
--- a/Makefile
+++ b/Makefile
@@ -60,7 +60,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/epub2i5.xsl $(shell find $< -name "*.opf") | $(SAXON) -xsl:xslt/unnest_p.xsl - > $@
%.zip: %.i5.xml
tei2korapxml -l warn -s -tk - < $< > $@
diff --git a/xslt/unnest_p.xsl b/xslt/unnest_p.xsl
new file mode 100644
index 0000000..26e2cbd
--- /dev/null
+++ b/xslt/unnest_p.xsl
@@ -0,0 +1,15 @@
+<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>