Commit a7ea8078 authored by sendler's avatar sendler 🐢
Browse files

begin adding transformation for columns

parent b53a9372
......@@ -626,6 +626,10 @@ return
)
else (local:magic($node/node()))
case element ( tei:cb ) return
if ($node = ($node/ancestor::*//tei:cb)[1]) then
local:parse-column($node)
else ()
default return
local:magic($node/node())}
......@@ -660,4 +664,29 @@ declare function local:parse-table($table as element(tei:table)) as element(div)
},
if ( $foot ) then local:magic($foot/node()) else ()
}
};
declare function local:parse-column($node) {
if ($node/following-sibling::tei:cb) then
let $number := count($node/following-sibling::tei:cb)
let $firstColumn := $node/following-sibling::*[count(following-sibling::tei:cb) = $number]
return
element div {
attribute class { "column-wrapper" },
element div {
attribute class { "column" },
local:magic($firstColumn)
},
(for $i in (1 to $number)
order by $i
return
element div {
attribute class { string-join(("column", $i), "")},
local:magic($firstColumn/following-sibling::*[count(preceding-sibling::tei:cb) = $i + 1][not(self::cb)])
})
}
else if ($node/following-sibling::*/tei:cb) then
<span style="color:blue">{count($node/following-sibling::*/tei:cb)}</span>
else
()
};
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment