Commit 72b6070f authored by sendler's avatar sendler 🐢
Browse files

move transformation of table into dedicated function

parent 16439eee
......@@ -558,25 +558,8 @@ return
)
else (local:magic($node/node()))
case element ( tei:table ) return
element xhtml:table {
local:magic($node/node())
}
case element ( tei:row ) return
element xhtml:tr {
local:magic($node/node())
}
case element ( tei:cell ) return
element xhtml:td {
local:magic($node/node())
}
case element ( tei:head ) return
element xhtml:th {
local:magic($node/node())
}
case element ( tei:table ) return
local:parse-table($node)
default return
local:magic($node/node())}
......@@ -587,4 +570,26 @@ return
($err:description)
}
}
};
declare function local:parse-table($table as element(tei:table)) as element(xhtml:table) {
let $head := $table/tei:head
let $rows := $table/tei:row
let $content := for $row in $rows
let $cells := $row/tei:cell
return
element tr {
for $cell in $cells return
element td {local:magic($cell/node())}
}
let $foot := $table/tei:trailer
return
element table {
if ($head != "") then element thead {$head} else (),
element tbody {
$content
},
if ($foot != "") then element tfoot {$foot} 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