Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ARCHITRAVE
SADE
Commits
fef93f52
Commit
fef93f52
authored
Aug 24, 2020
by
sendler
🐢
Browse files
move transformation of table into dedicated function
parent
a03c2ccf
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/architrave/transform.xqm
View file @
fef93f52
...
...
@@ -379,10 +379,10 @@ return
<span id="page{string($node/@n)}" class="pb" facs="{ string($node/@facs) }">{ string($node/@n) }</span>
case element ( tei:fw ) return
if (string($node/@place) = 'top-right') then (
<div class="tei-fw" style="text-align:left"><span class="fw {string($node/@place)}">{
string($node
) }</span></div>
<div class="tei-fw" style="text-align:left"><span class="fw {string($node/@place)}">{
local:magic($node/node()
) }</span></div>
)
else (
<div class="tei-fw" style="text-align:left"><span class="fw {string($node/@place)}">{
string($node
) }</span></div>
<div class="tei-fw" style="text-align:left"><span class="fw {string($node/@place)}">{
local:magic($node/node()
) }</span></div>
)
case element ( tei:choice ) return
if (string('') = string('')) then (
...
...
@@ -558,6 +558,9 @@ return
)
else (local:magic($node/node()))
case element ( tei:table ) return
local:parse-table($node)
default return
local:magic($node/node())}
...
...
@@ -568,3 +571,25 @@ return
}
}
};
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
sendler
🐢
@sendler
mentioned in commit
5d725dbc
·
Aug 24, 2020
mentioned in commit
5d725dbc
mentioned in commit 5d725dbcbfea88f739e3eefdb2da29180dea32be
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment