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

update column transformation, add wrapper function

parent a7ea8078
......@@ -627,7 +627,7 @@ return
else (local:magic($node/node()))
case element ( tei:cb ) return
if ($node = ($node/ancestor::*//tei:cb)[1]) then
if ($node/@* = ($node/ancestor::*//tei:cb/@*)[1]) then
local:parse-column($node)
else ()
......@@ -668,22 +668,18 @@ declare function local:parse-table($table as element(tei:table)) as element(div)
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]
let $number := count($node/following-sibling::tei:cb) + 1
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)])
})
attribute class { "column" },
local:magic($node/following-sibling::*[count(preceding-sibling::tei:cb) = $i])
}
)
}
else if ($node/following-sibling::*/tei:cb) then
<span style="color:blue">{count($node/following-sibling::*/tei:cb)}</span>
......
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