From 17eaf0646334e334ae90f3ebd366238c46f6bec4 Mon Sep 17 00:00:00 2001
From: Michelle Rodzis <rodzis@sub.uni-goettingen.de>
Date: Fri, 26 Oct 2018 09:58:19 +0200
Subject: [PATCH] Keep relevant attributes after splitting

---
 modules/intermediate_format/ifweb.xql | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/intermediate_format/ifweb.xql b/modules/intermediate_format/ifweb.xql
index db3a0de..4192b5e 100644
--- a/modules/intermediate_format/ifweb.xql
+++ b/modules/intermediate_format/ifweb.xql
@@ -56,7 +56,10 @@ $dir as xs:string) {
     let $intermediate-format := ident:walk($preprocessed-data, ())
     let $content := 
         if(count($intermediate-format) gt 1) then
-            element tei:div {$intermediate-format}
+            element tei:div {
+                $xml/@*,
+                attribute id {generate-id($xml)},
+                $intermediate-format}
         else
             $intermediate-format
     let $store := xmldb:store($dir, $filename, $content)
-- 
GitLab