diff --git a/src/teipb/odd/parzival-verse.odd b/src/teipb/odd/parzival-verse.odd index 228380d7..3cb99d42 100644 --- a/src/teipb/odd/parzival-verse.odd +++ b/src/teipb/odd/parzival-verse.odd @@ -37,7 +37,7 @@ - + diff --git a/src/teipb/odd/parzival.odd b/src/teipb/odd/parzival.odd index e5ad780b..f294cb1d 100644 --- a/src/teipb/odd/parzival.odd +++ b/src/teipb/odd/parzival.odd @@ -39,11 +39,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -52,10 +83,65 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + color: green; text-decoration: underline; + + + + + + + + text-decoration: line-through; + + + + + + + + + + + + + + + + + + + + + + + + + font-style: italic; + diff --git a/src/teipb/transform/parzival-epub.xql b/src/teipb/transform/parzival-epub.xql index 7d7ee524..ac58998d 100644 --- a/src/teipb/transform/parzival-epub.xql +++ b/src/teipb/transform/parzival-epub.xql @@ -218,9 +218,9 @@ declare function model:apply($config as map(*), $input as node()*) { case element(role) return epub:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) case element(hi) return - html:inline($config, ., css:get-rendition(., ("tei-hi", css:map-rend-to-class(.))), .) + html:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) case element(note) return - epub:note($config, ., ("tei-note", css:map-rend-to-class(.)), ., @place, @n) + html:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) case element(code) return html:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) case element(postscript) return @@ -235,7 +235,7 @@ declare function model:apply($config as map(*), $input as node()*) { else $config?apply($config, ./node()) case element(del) return - html:inline($config, ., ("tei-del", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) case element(cell) return (: Insert table cell. :) html:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) @@ -264,7 +264,7 @@ declare function model:apply($config as map(*), $input as node()*) { case element(ab) return html:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) case element(add) return - html:inline($config, ., ("tei-add", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) case element(revisionDesc) return html:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) case element(head) return @@ -457,7 +457,7 @@ declare function model:apply($config as map(*), $input as node()*) { else html:inline($config, ., ("tei-gap3", css:map-rend-to-class(.)), .) case element(seg) return - html:inline($config, ., ("tei-seg1", "glory-initial", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) case element(notatedMusic) return html:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) case element(profileDesc) return @@ -481,10 +481,16 @@ declare function model:apply($config as map(*), $input as node()*) { case element(group) return epub:block($config, ., ("tei-group", css:map-rend-to-class(.)), .) case element(cb) return - epub:block($config, ., ("tei-cb", css:map-rend-to-class(.)), .) + epub:break($config, ., ("tei-cb", css:map-rend-to-class(.)), ., 'column', @n) case element(name) return (: delete me after testing :) html:inline($config, ., ("tei-name", css:map-rend-to-class(.)), (given-names,surname)) + case element(reg) return + html:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) + case element(milestone) return + html:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) + case element(subst) return + html:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) case element(exist:match) return html:match($config, ., .) case element() return diff --git a/src/teipb/transform/parzival-fo.xql b/src/teipb/transform/parzival-fo.xql index 6ba4c823..087e7fec 100644 --- a/src/teipb/transform/parzival-fo.xql +++ b/src/teipb/transform/parzival-fo.xql @@ -212,9 +212,9 @@ declare function model:apply($config as map(*), $input as node()*) { case element(role) return fo:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) case element(hi) return - fo:inline($config, ., css:get-rendition(., ("tei-hi", css:map-rend-to-class(.))), .) + fo:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) case element(note) return - fo:note($config, ., ("tei-note", css:map-rend-to-class(.)), ., @place, @n) + fo:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) case element(code) return fo:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) case element(postscript) return @@ -229,7 +229,7 @@ declare function model:apply($config as map(*), $input as node()*) { else $config?apply($config, ./node()) case element(del) return - fo:inline($config, ., ("tei-del", css:map-rend-to-class(.)), .) + fo:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) case element(cell) return (: Insert table cell. :) fo:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) @@ -258,7 +258,7 @@ declare function model:apply($config as map(*), $input as node()*) { case element(ab) return fo:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) case element(add) return - fo:inline($config, ., ("tei-add", css:map-rend-to-class(.)), .) + fo:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) case element(revisionDesc) return fo:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) case element(head) return @@ -437,7 +437,7 @@ declare function model:apply($config as map(*), $input as node()*) { else fo:inline($config, ., ("tei-gap3", css:map-rend-to-class(.)), .) case element(seg) return - fo:inline($config, ., ("tei-seg1", "glory-initial", css:map-rend-to-class(.)), .) + fo:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) case element(notatedMusic) return fo:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) case element(profileDesc) return @@ -461,10 +461,16 @@ declare function model:apply($config as map(*), $input as node()*) { case element(group) return fo:block($config, ., ("tei-group", css:map-rend-to-class(.)), .) case element(cb) return - fo:block($config, ., ("tei-cb", css:map-rend-to-class(.)), .) + fo:break($config, ., ("tei-cb", css:map-rend-to-class(.)), ., 'column', @n) case element(name) return (: delete me after testing :) fo:inline($config, ., ("tei-name", css:map-rend-to-class(.)), (given-names,surname)) + case element(reg) return + fo:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) + case element(milestone) return + fo:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) + case element(subst) return + fo:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) case element() return if (namespace-uri(.) = 'http://www.tei-c.org/ns/1.0') then $config?apply($config, ./node()) diff --git a/src/teipb/transform/parzival-latex-main.xql b/src/teipb/transform/parzival-latex-main.xql index 5affd214..40cef592 100644 --- a/src/teipb/transform/parzival-latex-main.xql +++ b/src/teipb/transform/parzival-latex-main.xql @@ -5,9 +5,6 @@ declare variable $xml external; declare variable $parameters external; let $options := map { - "class": "article", - "section-numbers": false(), - "font-size": "11pt", "styles": ["transform/parzival.css"], "collection": "/db/apps/parzival/transform", "parameters": if (exists($parameters)) then $parameters else map {} diff --git a/src/teipb/transform/parzival-latex-module.xql b/src/teipb/transform/parzival-latex-module.xql index 2ea403fb..015b5896 100644 --- a/src/teipb/transform/parzival-latex-module.xql +++ b/src/teipb/transform/parzival-latex-module.xql @@ -8,9 +8,6 @@ import module namespace m='http://www.tei-c.org/pm/models/parzival/latex' at 'pa declare function pml:transform($xml as node()*, $parameters as map(*)?) { let $options := map { - "class": "article", - "section-numbers": false(), - "font-size": "11pt", "styles": ["transform/parzival.css"], "collection": "/db/apps/parzival/transform", "parameters": if (exists($parameters)) then $parameters else map {} diff --git a/src/teipb/transform/parzival-latex.xql b/src/teipb/transform/parzival-latex.xql index 1037da19..4fc16c84 100644 --- a/src/teipb/transform/parzival-latex.xql +++ b/src/teipb/transform/parzival-latex.xql @@ -239,9 +239,9 @@ declare function model:apply($config as map(*), $input as node()*) { case element(role) return latex:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) case element(hi) return - latex:inline($config, ., css:get-rendition(., ("tei-hi", css:map-rend-to-class(.))), .) + latex:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) case element(note) return - latex:note($config, ., ("tei-note", css:map-rend-to-class(.)), ., @place, @n) + latex:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) case element(code) return latex:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) case element(postscript) return @@ -256,7 +256,7 @@ declare function model:apply($config as map(*), $input as node()*) { else $config?apply($config, ./node()) case element(del) return - latex:inline($config, ., ("tei-del", css:map-rend-to-class(.)), .) + latex:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) case element(cell) return (: Insert table cell. :) latex:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) @@ -285,7 +285,7 @@ declare function model:apply($config as map(*), $input as node()*) { case element(ab) return latex:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) case element(add) return - latex:inline($config, ., ("tei-add", css:map-rend-to-class(.)), .) + latex:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) case element(revisionDesc) return latex:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) case element(head) return @@ -465,7 +465,7 @@ declare function model:apply($config as map(*), $input as node()*) { else latex:inline($config, ., ("tei-gap3", css:map-rend-to-class(.)), .) case element(seg) return - latex:inline($config, ., ("tei-seg1", "glory-initial", css:map-rend-to-class(.)), .) + latex:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) case element(notatedMusic) return latex:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) case element(profileDesc) return @@ -489,10 +489,16 @@ declare function model:apply($config as map(*), $input as node()*) { case element(group) return latex:block($config, ., ("tei-group", css:map-rend-to-class(.)), .) case element(cb) return - latex:block($config, ., ("tei-cb", css:map-rend-to-class(.)), .) + latex:break($config, ., ("tei-cb", css:map-rend-to-class(.)), ., 'column', @n) case element(name) return (: delete me after testing :) latex:inline($config, ., ("tei-name", css:map-rend-to-class(.)), (given-names,surname)) + case element(reg) return + latex:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) + case element(milestone) return + latex:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) + case element(subst) return + latex:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) case element() return if (namespace-uri(.) = 'http://www.tei-c.org/ns/1.0') then $config?apply($config, ./node()) diff --git a/src/teipb/transform/parzival-print.xql b/src/teipb/transform/parzival-print.xql index cef8759e..8e2fa005 100644 --- a/src/teipb/transform/parzival-print.xql +++ b/src/teipb/transform/parzival-print.xql @@ -221,9 +221,9 @@ declare function model:apply($config as map(*), $input as node()*) { case element(role) return html:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) case element(hi) return - html:inline($config, ., css:get-rendition(., ("tei-hi", css:map-rend-to-class(.))), .) + html:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) case element(note) return - printcss:note($config, ., ("tei-note", css:map-rend-to-class(.)), ., @place, @n) + html:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) case element(code) return html:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) case element(postscript) return @@ -238,7 +238,7 @@ declare function model:apply($config as map(*), $input as node()*) { else $config?apply($config, ./node()) case element(del) return - html:inline($config, ., ("tei-del", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) case element(cell) return (: Insert table cell. :) html:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) @@ -267,7 +267,7 @@ declare function model:apply($config as map(*), $input as node()*) { case element(ab) return html:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) case element(add) return - html:inline($config, ., ("tei-add", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) case element(revisionDesc) return html:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) case element(head) return @@ -460,7 +460,7 @@ declare function model:apply($config as map(*), $input as node()*) { else html:inline($config, ., ("tei-gap3", css:map-rend-to-class(.)), .) case element(seg) return - html:inline($config, ., ("tei-seg1", "glory-initial", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) case element(notatedMusic) return html:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) case element(profileDesc) return @@ -484,10 +484,16 @@ declare function model:apply($config as map(*), $input as node()*) { case element(group) return html:block($config, ., ("tei-group", css:map-rend-to-class(.)), .) case element(cb) return - html:block($config, ., ("tei-cb", css:map-rend-to-class(.)), .) + html:break($config, ., ("tei-cb", css:map-rend-to-class(.)), ., 'column', @n) case element(name) return (: delete me after testing :) html:inline($config, ., ("tei-name", css:map-rend-to-class(.)), (given-names,surname)) + case element(reg) return + html:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) + case element(milestone) return + html:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) + case element(subst) return + html:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) case element(exist:match) return html:match($config, ., .) case element() return diff --git a/src/teipb/transform/parzival-verse-epub.xql b/src/teipb/transform/parzival-verse-epub.xql index 2e2ab42a..a29d0b22 100644 --- a/src/teipb/transform/parzival-verse-epub.xql +++ b/src/teipb/transform/parzival-verse-epub.xql @@ -11,6 +11,8 @@ declare default element namespace "http://www.tei-c.org/ns/1.0"; declare namespace xhtml='http://www.w3.org/1999/xhtml'; +declare namespace mei='http://www.music-encoding.org/ns/mei'; + declare namespace pb='http://teipublisher.com/1.0'; import module namespace css="http://www.tei-c.org/tei-simple/xquery/css"; @@ -25,9 +27,15 @@ import module namespace global="http://www.tei-c.org/tei-simple/config" at "../m declare %private function model:template-l($config as map(*), $node as node()*, $params as map(*)) { {$config?apply-children($config, $node, $params?id)}{$config?apply-children($config, $node, $params?content)}/* }; -(: generated template function for element spec: cb :) -declare %private function model:template-cb($config as map(*), $node as node()*, $params as map(*)) { -

Spalte: {$config?apply-children($config, $node, $params?label)}

/* +(: generated template function for element spec: ptr :) +declare %private function model:template-ptr($config as map(*), $node as node()*, $params as map(*)) { + + Original Clefs + /* +}; +(: generated template function for element spec: mei:mdiv :) +declare %private function model:template-mei_mdiv($config as map(*), $node as node()*, $params as map(*)) { + /* }; (:~ @@ -70,6 +78,62 @@ declare function model:apply($config as map(*), $input as node()*) { . return typeswitch(.) + case element(licence) return + if (@target) then + html:link($config, ., ("tei-licence1", "licence", css:map-rend-to-class(.)), 'Licence', @target, (), map {}) + else + html:omit($config, ., ("tei-licence2", css:map-rend-to-class(.)), .) + case element(castItem) return + (: Insert item, rendered as described in parent list rendition. :) + html:listItem($config, ., ("tei-castItem", css:map-rend-to-class(.)), ., ()) + case element(listBibl) return + if (bibl) then + html:list($config, ., ("tei-listBibl1", css:map-rend-to-class(.)), ., ()) + else + epub:block($config, ., ("tei-listBibl2", css:map-rend-to-class(.)), .) + case element(item) return + html:listItem($config, ., ("tei-item", css:map-rend-to-class(.)), ., ()) + case element(figure) return + if (head or @rendition='simple:display') then + epub:block($config, ., ("tei-figure1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-figure2", css:map-rend-to-class(.)), .) + case element(teiHeader) return + if ($parameters?header='short') then + epub:block($config, ., ("tei-teiHeader3", css:map-rend-to-class(.)), .) + else + html:metadata($config, ., ("tei-teiHeader4", css:map-rend-to-class(.)), .) + case element(g) return + if (not(text())) then + html:glyph($config, ., ("tei-g1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-g2", css:map-rend-to-class(.)), .) + case element(supplied) return + if (parent::choice) then + html:inline($config, ., ("tei-supplied1", css:map-rend-to-class(.)), .) + else + if (@reason='damage') then + html:inline($config, ., ("tei-supplied2", css:map-rend-to-class(.)), .) + else + if (@reason='illegible' or not(@reason)) then + html:inline($config, ., ("tei-supplied3", css:map-rend-to-class(.)), .) + else + if (@reason='omitted') then + html:inline($config, ., ("tei-supplied4", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-supplied5", css:map-rend-to-class(.)), .) + case element(author) return + if (ancestor::teiHeader) then + epub:block($config, ., ("tei-author1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-author2", css:map-rend-to-class(.)), .) + case element(castList) return + if (child::*) then + html:list($config, ., css:get-rendition(., ("tei-castList", css:map-rend-to-class(.))), castItem, ()) + else + $config?apply($config, ./node()) + case element(milestone) return + html:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) case element(l) return let $params := map { @@ -81,17 +145,365 @@ declare function model:apply($config as map(*), $input as node()*) { model:template-l($config, ., $params) return epub:block(map:merge(($config, map:entry("template", true()))), ., css:get-rendition(., ("tei-l", "line", css:map-rend-to-class(.))), $content) - case element(cb) return + case element(closer) return + epub:block($config, ., ("tei-closer", css:map-rend-to-class(.)), .) + case element(ptr) return + if (parent::notatedMusic) then + (: Load and display external MEI :) + let $params := + map { + "url": @target, + "content": . + } + + let $content := + model:template-ptr($config, ., $params) + return + html:pass-through(map:merge(($config, map:entry("template", true()))), ., ("tei-ptr", css:map-rend-to-class(.)), $content) + else + $config?apply($config, ./node()) + case element(signed) return + if (parent::closer) then + epub:block($config, ., ("tei-signed1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-signed2", css:map-rend-to-class(.)), .) + case element(list) return + html:list($config, ., css:get-rendition(., ("tei-list", css:map-rend-to-class(.))), item, ()) + case element(p) return + html:paragraph($config, ., css:get-rendition(., ("tei-p2", css:map-rend-to-class(.))), .) + case element(q) return + if (l) then + epub:block($config, ., css:get-rendition(., ("tei-q1", css:map-rend-to-class(.))), .) + else + if (ancestor::p or ancestor::cell) then + html:inline($config, ., css:get-rendition(., ("tei-q2", css:map-rend-to-class(.))), .) + else + epub:block($config, ., css:get-rendition(., ("tei-q3", css:map-rend-to-class(.))), .) + case element(epigraph) return + epub:block($config, ., ("tei-epigraph", css:map-rend-to-class(.)), .) + case element(pb) return + if (@facs) then + (: Use the url from the facs attribute to link with IIIF image :) + html:webcomponent($config, ., ("tei-pb1", css:map-rend-to-class(.)), ., 'pb-facs-link', map {"facs": @facs, "label": @n, "emit": 'transcription'}) + else + if (starts-with(@facs, 'iiif:')) then + (: If facs attribute starts with iiif prefix, use the trailing part as a link to the IIIF image :) + html:webcomponent($config, ., ("tei-pb2", css:map-rend-to-class(.)), ., 'pb-facs-link', map {"facs": replace(@facs, '^iiif:(.*)$', '$1'), "label": 'Page', "emit": 'transcription'}) + else + epub:break($config, ., css:get-rendition(., ("tei-pb3", css:map-rend-to-class(.))), ., 'page', (concat(if(@n) then concat(@n,' ') else '',if(@facs) then concat('@',@facs) else ''))) + case element(docTitle) return + epub:block($config, ., css:get-rendition(., ("tei-docTitle", css:map-rend-to-class(.))), .) + case element(lb) return + epub:break($config, ., css:get-rendition(., ("tei-lb", css:map-rend-to-class(.))), ., 'line', @n) + case element(anchor) return + html:anchor($config, ., ("tei-anchor", css:map-rend-to-class(.)), ., @xml:id) + case element(TEI) return + html:document($config, ., ("tei-TEI", css:map-rend-to-class(.)), .) + case element(w) return + html:inline($config, ., ("tei-w", css:map-rend-to-class(.)), .) + case element(stage) return + epub:block($config, ., ("tei-stage", css:map-rend-to-class(.)), .) + case element(titlePage) return + epub:block($config, ., css:get-rendition(., ("tei-titlePage", css:map-rend-to-class(.))), .) + case element(name) return + (: delete me after testing :) + html:inline($config, ., ("tei-name", css:map-rend-to-class(.)), (given-names,surname)) + case element(formula) return + if (@rendition='simple:display') then + epub:block($config, ., ("tei-formula1", css:map-rend-to-class(.)), .) + else + if (@rend='display') then + html:webcomponent($config, ., ("tei-formula4", css:map-rend-to-class(.)), ., 'pb-formula', map {"display": true()}) + else + html:webcomponent($config, ., ("tei-formula5", css:map-rend-to-class(.)), ., 'pb-formula', map {}) + case element(front) return + epub:block($config, ., ("tei-front", css:map-rend-to-class(.)), .) + case element(lg) return + epub:block($config, ., ("tei-lg", css:map-rend-to-class(.)), .) + case element(choice) return + if (sic and corr) then + epub:alternate($config, ., ("tei-choice1", css:map-rend-to-class(.)), ., corr[1], sic[1]) + else + if (abbr and expan) then + epub:alternate($config, ., ("tei-choice2", css:map-rend-to-class(.)), ., expan[1], abbr[1]) + else + if (orig and reg) then + epub:alternate($config, ., ("tei-choice3", css:map-rend-to-class(.)), ., reg[1], orig[1]) + else + $config?apply($config, ./node()) + case element(publicationStmt) return + epub:block($config, ., ("tei-publicationStmt1", css:map-rend-to-class(.)), availability/licence) + case element(hi) return + html:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) + case element(role) return + epub:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) + case element(code) return + html:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) + case element(note) return + html:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) + case element(dateline) return + epub:block($config, ., ("tei-dateline", css:map-rend-to-class(.)), .) + case element(postscript) return + epub:block($config, ., ("tei-postscript", css:map-rend-to-class(.)), .) + case element(back) return + epub:block($config, ., ("tei-back", css:map-rend-to-class(.)), .) + case element(edition) return + if (ancestor::teiHeader) then + epub:block($config, ., ("tei-edition", css:map-rend-to-class(.)), .) + else + $config?apply($config, ./node()) + case element(del) return + html:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) + case element(cell) return + (: Insert table cell. :) + html:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) + case element(div) return + if (@type='title_page') then + epub:block($config, ., ("tei-div1", css:map-rend-to-class(.)), .) + else + if (parent::body or parent::front or parent::back) then + html:section($config, ., ("tei-div2", css:map-rend-to-class(.)), .) + else + epub:block($config, ., ("tei-div3", css:map-rend-to-class(.)), .) + case element(trailer) return + epub:block($config, ., ("tei-trailer", css:map-rend-to-class(.)), .) + case element(reg) return + html:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) + case element(graphic) return + html:graphic($config, ., ("tei-graphic", css:map-rend-to-class(.)), ., @url, @width, @height, @scale, desc) + case element(ref) return + if (@target) then + html:link($config, ., ("tei-ref1", css:map-rend-to-class(.)), ., @target, (), map {}) + else + if (not(node())) then + html:link($config, ., ("tei-ref2", css:map-rend-to-class(.)), @target, @target, (), map {}) + else + html:inline($config, ., ("tei-ref3", css:map-rend-to-class(.)), .) + case element(titlePart) return + epub:block($config, ., css:get-rendition(., ("tei-titlePart", css:map-rend-to-class(.))), .) + case element(ab) return + html:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) + case element(add) return + html:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) + case element(revisionDesc) return + html:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) + case element(subst) return + html:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) + case element(head) return + if ($parameters?header='short') then + html:inline($config, ., ("tei-head1", css:map-rend-to-class(.)), replace(string-join(.//text()[not(parent::ref)]), '^(.*?)[^\w]*$', '$1')) + else + if (parent::figure) then + epub:block($config, ., ("tei-head2", css:map-rend-to-class(.)), .) + else + if (parent::table) then + epub:block($config, ., ("tei-head3", css:map-rend-to-class(.)), .) + else + if (parent::lg) then + epub:block($config, ., ("tei-head4", css:map-rend-to-class(.)), .) + else + if (parent::list) then + epub:block($config, ., ("tei-head5", css:map-rend-to-class(.)), .) + else + if (parent::div) then + html:heading($config, ., ("tei-head6", css:map-rend-to-class(.)), ., count(ancestor::div)) + else + epub:block($config, ., ("tei-head7", css:map-rend-to-class(.)), .) + case element(roleDesc) return + epub:block($config, ., ("tei-roleDesc", css:map-rend-to-class(.)), .) + case element(opener) return + epub:block($config, ., ("tei-opener", css:map-rend-to-class(.)), .) + case element(speaker) return + epub:block($config, ., ("tei-speaker", css:map-rend-to-class(.)), .) + case element(castGroup) return + if (child::*) then + (: Insert list. :) + html:list($config, ., ("tei-castGroup", css:map-rend-to-class(.)), castItem|castGroup, ()) + else + $config?apply($config, ./node()) + case element(time) return + html:inline($config, ., ("tei-time", css:map-rend-to-class(.)), .) + case element(bibl) return + if (parent::listBibl) then + html:listItem($config, ., ("tei-bibl1", css:map-rend-to-class(.)), ., ()) + else + html:inline($config, ., ("tei-bibl2", css:map-rend-to-class(.)), .) + case element(imprimatur) return + epub:block($config, ., ("tei-imprimatur", css:map-rend-to-class(.)), .) + case element(salute) return + if (parent::closer) then + html:inline($config, ., ("tei-salute1", css:map-rend-to-class(.)), .) + else + epub:block($config, ., ("tei-salute2", css:map-rend-to-class(.)), .) + case element(unclear) return + html:inline($config, ., ("tei-unclear", css:map-rend-to-class(.)), .) + case element(argument) return + epub:block($config, ., ("tei-argument", css:map-rend-to-class(.)), .) + case element(date) return + if (@when) then + epub:alternate($config, ., ("tei-date1", css:map-rend-to-class(.)), ., ., @when) + else + html:inline($config, ., ("tei-date2", css:map-rend-to-class(.)), .) + case element(title) return + if ($parameters?header='short') then + html:heading($config, ., ("tei-title1", css:map-rend-to-class(.)), ., 5) + else + if (parent::titleStmt/parent::fileDesc) then + ( + if (preceding-sibling::title) then + html:text($config, ., ("tei-title2", css:map-rend-to-class(.)), ' — ') + else + (), + html:inline($config, ., ("tei-title3", css:map-rend-to-class(.)), .) + ) + + else + if (not(@level) and parent::bibl) then + html:inline($config, ., ("tei-title4", css:map-rend-to-class(.)), .) + else + if (@level='m' or not(@level)) then + ( + html:inline($config, ., ("tei-title5", css:map-rend-to-class(.)), .), + if (ancestor::biblFull) then + html:text($config, ., ("tei-title6", css:map-rend-to-class(.)), ', ') + else + () + ) + + else + if (@level='s' or @level='j') then + ( + html:inline($config, ., ("tei-title7", css:map-rend-to-class(.)), .), + if (following-sibling::* and ( ancestor::biblFull)) then + html:text($config, ., ("tei-title8", css:map-rend-to-class(.)), ', ') + else + () + ) + + else + if (@level='u' or @level='a') then + ( + html:inline($config, ., ("tei-title9", css:map-rend-to-class(.)), .), + if (following-sibling::* and ( ancestor::biblFull)) then + html:text($config, ., ("tei-title10", css:map-rend-to-class(.)), '. ') + else + () + ) + + else + html:inline($config, ., ("tei-title11", css:map-rend-to-class(.)), .) + case element(corr) return + if (parent::choice and count(parent::*/*) gt 1) then + (: simple inline, if in parent choice. :) + html:inline($config, ., ("tei-corr1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-corr2", css:map-rend-to-class(.)), .) + case element(foreign) return + html:inline($config, ., ("tei-foreign", css:map-rend-to-class(.)), .) + case element(mei:mdiv) return + (: Single MEI mdiv needs to be wrapped to create complete MEI document :) let $params := map { - "label": @xml:id, + "data": let $title := root($parameters?root)//titleStmt/title let $data := {.} return serialize($data), "content": . } let $content := - model:template-cb($config, ., $params) + model:template-mei_mdiv($config, ., $params) return - epub:block(map:merge(($config, map:entry("template", true()))), ., ("tei-cb", css:map-rend-to-class(.)), $content) + html:pass-through(map:merge(($config, map:entry("template", true()))), ., ("tei-mei_mdiv", css:map-rend-to-class(.)), $content) + case element(cit) return + if (child::quote and child::bibl) then + (: Insert citation :) + html:cit($config, ., ("tei-cit", css:map-rend-to-class(.)), ., ()) + else + $config?apply($config, ./node()) + case element(sic) return + if (parent::choice and count(parent::*/*) gt 1) then + html:inline($config, ., ("tei-sic1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-sic2", css:map-rend-to-class(.)), .) + case element(fileDesc) return + if ($parameters?header='short') then + ( + epub:block($config, ., ("tei-fileDesc1", "header-short", css:map-rend-to-class(.)), titleStmt), + epub:block($config, ., ("tei-fileDesc2", "header-short", css:map-rend-to-class(.)), editionStmt), + epub:block($config, ., ("tei-fileDesc3", "header-short", css:map-rend-to-class(.)), publicationStmt), + (: Output abstract containing demo description :) + epub:block($config, ., ("tei-fileDesc4", "sample-description", css:map-rend-to-class(.)), ../profileDesc/abstract) + ) + + else + html:title($config, ., ("tei-fileDesc5", css:map-rend-to-class(.)), titleStmt) + case element(titleStmt) return + if ($parameters?mode='title') then + html:heading($config, ., ("tei-titleStmt3", css:map-rend-to-class(.)), title[not(@type)], 5) + else + if ($parameters?header='short') then + ( + html:link($config, ., ("tei-titleStmt4", css:map-rend-to-class(.)), title[1], $parameters?doc, (), map {}), + epub:block($config, ., ("tei-titleStmt5", css:map-rend-to-class(.)), subsequence(title, 2)), + epub:block($config, ., ("tei-titleStmt6", css:map-rend-to-class(.)), author) + ) + + else + epub:block($config, ., ("tei-titleStmt7", css:map-rend-to-class(.)), .) + case element(body) return + ( + html:index($config, ., ("tei-body1", css:map-rend-to-class(.)), 'toc', .), + epub:block($config, ., ("tei-body2", css:map-rend-to-class(.)), .) + ) + + case element(spGrp) return + epub:block($config, ., ("tei-spGrp", css:map-rend-to-class(.)), .) + case element(fw) return + if (ancestor::p or ancestor::ab) then + html:inline($config, ., ("tei-fw1", css:map-rend-to-class(.)), .) + else + epub:block($config, ., ("tei-fw2", css:map-rend-to-class(.)), .) + case element(encodingDesc) return + html:omit($config, ., ("tei-encodingDesc", css:map-rend-to-class(.)), .) + case element(gap) return + if (desc) then + html:inline($config, ., ("tei-gap1", css:map-rend-to-class(.)), .) + else + if (@extent) then + html:inline($config, ., ("tei-gap2", css:map-rend-to-class(.)), @extent) + else + html:inline($config, ., ("tei-gap3", css:map-rend-to-class(.)), .) + case element(quote) return + if (ancestor::p) then + (: If it is inside a paragraph then it is inline, otherwise it is block level :) + html:inline($config, ., css:get-rendition(., ("tei-quote1", css:map-rend-to-class(.))), .) + else + (: If it is inside a paragraph then it is inline, otherwise it is block level :) + epub:block($config, ., css:get-rendition(., ("tei-quote2", css:map-rend-to-class(.))), .) + case element(notatedMusic) return + html:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) + case element(seg) return + html:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) + case element(profileDesc) return + html:omit($config, ., ("tei-profileDesc", css:map-rend-to-class(.)), .) + case element(row) return + if (@role='label') then + html:row($config, ., ("tei-row1", css:map-rend-to-class(.)), .) + else + (: Insert table row. :) + html:row($config, ., ("tei-row2", css:map-rend-to-class(.)), .) + case element(floatingText) return + epub:block($config, ., ("tei-floatingText", css:map-rend-to-class(.)), .) + case element(text) return + html:body($config, ., ("tei-text", css:map-rend-to-class(.)), .) + case element(byline) return + epub:block($config, ., ("tei-byline", css:map-rend-to-class(.)), .) + case element(sp) return + epub:block($config, ., ("tei-sp", css:map-rend-to-class(.)), .) + case element(table) return + html:table($config, ., ("tei-table", css:map-rend-to-class(.)), .) + case element(cb) return + epub:break($config, ., ("tei-cb", css:map-rend-to-class(.)), ., 'column', @n) + case element(group) return + epub:block($config, ., ("tei-group", css:map-rend-to-class(.)), .) case element(exist:match) return html:match($config, ., .) case element() return diff --git a/src/teipb/transform/parzival-verse-fo.xql b/src/teipb/transform/parzival-verse-fo.xql index 5c5e2d00..4f1a9d3f 100644 --- a/src/teipb/transform/parzival-verse-fo.xql +++ b/src/teipb/transform/parzival-verse-fo.xql @@ -11,6 +11,8 @@ declare default element namespace "http://www.tei-c.org/ns/1.0"; declare namespace xhtml='http://www.w3.org/1999/xhtml'; +declare namespace mei='http://www.music-encoding.org/ns/mei'; + declare namespace pb='http://teipublisher.com/1.0'; import module namespace css="http://www.tei-c.org/tei-simple/xquery/css"; @@ -23,9 +25,15 @@ import module namespace global="http://www.tei-c.org/tei-simple/config" at "../m declare %private function model:template-l($config as map(*), $node as node()*, $params as map(*)) { {$config?apply-children($config, $node, $params?id)}{$config?apply-children($config, $node, $params?content)}/* }; -(: generated template function for element spec: cb :) -declare %private function model:template-cb($config as map(*), $node as node()*, $params as map(*)) { -

Spalte: {$config?apply-children($config, $node, $params?label)}

/* +(: generated template function for element spec: ptr :) +declare %private function model:template-ptr($config as map(*), $node as node()*, $params as map(*)) { + + Original Clefs + /* +}; +(: generated template function for element spec: mei:mdiv :) +declare %private function model:template-mei_mdiv($config as map(*), $node as node()*, $params as map(*)) { + /* }; (:~ @@ -68,6 +76,56 @@ declare function model:apply($config as map(*), $input as node()*) { . return typeswitch(.) + case element(licence) return + fo:omit($config, ., ("tei-licence2", css:map-rend-to-class(.)), .) + case element(castItem) return + (: Insert item, rendered as described in parent list rendition. :) + fo:listItem($config, ., ("tei-castItem", css:map-rend-to-class(.)), ., ()) + case element(listBibl) return + if (bibl) then + fo:list($config, ., ("tei-listBibl1", css:map-rend-to-class(.)), ., ()) + else + fo:block($config, ., ("tei-listBibl2", css:map-rend-to-class(.)), .) + case element(item) return + fo:listItem($config, ., ("tei-item", css:map-rend-to-class(.)), ., ()) + case element(figure) return + if (head or @rendition='simple:display') then + fo:block($config, ., ("tei-figure1", css:map-rend-to-class(.)), .) + else + fo:inline($config, ., ("tei-figure2", css:map-rend-to-class(.)), .) + case element(teiHeader) return + fo:omit($config, ., ("tei-teiHeader2", css:map-rend-to-class(.)), .) + case element(g) return + if (not(text())) then + fo:glyph($config, ., ("tei-g1", css:map-rend-to-class(.)), .) + else + fo:inline($config, ., ("tei-g2", css:map-rend-to-class(.)), .) + case element(supplied) return + if (parent::choice) then + fo:inline($config, ., ("tei-supplied1", css:map-rend-to-class(.)), .) + else + if (@reason='damage') then + fo:inline($config, ., ("tei-supplied2", css:map-rend-to-class(.)), .) + else + if (@reason='illegible' or not(@reason)) then + fo:inline($config, ., ("tei-supplied3", css:map-rend-to-class(.)), .) + else + if (@reason='omitted') then + fo:inline($config, ., ("tei-supplied4", css:map-rend-to-class(.)), .) + else + fo:inline($config, ., ("tei-supplied5", css:map-rend-to-class(.)), .) + case element(author) return + if (ancestor::teiHeader) then + fo:block($config, ., ("tei-author1", css:map-rend-to-class(.)), .) + else + fo:inline($config, ., ("tei-author2", css:map-rend-to-class(.)), .) + case element(castList) return + if (child::*) then + fo:list($config, ., css:get-rendition(., ("tei-castList", css:map-rend-to-class(.))), castItem, ()) + else + $config?apply($config, ./node()) + case element(milestone) return + fo:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) case element(l) return let $params := map { @@ -79,17 +137,353 @@ declare function model:apply($config as map(*), $input as node()*) { model:template-l($config, ., $params) return fo:block(map:merge(($config, map:entry("template", true()))), ., css:get-rendition(., ("tei-l", "line", css:map-rend-to-class(.))), $content) - case element(cb) return + case element(closer) return + fo:block($config, ., ("tei-closer", css:map-rend-to-class(.)), .) + case element(ptr) return + if (parent::notatedMusic) then + (: Load and display external MEI :) + let $params := + map { + "url": @target, + "content": . + } + + let $content := + model:template-ptr($config, ., $params) + return + fo:pass-through(map:merge(($config, map:entry("template", true()))), ., ("tei-ptr", css:map-rend-to-class(.)), $content) + else + $config?apply($config, ./node()) + case element(signed) return + if (parent::closer) then + fo:block($config, ., ("tei-signed1", css:map-rend-to-class(.)), .) + else + fo:inline($config, ., ("tei-signed2", css:map-rend-to-class(.)), .) + case element(list) return + fo:list($config, ., css:get-rendition(., ("tei-list", css:map-rend-to-class(.))), item, ()) + case element(p) return + fo:paragraph($config, ., css:get-rendition(., ("tei-p2", css:map-rend-to-class(.))), .) + case element(q) return + if (l) then + fo:block($config, ., css:get-rendition(., ("tei-q1", css:map-rend-to-class(.))), .) + else + if (ancestor::p or ancestor::cell) then + fo:inline($config, ., css:get-rendition(., ("tei-q2", css:map-rend-to-class(.))), .) + else + fo:block($config, ., css:get-rendition(., ("tei-q3", css:map-rend-to-class(.))), .) + case element(epigraph) return + fo:block($config, ., ("tei-epigraph", css:map-rend-to-class(.)), .) + case element(pb) return + if (@facs) then + (: No function found for behavior: webcomponent :) + $config?apply($config, ./node()) + else + if (starts-with(@facs, 'iiif:')) then + (: No function found for behavior: webcomponent :) + $config?apply($config, ./node()) + else + fo:break($config, ., css:get-rendition(., ("tei-pb3", css:map-rend-to-class(.))), ., 'page', (concat(if(@n) then concat(@n,' ') else '',if(@facs) then concat('@',@facs) else ''))) + case element(docTitle) return + fo:block($config, ., css:get-rendition(., ("tei-docTitle", css:map-rend-to-class(.))), .) + case element(lb) return + fo:break($config, ., css:get-rendition(., ("tei-lb", css:map-rend-to-class(.))), ., 'line', @n) + case element(anchor) return + fo:anchor($config, ., ("tei-anchor", css:map-rend-to-class(.)), ., @xml:id) + case element(TEI) return + fo:document($config, ., ("tei-TEI", css:map-rend-to-class(.)), .) + case element(w) return + fo:inline($config, ., ("tei-w", css:map-rend-to-class(.)), .) + case element(stage) return + fo:block($config, ., ("tei-stage", css:map-rend-to-class(.)), .) + case element(titlePage) return + fo:block($config, ., css:get-rendition(., ("tei-titlePage", css:map-rend-to-class(.))), .) + case element(name) return + (: delete me after testing :) + fo:inline($config, ., ("tei-name", css:map-rend-to-class(.)), (given-names,surname)) + case element(formula) return + if (@rendition='simple:display') then + fo:block($config, ., ("tei-formula1", css:map-rend-to-class(.)), .) + else + if (@rend='display') then + (: No function found for behavior: webcomponent :) + $config?apply($config, ./node()) + else + (: No function found for behavior: webcomponent :) + $config?apply($config, ./node()) + case element(front) return + fo:block($config, ., ("tei-front", css:map-rend-to-class(.)), .) + case element(lg) return + fo:block($config, ., ("tei-lg", css:map-rend-to-class(.)), .) + case element(choice) return + if (sic and corr) then + fo:alternate($config, ., ("tei-choice1", css:map-rend-to-class(.)), ., corr[1], sic[1]) + else + if (abbr and expan) then + fo:alternate($config, ., ("tei-choice2", css:map-rend-to-class(.)), ., expan[1], abbr[1]) + else + if (orig and reg) then + fo:alternate($config, ., ("tei-choice3", css:map-rend-to-class(.)), ., reg[1], orig[1]) + else + $config?apply($config, ./node()) + case element(publicationStmt) return + fo:omit($config, ., ("tei-publicationStmt2", css:map-rend-to-class(.)), .) + case element(hi) return + fo:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) + case element(role) return + fo:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) + case element(code) return + fo:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) + case element(note) return + fo:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) + case element(dateline) return + fo:block($config, ., ("tei-dateline", css:map-rend-to-class(.)), .) + case element(postscript) return + fo:block($config, ., ("tei-postscript", css:map-rend-to-class(.)), .) + case element(back) return + fo:block($config, ., ("tei-back", css:map-rend-to-class(.)), .) + case element(edition) return + if (ancestor::teiHeader) then + fo:block($config, ., ("tei-edition", css:map-rend-to-class(.)), .) + else + $config?apply($config, ./node()) + case element(del) return + fo:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) + case element(cell) return + (: Insert table cell. :) + fo:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) + case element(div) return + if (@type='title_page') then + fo:block($config, ., ("tei-div1", css:map-rend-to-class(.)), .) + else + if (parent::body or parent::front or parent::back) then + fo:section($config, ., ("tei-div2", css:map-rend-to-class(.)), .) + else + fo:block($config, ., ("tei-div3", css:map-rend-to-class(.)), .) + case element(trailer) return + fo:block($config, ., ("tei-trailer", css:map-rend-to-class(.)), .) + case element(reg) return + fo:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) + case element(graphic) return + fo:graphic($config, ., ("tei-graphic", css:map-rend-to-class(.)), ., @url, @width, @height, @scale, desc) + case element(ref) return + if (@target) then + fo:link($config, ., ("tei-ref1", css:map-rend-to-class(.)), ., @target, map {}) + else + if (not(node())) then + fo:link($config, ., ("tei-ref2", css:map-rend-to-class(.)), @target, @target, map {}) + else + fo:inline($config, ., ("tei-ref3", css:map-rend-to-class(.)), .) + case element(titlePart) return + fo:block($config, ., css:get-rendition(., ("tei-titlePart", css:map-rend-to-class(.))), .) + case element(ab) return + fo:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) + case element(add) return + fo:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) + case element(revisionDesc) return + fo:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) + case element(subst) return + fo:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) + case element(head) return + if ($parameters?header='short') then + fo:inline($config, ., ("tei-head1", css:map-rend-to-class(.)), replace(string-join(.//text()[not(parent::ref)]), '^(.*?)[^\w]*$', '$1')) + else + if (parent::figure) then + fo:block($config, ., ("tei-head2", css:map-rend-to-class(.)), .) + else + if (parent::table) then + fo:block($config, ., ("tei-head3", css:map-rend-to-class(.)), .) + else + if (parent::lg) then + fo:block($config, ., ("tei-head4", css:map-rend-to-class(.)), .) + else + if (parent::list) then + fo:block($config, ., ("tei-head5", css:map-rend-to-class(.)), .) + else + if (parent::div) then + fo:heading($config, ., ("tei-head6", css:map-rend-to-class(.)), ., count(ancestor::div)) + else + fo:block($config, ., ("tei-head7", css:map-rend-to-class(.)), .) + case element(roleDesc) return + fo:block($config, ., ("tei-roleDesc", css:map-rend-to-class(.)), .) + case element(opener) return + fo:block($config, ., ("tei-opener", css:map-rend-to-class(.)), .) + case element(speaker) return + fo:block($config, ., ("tei-speaker", css:map-rend-to-class(.)), .) + case element(castGroup) return + if (child::*) then + (: Insert list. :) + fo:list($config, ., ("tei-castGroup", css:map-rend-to-class(.)), castItem|castGroup, ()) + else + $config?apply($config, ./node()) + case element(time) return + fo:inline($config, ., ("tei-time", css:map-rend-to-class(.)), .) + case element(bibl) return + if (parent::listBibl) then + fo:listItem($config, ., ("tei-bibl1", css:map-rend-to-class(.)), ., ()) + else + fo:inline($config, ., ("tei-bibl2", css:map-rend-to-class(.)), .) + case element(imprimatur) return + fo:block($config, ., ("tei-imprimatur", css:map-rend-to-class(.)), .) + case element(salute) return + if (parent::closer) then + fo:inline($config, ., ("tei-salute1", css:map-rend-to-class(.)), .) + else + fo:block($config, ., ("tei-salute2", css:map-rend-to-class(.)), .) + case element(unclear) return + fo:inline($config, ., ("tei-unclear", css:map-rend-to-class(.)), .) + case element(argument) return + fo:block($config, ., ("tei-argument", css:map-rend-to-class(.)), .) + case element(date) return + fo:inline($config, ., ("tei-date2", css:map-rend-to-class(.)), .) + case element(title) return + if ($parameters?header='short') then + fo:heading($config, ., ("tei-title1", css:map-rend-to-class(.)), ., 5) + else + if (parent::titleStmt/parent::fileDesc) then + ( + if (preceding-sibling::title) then + fo:text($config, ., ("tei-title2", css:map-rend-to-class(.)), ' — ') + else + (), + fo:inline($config, ., ("tei-title3", css:map-rend-to-class(.)), .) + ) + + else + if (not(@level) and parent::bibl) then + fo:inline($config, ., ("tei-title4", css:map-rend-to-class(.)), .) + else + if (@level='m' or not(@level)) then + ( + fo:inline($config, ., ("tei-title5", css:map-rend-to-class(.)), .), + if (ancestor::biblFull) then + fo:text($config, ., ("tei-title6", css:map-rend-to-class(.)), ', ') + else + () + ) + + else + if (@level='s' or @level='j') then + ( + fo:inline($config, ., ("tei-title7", css:map-rend-to-class(.)), .), + if (following-sibling::* and ( ancestor::biblFull)) then + fo:text($config, ., ("tei-title8", css:map-rend-to-class(.)), ', ') + else + () + ) + + else + if (@level='u' or @level='a') then + ( + fo:inline($config, ., ("tei-title9", css:map-rend-to-class(.)), .), + if (following-sibling::* and ( ancestor::biblFull)) then + fo:text($config, ., ("tei-title10", css:map-rend-to-class(.)), '. ') + else + () + ) + + else + fo:inline($config, ., ("tei-title11", css:map-rend-to-class(.)), .) + case element(corr) return + if (parent::choice and count(parent::*/*) gt 1) then + (: simple inline, if in parent choice. :) + fo:inline($config, ., ("tei-corr1", css:map-rend-to-class(.)), .) + else + fo:inline($config, ., ("tei-corr2", css:map-rend-to-class(.)), .) + case element(foreign) return + fo:inline($config, ., ("tei-foreign", css:map-rend-to-class(.)), .) + case element(mei:mdiv) return + (: Single MEI mdiv needs to be wrapped to create complete MEI document :) let $params := map { - "label": @xml:id, + "data": let $title := root($parameters?root)//titleStmt/title let $data := {.} return serialize($data), "content": . } let $content := - model:template-cb($config, ., $params) + model:template-mei_mdiv($config, ., $params) return - fo:block(map:merge(($config, map:entry("template", true()))), ., ("tei-cb", css:map-rend-to-class(.)), $content) + fo:pass-through(map:merge(($config, map:entry("template", true()))), ., ("tei-mei_mdiv", css:map-rend-to-class(.)), $content) + case element(cit) return + if (child::quote and child::bibl) then + (: Insert citation :) + fo:cit($config, ., ("tei-cit", css:map-rend-to-class(.)), ., ()) + else + $config?apply($config, ./node()) + case element(sic) return + if (parent::choice and count(parent::*/*) gt 1) then + fo:inline($config, ., ("tei-sic1", css:map-rend-to-class(.)), .) + else + fo:inline($config, ., ("tei-sic2", css:map-rend-to-class(.)), .) + case element(fileDesc) return + if ($parameters?header='short') then + ( + fo:block($config, ., ("tei-fileDesc1", "header-short", css:map-rend-to-class(.)), titleStmt), + fo:block($config, ., ("tei-fileDesc2", "header-short", css:map-rend-to-class(.)), editionStmt), + fo:block($config, ., ("tei-fileDesc3", "header-short", css:map-rend-to-class(.)), publicationStmt), + (: Output abstract containing demo description :) + fo:block($config, ., ("tei-fileDesc4", "sample-description", css:map-rend-to-class(.)), ../profileDesc/abstract) + ) + + else + fo:title($config, ., ("tei-fileDesc5", css:map-rend-to-class(.)), titleStmt) + case element(titleStmt) return + fo:heading($config, ., ("tei-titleStmt2", css:map-rend-to-class(.)), ., ()) + case element(body) return + ( + fo:index($config, ., ("tei-body1", css:map-rend-to-class(.)), ., 'toc'), + fo:block($config, ., ("tei-body2", css:map-rend-to-class(.)), .) + ) + + case element(spGrp) return + fo:block($config, ., ("tei-spGrp", css:map-rend-to-class(.)), .) + case element(fw) return + if (ancestor::p or ancestor::ab) then + fo:inline($config, ., ("tei-fw1", css:map-rend-to-class(.)), .) + else + fo:block($config, ., ("tei-fw2", css:map-rend-to-class(.)), .) + case element(encodingDesc) return + fo:omit($config, ., ("tei-encodingDesc", css:map-rend-to-class(.)), .) + case element(gap) return + if (desc) then + fo:inline($config, ., ("tei-gap1", css:map-rend-to-class(.)), .) + else + if (@extent) then + fo:inline($config, ., ("tei-gap2", css:map-rend-to-class(.)), @extent) + else + fo:inline($config, ., ("tei-gap3", css:map-rend-to-class(.)), .) + case element(quote) return + if (ancestor::p) then + (: If it is inside a paragraph then it is inline, otherwise it is block level :) + fo:inline($config, ., css:get-rendition(., ("tei-quote1", css:map-rend-to-class(.))), .) + else + (: If it is inside a paragraph then it is inline, otherwise it is block level :) + fo:block($config, ., css:get-rendition(., ("tei-quote2", css:map-rend-to-class(.))), .) + case element(notatedMusic) return + fo:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) + case element(seg) return + fo:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) + case element(profileDesc) return + fo:omit($config, ., ("tei-profileDesc", css:map-rend-to-class(.)), .) + case element(row) return + if (@role='label') then + fo:row($config, ., ("tei-row1", css:map-rend-to-class(.)), .) + else + (: Insert table row. :) + fo:row($config, ., ("tei-row2", css:map-rend-to-class(.)), .) + case element(floatingText) return + fo:block($config, ., ("tei-floatingText", css:map-rend-to-class(.)), .) + case element(text) return + fo:body($config, ., ("tei-text", css:map-rend-to-class(.)), .) + case element(byline) return + fo:block($config, ., ("tei-byline", css:map-rend-to-class(.)), .) + case element(sp) return + fo:block($config, ., ("tei-sp", css:map-rend-to-class(.)), .) + case element(table) return + fo:table($config, ., ("tei-table", css:map-rend-to-class(.)), .) + case element(cb) return + fo:break($config, ., ("tei-cb", css:map-rend-to-class(.)), ., 'column', @n) + case element(group) return + fo:block($config, ., ("tei-group", css:map-rend-to-class(.)), .) case element() return if (namespace-uri(.) = 'http://www.tei-c.org/ns/1.0') then $config?apply($config, ./node()) diff --git a/src/teipb/transform/parzival-verse-inline-epub.xql b/src/teipb/transform/parzival-verse-inline-epub.xql index 8f127167..bd8c164d 100644 --- a/src/teipb/transform/parzival-verse-inline-epub.xql +++ b/src/teipb/transform/parzival-verse-inline-epub.xql @@ -132,6 +132,8 @@ declare function model:apply($config as map(*), $input as node()*) { html:list($config, ., css:get-rendition(., ("tei-castList", css:map-rend-to-class(.))), castItem, ()) else $config?apply($config, ./node()) + case element(milestone) return + html:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) case element(l) return let $params := map { @@ -232,13 +234,13 @@ declare function model:apply($config as map(*), $input as node()*) { case element(publicationStmt) return epub:block($config, ., ("tei-publicationStmt1", css:map-rend-to-class(.)), availability/licence) case element(hi) return - html:inline($config, ., css:get-rendition(., ("tei-hi", css:map-rend-to-class(.))), .) + html:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) case element(role) return epub:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) case element(code) return html:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) case element(note) return - epub:note($config, ., ("tei-note", css:map-rend-to-class(.)), ., @place, @n) + html:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) case element(dateline) return epub:block($config, ., ("tei-dateline", css:map-rend-to-class(.)), .) case element(postscript) return @@ -251,7 +253,7 @@ declare function model:apply($config as map(*), $input as node()*) { else $config?apply($config, ./node()) case element(del) return - html:inline($config, ., ("tei-del", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) case element(cell) return (: Insert table cell. :) html:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) @@ -265,6 +267,8 @@ declare function model:apply($config as map(*), $input as node()*) { epub:block($config, ., ("tei-div3", css:map-rend-to-class(.)), .) case element(trailer) return epub:block($config, ., ("tei-trailer", css:map-rend-to-class(.)), .) + case element(reg) return + html:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) case element(graphic) return html:graphic($config, ., ("tei-graphic", css:map-rend-to-class(.)), ., @url, @width, @height, @scale, desc) case element(ref) return @@ -280,9 +284,11 @@ declare function model:apply($config as map(*), $input as node()*) { case element(ab) return html:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) case element(add) return - html:inline($config, ., ("tei-add", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) case element(revisionDesc) return html:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) + case element(subst) return + html:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) case element(head) return if ($parameters?header='short') then html:inline($config, ., ("tei-head1", css:map-rend-to-class(.)), replace(string-join(.//text()[not(parent::ref)]), '^(.*?)[^\w]*$', '$1')) @@ -475,7 +481,7 @@ declare function model:apply($config as map(*), $input as node()*) { case element(notatedMusic) return html:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) case element(seg) return - html:inline($config, ., ("tei-seg1", "glory-initial", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) case element(profileDesc) return html:omit($config, ., ("tei-profileDesc", css:map-rend-to-class(.)), .) case element(row) return diff --git a/src/teipb/transform/parzival-verse-inline-fo.xql b/src/teipb/transform/parzival-verse-inline-fo.xql index 22b95160..7a8ef028 100644 --- a/src/teipb/transform/parzival-verse-inline-fo.xql +++ b/src/teipb/transform/parzival-verse-inline-fo.xql @@ -124,6 +124,8 @@ declare function model:apply($config as map(*), $input as node()*) { fo:list($config, ., css:get-rendition(., ("tei-castList", css:map-rend-to-class(.))), castItem, ()) else $config?apply($config, ./node()) + case element(milestone) return + fo:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) case element(l) return let $params := map { @@ -226,13 +228,13 @@ declare function model:apply($config as map(*), $input as node()*) { case element(publicationStmt) return fo:omit($config, ., ("tei-publicationStmt2", css:map-rend-to-class(.)), .) case element(hi) return - fo:inline($config, ., css:get-rendition(., ("tei-hi", css:map-rend-to-class(.))), .) + fo:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) case element(role) return fo:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) case element(code) return fo:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) case element(note) return - fo:note($config, ., ("tei-note", css:map-rend-to-class(.)), ., @place, @n) + fo:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) case element(dateline) return fo:block($config, ., ("tei-dateline", css:map-rend-to-class(.)), .) case element(postscript) return @@ -245,7 +247,7 @@ declare function model:apply($config as map(*), $input as node()*) { else $config?apply($config, ./node()) case element(del) return - fo:inline($config, ., ("tei-del", css:map-rend-to-class(.)), .) + fo:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) case element(cell) return (: Insert table cell. :) fo:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) @@ -259,6 +261,8 @@ declare function model:apply($config as map(*), $input as node()*) { fo:block($config, ., ("tei-div3", css:map-rend-to-class(.)), .) case element(trailer) return fo:block($config, ., ("tei-trailer", css:map-rend-to-class(.)), .) + case element(reg) return + fo:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) case element(graphic) return fo:graphic($config, ., ("tei-graphic", css:map-rend-to-class(.)), ., @url, @width, @height, @scale, desc) case element(ref) return @@ -274,9 +278,11 @@ declare function model:apply($config as map(*), $input as node()*) { case element(ab) return fo:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) case element(add) return - fo:inline($config, ., ("tei-add", css:map-rend-to-class(.)), .) + fo:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) case element(revisionDesc) return fo:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) + case element(subst) return + fo:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) case element(head) return if ($parameters?header='short') then fo:inline($config, ., ("tei-head1", css:map-rend-to-class(.)), replace(string-join(.//text()[not(parent::ref)]), '^(.*?)[^\w]*$', '$1')) @@ -455,7 +461,7 @@ declare function model:apply($config as map(*), $input as node()*) { case element(notatedMusic) return fo:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) case element(seg) return - fo:inline($config, ., ("tei-seg1", "glory-initial", css:map-rend-to-class(.)), .) + fo:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) case element(profileDesc) return fo:omit($config, ., ("tei-profileDesc", css:map-rend-to-class(.)), .) case element(row) return diff --git a/src/teipb/transform/parzival-verse-inline-latex.xql b/src/teipb/transform/parzival-verse-inline-latex.xql index 71403267..9883e694 100644 --- a/src/teipb/transform/parzival-verse-inline-latex.xql +++ b/src/teipb/transform/parzival-verse-inline-latex.xql @@ -132,6 +132,8 @@ declare function model:apply($config as map(*), $input as node()*) { latex:list($config, ., css:get-rendition(., ("tei-castList", css:map-rend-to-class(.))), castItem, ()) else $config?apply($config, ./node()) + case element(milestone) return + latex:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) case element(l) return let $params := map { @@ -253,13 +255,13 @@ declare function model:apply($config as map(*), $input as node()*) { case element(publicationStmt) return latex:omit($config, ., ("tei-publicationStmt2", css:map-rend-to-class(.)), .) case element(hi) return - latex:inline($config, ., css:get-rendition(., ("tei-hi", css:map-rend-to-class(.))), .) + latex:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) case element(role) return latex:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) case element(code) return latex:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) case element(note) return - latex:note($config, ., ("tei-note", css:map-rend-to-class(.)), ., @place, @n) + latex:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) case element(dateline) return latex:block($config, ., ("tei-dateline", css:map-rend-to-class(.)), .) case element(postscript) return @@ -272,7 +274,7 @@ declare function model:apply($config as map(*), $input as node()*) { else $config?apply($config, ./node()) case element(del) return - latex:inline($config, ., ("tei-del", css:map-rend-to-class(.)), .) + latex:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) case element(cell) return (: Insert table cell. :) latex:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) @@ -286,6 +288,8 @@ declare function model:apply($config as map(*), $input as node()*) { latex:block($config, ., ("tei-div3", css:map-rend-to-class(.)), .) case element(trailer) return latex:block($config, ., ("tei-trailer", css:map-rend-to-class(.)), .) + case element(reg) return + latex:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) case element(graphic) return latex:graphic($config, ., ("tei-graphic", css:map-rend-to-class(.)), ., @url, @width, @height, @scale, desc) case element(ref) return @@ -301,9 +305,11 @@ declare function model:apply($config as map(*), $input as node()*) { case element(ab) return latex:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) case element(add) return - latex:inline($config, ., ("tei-add", css:map-rend-to-class(.)), .) + latex:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) case element(revisionDesc) return latex:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) + case element(subst) return + latex:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) case element(head) return if ($parameters?header='short') then latex:inline($config, ., ("tei-head1", css:map-rend-to-class(.)), replace(string-join(.//text()[not(parent::ref)]), '^(.*?)[^\w]*$', '$1')) @@ -483,7 +489,7 @@ declare function model:apply($config as map(*), $input as node()*) { case element(notatedMusic) return latex:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) case element(seg) return - latex:inline($config, ., ("tei-seg1", "glory-initial", css:map-rend-to-class(.)), .) + latex:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) case element(profileDesc) return latex:omit($config, ., ("tei-profileDesc", css:map-rend-to-class(.)), .) case element(row) return diff --git a/src/teipb/transform/parzival-verse-inline-print.xql b/src/teipb/transform/parzival-verse-inline-print.xql index 093e9bf2..a27d0e91 100644 --- a/src/teipb/transform/parzival-verse-inline-print.xql +++ b/src/teipb/transform/parzival-verse-inline-print.xql @@ -132,6 +132,8 @@ declare function model:apply($config as map(*), $input as node()*) { html:list($config, ., css:get-rendition(., ("tei-castList", css:map-rend-to-class(.))), castItem, ()) else $config?apply($config, ./node()) + case element(milestone) return + html:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) case element(l) return let $params := map { @@ -235,13 +237,13 @@ declare function model:apply($config as map(*), $input as node()*) { case element(publicationStmt) return html:block($config, ., ("tei-publicationStmt1", css:map-rend-to-class(.)), availability/licence) case element(hi) return - html:inline($config, ., css:get-rendition(., ("tei-hi", css:map-rend-to-class(.))), .) + html:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) case element(role) return html:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) case element(code) return html:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) case element(note) return - printcss:note($config, ., ("tei-note", css:map-rend-to-class(.)), ., @place, @n) + html:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) case element(dateline) return html:block($config, ., ("tei-dateline", css:map-rend-to-class(.)), .) case element(postscript) return @@ -254,7 +256,7 @@ declare function model:apply($config as map(*), $input as node()*) { else $config?apply($config, ./node()) case element(del) return - html:inline($config, ., ("tei-del", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) case element(cell) return (: Insert table cell. :) html:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) @@ -268,6 +270,8 @@ declare function model:apply($config as map(*), $input as node()*) { html:block($config, ., ("tei-div3", css:map-rend-to-class(.)), .) case element(trailer) return html:block($config, ., ("tei-trailer", css:map-rend-to-class(.)), .) + case element(reg) return + html:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) case element(graphic) return html:graphic($config, ., ("tei-graphic", css:map-rend-to-class(.)), ., @url, @width, @height, @scale, desc) case element(ref) return @@ -283,9 +287,11 @@ declare function model:apply($config as map(*), $input as node()*) { case element(ab) return html:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) case element(add) return - html:inline($config, ., ("tei-add", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) case element(revisionDesc) return html:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) + case element(subst) return + html:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) case element(head) return if ($parameters?header='short') then html:inline($config, ., ("tei-head1", css:map-rend-to-class(.)), replace(string-join(.//text()[not(parent::ref)]), '^(.*?)[^\w]*$', '$1')) @@ -478,7 +484,7 @@ declare function model:apply($config as map(*), $input as node()*) { case element(notatedMusic) return html:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) case element(seg) return - html:inline($config, ., ("tei-seg1", "glory-initial", css:map-rend-to-class(.)), .) + html:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) case element(profileDesc) return html:omit($config, ., ("tei-profileDesc", css:map-rend-to-class(.)), .) case element(row) return diff --git a/src/teipb/transform/parzival-verse-inline-web.xql b/src/teipb/transform/parzival-verse-inline-web.xql index d20eca42..8719dff3 100644 --- a/src/teipb/transform/parzival-verse-inline-web.xql +++ b/src/teipb/transform/parzival-verse-inline-web.xql @@ -130,6 +130,8 @@ declare function model:apply($config as map(*), $input as node()*) { html:list($config, ., css:get-rendition(., ("tei-castList", css:map-rend-to-class(.))), castItem, ()) => model:map($node, $trackIds) else $config?apply($config, ./node()) + case element(milestone) return + html:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(l) return let $params := map { @@ -230,13 +232,13 @@ declare function model:apply($config as map(*), $input as node()*) { case element(publicationStmt) return html:block($config, ., ("tei-publicationStmt1", css:map-rend-to-class(.)), availability/licence) => model:map($node, $trackIds) case element(hi) return - html:inline($config, ., css:get-rendition(., ("tei-hi", css:map-rend-to-class(.))), .) => model:map($node, $trackIds) + html:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(role) return html:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(code) return html:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(note) return - html:note($config, ., ("tei-note", css:map-rend-to-class(.)), ., @place, @n) => model:map($node, $trackIds) + html:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(dateline) return html:block($config, ., ("tei-dateline", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(postscript) return @@ -249,7 +251,7 @@ declare function model:apply($config as map(*), $input as node()*) { else $config?apply($config, ./node()) case element(del) return - html:inline($config, ., ("tei-del", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + html:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(cell) return (: Insert table cell. :) html:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) => model:map($node, $trackIds) @@ -263,6 +265,8 @@ declare function model:apply($config as map(*), $input as node()*) { html:block($config, ., ("tei-div3", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(trailer) return html:block($config, ., ("tei-trailer", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(reg) return + html:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(graphic) return html:graphic($config, ., ("tei-graphic", css:map-rend-to-class(.)), ., @url, @width, @height, @scale, desc) => model:map($node, $trackIds) case element(ref) return @@ -278,9 +282,11 @@ declare function model:apply($config as map(*), $input as node()*) { case element(ab) return html:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(add) return - html:inline($config, ., ("tei-add", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + html:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(revisionDesc) return html:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(subst) return + html:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(head) return if ($parameters?header='short') then html:inline($config, ., ("tei-head1", css:map-rend-to-class(.)), replace(string-join(.//text()[not(parent::ref)]), '^(.*?)[^\w]*$', '$1')) => model:map($node, $trackIds) @@ -473,7 +479,7 @@ declare function model:apply($config as map(*), $input as node()*) { case element(notatedMusic) return html:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) => model:map($node, $trackIds) case element(seg) return - html:inline($config, ., ("tei-seg1", "glory-initial", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + html:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(profileDesc) return html:omit($config, ., ("tei-profileDesc", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(row) return diff --git a/src/teipb/transform/parzival-verse-inline.css b/src/teipb/transform/parzival-verse-inline.css index 79063938..86367097 100644 --- a/src/teipb/transform/parzival-verse-inline.css +++ b/src/teipb/transform/parzival-verse-inline.css @@ -64,13 +64,13 @@ .tei-docTitle { font-size: larger; } .tei-stage { font-style: italic; } .tei-titlePage { text-align: center; } -.tei-hi { font-style: italic; } +.tei-hi3 { font-style: italic; } .tei-code { font-family:monospace } .tei-edition:before { content: 'Edition: '; } -.tei-del { text-decoration: line-through; } +.tei-del2 { text-decoration: line-through; } .tei-div1 { border: 1px solid black; padding: 5px; } .tei-trailer { color: green; } -.tei-add { color: green; text-decoration: underline; } +.tei-add2 { color: green; text-decoration: underline; } .tei-head2 { font-style: italic; } .tei-head3 { font-style: italic; } .tei-head4 { font-style: italic; } @@ -94,6 +94,8 @@ .tei-quote1:before { content: '‘'; } .tei-quote1:after { content: '’'; } .tei-quote2 { margin-left: 10px; margin-right: 10px; } +.tei-seg8 { } +.tei-seg9 { } .tei-row1 { font-weight: bold; } .tei-floatingText { margin: 6pt; border: solid black 1pt; } .tei-table { font-size: smaller; background-color: #F0F0F0; } \ No newline at end of file diff --git a/src/teipb/transform/parzival-verse-latex.xql b/src/teipb/transform/parzival-verse-latex.xql index f96dd91b..fbc53878 100644 --- a/src/teipb/transform/parzival-verse-latex.xql +++ b/src/teipb/transform/parzival-verse-latex.xql @@ -11,6 +11,8 @@ declare default element namespace "http://www.tei-c.org/ns/1.0"; declare namespace xhtml='http://www.w3.org/1999/xhtml'; +declare namespace mei='http://www.music-encoding.org/ns/mei'; + declare namespace pb='http://teipublisher.com/1.0'; import module namespace css="http://www.tei-c.org/tei-simple/xquery/css"; @@ -23,9 +25,23 @@ import module namespace global="http://www.tei-c.org/tei-simple/config" at "../m declare %private function model:template-l($config as map(*), $node as node()*, $params as map(*)) { {$config?apply-children($config, $node, $params?id)}{$config?apply-children($config, $node, $params?content)}/* }; -(: generated template function for element spec: cb :) -declare %private function model:template-cb($config as map(*), $node as node()*, $params as map(*)) { -

Spalte: {$config?apply-children($config, $node, $params?label)}

/* +(: generated template function for element spec: ptr :) +declare %private function model:template-ptr($config as map(*), $node as node()*, $params as map(*)) { + + Original Clefs + /* +}; +(: generated template function for element spec: formula :) +declare %private function model:template-formula2($config as map(*), $node as node()*, $params as map(*)) { + ``[\begin{equation}`{string-join($config?apply-children($config, $node, $params?content))}`\end{equation}]`` +}; +(: generated template function for element spec: formula :) +declare %private function model:template-formula3($config as map(*), $node as node()*, $params as map(*)) { + ``[\begin{math}`{string-join($config?apply-children($config, $node, $params?content))}`\end{math}]`` +}; +(: generated template function for element spec: mei:mdiv :) +declare %private function model:template-mei_mdiv($config as map(*), $node as node()*, $params as map(*)) { + /* }; (:~ @@ -68,6 +84,56 @@ declare function model:apply($config as map(*), $input as node()*) { . return typeswitch(.) + case element(licence) return + latex:omit($config, ., ("tei-licence2", css:map-rend-to-class(.)), .) + case element(castItem) return + (: Insert item, rendered as described in parent list rendition. :) + latex:listItem($config, ., ("tei-castItem", css:map-rend-to-class(.)), ., ()) + case element(listBibl) return + if (bibl) then + latex:list($config, ., ("tei-listBibl1", css:map-rend-to-class(.)), ., ()) + else + latex:block($config, ., ("tei-listBibl2", css:map-rend-to-class(.)), .) + case element(item) return + latex:listItem($config, ., ("tei-item", css:map-rend-to-class(.)), ., ()) + case element(figure) return + if (head or @rendition='simple:display') then + latex:block($config, ., ("tei-figure1", css:map-rend-to-class(.)), .) + else + latex:inline($config, ., ("tei-figure2", css:map-rend-to-class(.)), .) + case element(teiHeader) return + latex:metadata($config, ., ("tei-teiHeader1", css:map-rend-to-class(.)), .) + case element(g) return + if (not(text())) then + latex:glyph($config, ., ("tei-g1", css:map-rend-to-class(.)), .) + else + latex:inline($config, ., ("tei-g2", css:map-rend-to-class(.)), .) + case element(supplied) return + if (parent::choice) then + latex:inline($config, ., ("tei-supplied1", css:map-rend-to-class(.)), .) + else + if (@reason='damage') then + latex:inline($config, ., ("tei-supplied2", css:map-rend-to-class(.)), .) + else + if (@reason='illegible' or not(@reason)) then + latex:inline($config, ., ("tei-supplied3", css:map-rend-to-class(.)), .) + else + if (@reason='omitted') then + latex:inline($config, ., ("tei-supplied4", css:map-rend-to-class(.)), .) + else + latex:inline($config, ., ("tei-supplied5", css:map-rend-to-class(.)), .) + case element(author) return + if (ancestor::teiHeader) then + latex:block($config, ., ("tei-author1", css:map-rend-to-class(.)), .) + else + latex:inline($config, ., ("tei-author2", css:map-rend-to-class(.)), .) + case element(castList) return + if (child::*) then + latex:list($config, ., css:get-rendition(., ("tei-castList", css:map-rend-to-class(.))), castItem, ()) + else + $config?apply($config, ./node()) + case element(milestone) return + latex:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) case element(l) return let $params := map { @@ -79,17 +145,373 @@ declare function model:apply($config as map(*), $input as node()*) { model:template-l($config, ., $params) return latex:block(map:merge(($config, map:entry("template", true()))), ., css:get-rendition(., ("tei-l", "line", css:map-rend-to-class(.))), $content) - case element(cb) return + case element(closer) return + latex:block($config, ., ("tei-closer", css:map-rend-to-class(.)), .) + case element(ptr) return + if (parent::notatedMusic) then + (: Load and display external MEI :) + let $params := + map { + "url": @target, + "content": . + } + + let $content := + model:template-ptr($config, ., $params) + return + latex:pass-through(map:merge(($config, map:entry("template", true()))), ., ("tei-ptr", css:map-rend-to-class(.)), $content) + else + $config?apply($config, ./node()) + case element(signed) return + if (parent::closer) then + latex:block($config, ., ("tei-signed1", css:map-rend-to-class(.)), .) + else + latex:inline($config, ., ("tei-signed2", css:map-rend-to-class(.)), .) + case element(list) return + latex:list($config, ., css:get-rendition(., ("tei-list", css:map-rend-to-class(.))), item, ()) + case element(p) return + latex:paragraph($config, ., css:get-rendition(., ("tei-p2", css:map-rend-to-class(.))), .) + case element(q) return + if (l) then + latex:block($config, ., css:get-rendition(., ("tei-q1", css:map-rend-to-class(.))), .) + else + if (ancestor::p or ancestor::cell) then + latex:inline($config, ., css:get-rendition(., ("tei-q2", css:map-rend-to-class(.))), .) + else + latex:block($config, ., css:get-rendition(., ("tei-q3", css:map-rend-to-class(.))), .) + case element(epigraph) return + latex:block($config, ., ("tei-epigraph", css:map-rend-to-class(.)), .) + case element(pb) return + if (@facs) then + (: No function found for behavior: webcomponent :) + $config?apply($config, ./node()) + else + if (starts-with(@facs, 'iiif:')) then + (: No function found for behavior: webcomponent :) + $config?apply($config, ./node()) + else + latex:break($config, ., css:get-rendition(., ("tei-pb3", css:map-rend-to-class(.))), ., 'page', (concat(if(@n) then concat(@n,' ') else '',if(@facs) then concat('@',@facs) else ''))) + case element(docTitle) return + latex:block($config, ., css:get-rendition(., ("tei-docTitle", css:map-rend-to-class(.))), .) + case element(lb) return + latex:break($config, ., css:get-rendition(., ("tei-lb", css:map-rend-to-class(.))), ., 'line', @n) + case element(anchor) return + latex:anchor($config, ., ("tei-anchor", css:map-rend-to-class(.)), ., @xml:id) + case element(TEI) return + latex:document($config, ., ("tei-TEI", css:map-rend-to-class(.)), .) + case element(w) return + latex:inline($config, ., ("tei-w", css:map-rend-to-class(.)), .) + case element(stage) return + latex:block($config, ., ("tei-stage", css:map-rend-to-class(.)), .) + case element(titlePage) return + latex:block($config, ., css:get-rendition(., ("tei-titlePage", css:map-rend-to-class(.))), .) + case element(name) return + (: delete me after testing :) + latex:inline($config, ., ("tei-name", css:map-rend-to-class(.)), (given-names,surname)) + case element(formula) return + if (@rendition='simple:display') then + latex:block($config, ., ("tei-formula1", css:map-rend-to-class(.)), .) + else + if (@rend="display") then + let $params := + map { + "content": string() + } + + let $content := + model:template-formula2($config, ., $params) + return + latex:inline(map:merge(($config, map:entry("template", true()))), ., ("tei-formula2", css:map-rend-to-class(.)), $content) + else + if (@rend='display') then + (: No function found for behavior: webcomponent :) + $config?apply($config, ./node()) + else + (: More than one model without predicate found for ident formula. Choosing first one. :) + let $params := + map { + "content": string() + } + + let $content := + model:template-formula3($config, ., $params) + return + latex:inline(map:merge(($config, map:entry("template", true()))), ., ("tei-formula3", css:map-rend-to-class(.)), $content) + case element(front) return + latex:block($config, ., ("tei-front", css:map-rend-to-class(.)), .) + case element(lg) return + latex:block($config, ., ("tei-lg", css:map-rend-to-class(.)), .) + case element(choice) return + if (sic and corr) then + latex:alternate($config, ., ("tei-choice1", css:map-rend-to-class(.)), ., corr[1], sic[1]) + else + if (abbr and expan) then + latex:alternate($config, ., ("tei-choice2", css:map-rend-to-class(.)), ., expan[1], abbr[1]) + else + if (orig and reg) then + latex:alternate($config, ., ("tei-choice3", css:map-rend-to-class(.)), ., reg[1], orig[1]) + else + $config?apply($config, ./node()) + case element(publicationStmt) return + latex:omit($config, ., ("tei-publicationStmt2", css:map-rend-to-class(.)), .) + case element(hi) return + latex:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) + case element(role) return + latex:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) + case element(code) return + latex:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) + case element(note) return + latex:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) + case element(dateline) return + latex:block($config, ., ("tei-dateline", css:map-rend-to-class(.)), .) + case element(postscript) return + latex:block($config, ., ("tei-postscript", css:map-rend-to-class(.)), .) + case element(back) return + latex:block($config, ., ("tei-back", css:map-rend-to-class(.)), .) + case element(edition) return + if (ancestor::teiHeader) then + latex:block($config, ., ("tei-edition", css:map-rend-to-class(.)), .) + else + $config?apply($config, ./node()) + case element(del) return + latex:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) + case element(cell) return + (: Insert table cell. :) + latex:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) + case element(div) return + if (@type='title_page') then + latex:block($config, ., ("tei-div1", css:map-rend-to-class(.)), .) + else + if (parent::body or parent::front or parent::back) then + latex:section($config, ., ("tei-div2", css:map-rend-to-class(.)), .) + else + latex:block($config, ., ("tei-div3", css:map-rend-to-class(.)), .) + case element(trailer) return + latex:block($config, ., ("tei-trailer", css:map-rend-to-class(.)), .) + case element(reg) return + latex:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) + case element(graphic) return + latex:graphic($config, ., ("tei-graphic", css:map-rend-to-class(.)), ., @url, @width, @height, @scale, desc) + case element(ref) return + if (@target) then + latex:link($config, ., ("tei-ref1", css:map-rend-to-class(.)), ., @target, map {}) + else + if (not(node())) then + latex:link($config, ., ("tei-ref2", css:map-rend-to-class(.)), @target, @target, map {}) + else + latex:inline($config, ., ("tei-ref3", css:map-rend-to-class(.)), .) + case element(titlePart) return + latex:block($config, ., css:get-rendition(., ("tei-titlePart", css:map-rend-to-class(.))), .) + case element(ab) return + latex:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) + case element(add) return + latex:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) + case element(revisionDesc) return + latex:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) + case element(subst) return + latex:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) + case element(head) return + if ($parameters?header='short') then + latex:inline($config, ., ("tei-head1", css:map-rend-to-class(.)), replace(string-join(.//text()[not(parent::ref)]), '^(.*?)[^\w]*$', '$1')) + else + if (parent::figure) then + latex:block($config, ., ("tei-head2", css:map-rend-to-class(.)), .) + else + if (parent::table) then + latex:block($config, ., ("tei-head3", css:map-rend-to-class(.)), .) + else + if (parent::lg) then + latex:block($config, ., ("tei-head4", css:map-rend-to-class(.)), .) + else + if (parent::list) then + latex:block($config, ., ("tei-head5", css:map-rend-to-class(.)), .) + else + if (parent::div) then + latex:heading($config, ., ("tei-head6", css:map-rend-to-class(.)), ., count(ancestor::div)) + else + latex:block($config, ., ("tei-head7", css:map-rend-to-class(.)), .) + case element(roleDesc) return + latex:block($config, ., ("tei-roleDesc", css:map-rend-to-class(.)), .) + case element(opener) return + latex:block($config, ., ("tei-opener", css:map-rend-to-class(.)), .) + case element(speaker) return + latex:block($config, ., ("tei-speaker", css:map-rend-to-class(.)), .) + case element(castGroup) return + if (child::*) then + (: Insert list. :) + latex:list($config, ., ("tei-castGroup", css:map-rend-to-class(.)), castItem|castGroup, ()) + else + $config?apply($config, ./node()) + case element(time) return + latex:inline($config, ., ("tei-time", css:map-rend-to-class(.)), .) + case element(bibl) return + if (parent::listBibl) then + latex:listItem($config, ., ("tei-bibl1", css:map-rend-to-class(.)), ., ()) + else + latex:inline($config, ., ("tei-bibl2", css:map-rend-to-class(.)), .) + case element(imprimatur) return + latex:block($config, ., ("tei-imprimatur", css:map-rend-to-class(.)), .) + case element(salute) return + if (parent::closer) then + latex:inline($config, ., ("tei-salute1", css:map-rend-to-class(.)), .) + else + latex:block($config, ., ("tei-salute2", css:map-rend-to-class(.)), .) + case element(unclear) return + latex:inline($config, ., ("tei-unclear", css:map-rend-to-class(.)), .) + case element(argument) return + latex:block($config, ., ("tei-argument", css:map-rend-to-class(.)), .) + case element(date) return + latex:inline($config, ., ("tei-date2", css:map-rend-to-class(.)), .) + case element(title) return + if ($parameters?header='short') then + latex:heading($config, ., ("tei-title1", css:map-rend-to-class(.)), ., 5) + else + if (parent::titleStmt/parent::fileDesc) then + ( + if (preceding-sibling::title) then + latex:text($config, ., ("tei-title2", css:map-rend-to-class(.)), ' — ') + else + (), + latex:inline($config, ., ("tei-title3", css:map-rend-to-class(.)), .) + ) + + else + if (not(@level) and parent::bibl) then + latex:inline($config, ., ("tei-title4", css:map-rend-to-class(.)), .) + else + if (@level='m' or not(@level)) then + ( + latex:inline($config, ., ("tei-title5", css:map-rend-to-class(.)), .), + if (ancestor::biblFull) then + latex:text($config, ., ("tei-title6", css:map-rend-to-class(.)), ', ') + else + () + ) + + else + if (@level='s' or @level='j') then + ( + latex:inline($config, ., ("tei-title7", css:map-rend-to-class(.)), .), + if (following-sibling::* and ( ancestor::biblFull)) then + latex:text($config, ., ("tei-title8", css:map-rend-to-class(.)), ', ') + else + () + ) + + else + if (@level='u' or @level='a') then + ( + latex:inline($config, ., ("tei-title9", css:map-rend-to-class(.)), .), + if (following-sibling::* and ( ancestor::biblFull)) then + latex:text($config, ., ("tei-title10", css:map-rend-to-class(.)), '. ') + else + () + ) + + else + latex:inline($config, ., ("tei-title11", css:map-rend-to-class(.)), .) + case element(corr) return + if (parent::choice and count(parent::*/*) gt 1) then + (: simple inline, if in parent choice. :) + latex:inline($config, ., ("tei-corr1", css:map-rend-to-class(.)), .) + else + latex:inline($config, ., ("tei-corr2", css:map-rend-to-class(.)), .) + case element(foreign) return + latex:inline($config, ., ("tei-foreign", css:map-rend-to-class(.)), .) + case element(mei:mdiv) return + (: Single MEI mdiv needs to be wrapped to create complete MEI document :) let $params := map { - "label": @xml:id, + "data": let $title := root($parameters?root)//titleStmt/title let $data := {.} return serialize($data), "content": . } let $content := - model:template-cb($config, ., $params) + model:template-mei_mdiv($config, ., $params) return - latex:block(map:merge(($config, map:entry("template", true()))), ., ("tei-cb", css:map-rend-to-class(.)), $content) + latex:pass-through(map:merge(($config, map:entry("template", true()))), ., ("tei-mei_mdiv", css:map-rend-to-class(.)), $content) + case element(cit) return + if (child::quote and child::bibl) then + (: Insert citation :) + latex:cit($config, ., ("tei-cit", css:map-rend-to-class(.)), ., ()) + else + $config?apply($config, ./node()) + case element(sic) return + if (parent::choice and count(parent::*/*) gt 1) then + latex:inline($config, ., ("tei-sic1", css:map-rend-to-class(.)), .) + else + latex:inline($config, ., ("tei-sic2", css:map-rend-to-class(.)), .) + case element(fileDesc) return + if ($parameters?header='short') then + ( + latex:block($config, ., ("tei-fileDesc1", "header-short", css:map-rend-to-class(.)), titleStmt), + latex:block($config, ., ("tei-fileDesc2", "header-short", css:map-rend-to-class(.)), editionStmt), + latex:block($config, ., ("tei-fileDesc3", "header-short", css:map-rend-to-class(.)), publicationStmt), + (: Output abstract containing demo description :) + latex:block($config, ., ("tei-fileDesc4", "sample-description", css:map-rend-to-class(.)), ../profileDesc/abstract) + ) + + else + latex:title($config, ., ("tei-fileDesc5", css:map-rend-to-class(.)), titleStmt) + case element(titleStmt) return + (: No function found for behavior: meta :) + $config?apply($config, ./node()) + case element(body) return + ( + latex:index($config, ., ("tei-body1", css:map-rend-to-class(.)), ., 'toc'), + latex:block($config, ., ("tei-body2", css:map-rend-to-class(.)), .) + ) + + case element(spGrp) return + latex:block($config, ., ("tei-spGrp", css:map-rend-to-class(.)), .) + case element(fw) return + if (ancestor::p or ancestor::ab) then + latex:inline($config, ., ("tei-fw1", css:map-rend-to-class(.)), .) + else + latex:block($config, ., ("tei-fw2", css:map-rend-to-class(.)), .) + case element(encodingDesc) return + latex:omit($config, ., ("tei-encodingDesc", css:map-rend-to-class(.)), .) + case element(gap) return + if (desc) then + latex:inline($config, ., ("tei-gap1", css:map-rend-to-class(.)), .) + else + if (@extent) then + latex:inline($config, ., ("tei-gap2", css:map-rend-to-class(.)), @extent) + else + latex:inline($config, ., ("tei-gap3", css:map-rend-to-class(.)), .) + case element(quote) return + if (ancestor::p) then + (: If it is inside a paragraph then it is inline, otherwise it is block level :) + latex:inline($config, ., css:get-rendition(., ("tei-quote1", css:map-rend-to-class(.))), .) + else + (: If it is inside a paragraph then it is inline, otherwise it is block level :) + latex:block($config, ., css:get-rendition(., ("tei-quote2", css:map-rend-to-class(.))), .) + case element(notatedMusic) return + latex:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) + case element(seg) return + latex:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) + case element(profileDesc) return + latex:omit($config, ., ("tei-profileDesc", css:map-rend-to-class(.)), .) + case element(row) return + if (@role='label') then + latex:row($config, ., ("tei-row1", css:map-rend-to-class(.)), .) + else + (: Insert table row. :) + latex:row($config, ., ("tei-row2", css:map-rend-to-class(.)), .) + case element(floatingText) return + latex:block($config, ., ("tei-floatingText", css:map-rend-to-class(.)), .) + case element(text) return + latex:body($config, ., ("tei-text", css:map-rend-to-class(.)), .) + case element(byline) return + latex:block($config, ., ("tei-byline", css:map-rend-to-class(.)), .) + case element(sp) return + latex:block($config, ., ("tei-sp", css:map-rend-to-class(.)), .) + case element(table) return + latex:table($config, ., ("tei-table", css:map-rend-to-class(.)), ., map {}) + case element(cb) return + latex:break($config, ., ("tei-cb", css:map-rend-to-class(.)), ., 'column', @n) + case element(group) return + latex:block($config, ., ("tei-group", css:map-rend-to-class(.)), .) case element() return if (namespace-uri(.) = 'http://www.tei-c.org/ns/1.0') then $config?apply($config, ./node()) diff --git a/src/teipb/transform/parzival-verse-print.xql b/src/teipb/transform/parzival-verse-print.xql index 62d7d18c..be932744 100644 --- a/src/teipb/transform/parzival-verse-print.xql +++ b/src/teipb/transform/parzival-verse-print.xql @@ -11,6 +11,8 @@ declare default element namespace "http://www.tei-c.org/ns/1.0"; declare namespace xhtml='http://www.w3.org/1999/xhtml'; +declare namespace mei='http://www.music-encoding.org/ns/mei'; + declare namespace pb='http://teipublisher.com/1.0'; import module namespace css="http://www.tei-c.org/tei-simple/xquery/css"; @@ -25,9 +27,15 @@ import module namespace global="http://www.tei-c.org/tei-simple/config" at "../m declare %private function model:template-l($config as map(*), $node as node()*, $params as map(*)) { {$config?apply-children($config, $node, $params?id)}{$config?apply-children($config, $node, $params?content)}/* }; -(: generated template function for element spec: cb :) -declare %private function model:template-cb($config as map(*), $node as node()*, $params as map(*)) { -

Spalte: {$config?apply-children($config, $node, $params?label)}

/* +(: generated template function for element spec: ptr :) +declare %private function model:template-ptr($config as map(*), $node as node()*, $params as map(*)) { + + Original Clefs + /* +}; +(: generated template function for element spec: mei:mdiv :) +declare %private function model:template-mei_mdiv($config as map(*), $node as node()*, $params as map(*)) { + /* }; (:~ @@ -70,6 +78,62 @@ declare function model:apply($config as map(*), $input as node()*) { . return typeswitch(.) + case element(licence) return + if (@target) then + html:link($config, ., ("tei-licence1", "licence", css:map-rend-to-class(.)), 'Licence', @target, (), map {}) + else + html:omit($config, ., ("tei-licence2", css:map-rend-to-class(.)), .) + case element(castItem) return + (: Insert item, rendered as described in parent list rendition. :) + html:listItem($config, ., ("tei-castItem", css:map-rend-to-class(.)), ., ()) + case element(listBibl) return + if (bibl) then + html:list($config, ., ("tei-listBibl1", css:map-rend-to-class(.)), ., ()) + else + html:block($config, ., ("tei-listBibl2", css:map-rend-to-class(.)), .) + case element(item) return + html:listItem($config, ., ("tei-item", css:map-rend-to-class(.)), ., ()) + case element(figure) return + if (head or @rendition='simple:display') then + html:block($config, ., ("tei-figure1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-figure2", css:map-rend-to-class(.)), .) + case element(teiHeader) return + if ($parameters?header='short') then + html:block($config, ., ("tei-teiHeader3", css:map-rend-to-class(.)), .) + else + html:metadata($config, ., ("tei-teiHeader4", css:map-rend-to-class(.)), .) + case element(g) return + if (not(text())) then + html:glyph($config, ., ("tei-g1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-g2", css:map-rend-to-class(.)), .) + case element(supplied) return + if (parent::choice) then + html:inline($config, ., ("tei-supplied1", css:map-rend-to-class(.)), .) + else + if (@reason='damage') then + html:inline($config, ., ("tei-supplied2", css:map-rend-to-class(.)), .) + else + if (@reason='illegible' or not(@reason)) then + html:inline($config, ., ("tei-supplied3", css:map-rend-to-class(.)), .) + else + if (@reason='omitted') then + html:inline($config, ., ("tei-supplied4", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-supplied5", css:map-rend-to-class(.)), .) + case element(author) return + if (ancestor::teiHeader) then + html:block($config, ., ("tei-author1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-author2", css:map-rend-to-class(.)), .) + case element(castList) return + if (child::*) then + html:list($config, ., css:get-rendition(., ("tei-castList", css:map-rend-to-class(.))), castItem, ()) + else + $config?apply($config, ./node()) + case element(milestone) return + html:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) case element(l) return let $params := map { @@ -81,17 +145,368 @@ declare function model:apply($config as map(*), $input as node()*) { model:template-l($config, ., $params) return html:block(map:merge(($config, map:entry("template", true()))), ., css:get-rendition(., ("tei-l", "line", css:map-rend-to-class(.))), $content) - case element(cb) return + case element(closer) return + html:block($config, ., ("tei-closer", css:map-rend-to-class(.)), .) + case element(ptr) return + if (parent::notatedMusic) then + (: Load and display external MEI :) + let $params := + map { + "url": @target, + "content": . + } + + let $content := + model:template-ptr($config, ., $params) + return + html:pass-through(map:merge(($config, map:entry("template", true()))), ., ("tei-ptr", css:map-rend-to-class(.)), $content) + else + $config?apply($config, ./node()) + case element(signed) return + if (parent::closer) then + html:block($config, ., ("tei-signed1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-signed2", css:map-rend-to-class(.)), .) + case element(list) return + html:list($config, ., css:get-rendition(., ("tei-list", css:map-rend-to-class(.))), item, ()) + case element(p) return + if (ancestor::note) then + html:inline($config, ., ("tei-p1", css:map-rend-to-class(.)), .) + else + html:paragraph($config, ., css:get-rendition(., ("tei-p2", css:map-rend-to-class(.))), .) + case element(q) return + if (l) then + html:block($config, ., css:get-rendition(., ("tei-q1", css:map-rend-to-class(.))), .) + else + if (ancestor::p or ancestor::cell) then + html:inline($config, ., css:get-rendition(., ("tei-q2", css:map-rend-to-class(.))), .) + else + html:block($config, ., css:get-rendition(., ("tei-q3", css:map-rend-to-class(.))), .) + case element(epigraph) return + html:block($config, ., ("tei-epigraph", css:map-rend-to-class(.)), .) + case element(pb) return + if (@facs) then + (: Use the url from the facs attribute to link with IIIF image :) + html:webcomponent($config, ., ("tei-pb1", css:map-rend-to-class(.)), ., 'pb-facs-link', map {"facs": @facs, "label": @n, "emit": 'transcription'}) + else + if (starts-with(@facs, 'iiif:')) then + (: If facs attribute starts with iiif prefix, use the trailing part as a link to the IIIF image :) + html:webcomponent($config, ., ("tei-pb2", css:map-rend-to-class(.)), ., 'pb-facs-link', map {"facs": replace(@facs, '^iiif:(.*)$', '$1'), "label": 'Page', "emit": 'transcription'}) + else + html:break($config, ., css:get-rendition(., ("tei-pb3", css:map-rend-to-class(.))), ., 'page', (concat(if(@n) then concat(@n,' ') else '',if(@facs) then concat('@',@facs) else ''))) + case element(docTitle) return + html:block($config, ., css:get-rendition(., ("tei-docTitle", css:map-rend-to-class(.))), .) + case element(lb) return + html:break($config, ., css:get-rendition(., ("tei-lb", css:map-rend-to-class(.))), ., 'line', @n) + case element(anchor) return + html:anchor($config, ., ("tei-anchor", css:map-rend-to-class(.)), ., @xml:id) + case element(TEI) return + html:document($config, ., ("tei-TEI", css:map-rend-to-class(.)), .) + case element(w) return + html:inline($config, ., ("tei-w", css:map-rend-to-class(.)), .) + case element(stage) return + html:block($config, ., ("tei-stage", css:map-rend-to-class(.)), .) + case element(titlePage) return + html:block($config, ., css:get-rendition(., ("tei-titlePage", css:map-rend-to-class(.))), .) + case element(name) return + (: delete me after testing :) + html:inline($config, ., ("tei-name", css:map-rend-to-class(.)), (given-names,surname)) + case element(formula) return + if (@rendition='simple:display') then + html:block($config, ., ("tei-formula1", css:map-rend-to-class(.)), .) + else + if (@rend='display') then + html:webcomponent($config, ., ("tei-formula4", css:map-rend-to-class(.)), ., 'pb-formula', map {"display": true()}) + else + html:webcomponent($config, ., ("tei-formula5", css:map-rend-to-class(.)), ., 'pb-formula', map {}) + case element(front) return + html:block($config, ., ("tei-front", css:map-rend-to-class(.)), .) + case element(lg) return + html:block($config, ., ("tei-lg", css:map-rend-to-class(.)), .) + case element(choice) return + if (sic and corr) then + printcss:alternate($config, ., ("tei-choice1", css:map-rend-to-class(.)), ., corr[1], sic[1]) + else + if (abbr and expan) then + printcss:alternate($config, ., ("tei-choice2", css:map-rend-to-class(.)), ., expan[1], abbr[1]) + else + if (orig and reg) then + printcss:alternate($config, ., ("tei-choice3", css:map-rend-to-class(.)), ., reg[1], orig[1]) + else + $config?apply($config, ./node()) + case element(publicationStmt) return + html:block($config, ., ("tei-publicationStmt1", css:map-rend-to-class(.)), availability/licence) + case element(hi) return + html:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) + case element(role) return + html:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) + case element(code) return + html:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) + case element(note) return + html:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) + case element(dateline) return + html:block($config, ., ("tei-dateline", css:map-rend-to-class(.)), .) + case element(postscript) return + html:block($config, ., ("tei-postscript", css:map-rend-to-class(.)), .) + case element(back) return + html:block($config, ., ("tei-back", css:map-rend-to-class(.)), .) + case element(edition) return + if (ancestor::teiHeader) then + html:block($config, ., ("tei-edition", css:map-rend-to-class(.)), .) + else + $config?apply($config, ./node()) + case element(del) return + html:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) + case element(cell) return + (: Insert table cell. :) + html:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) + case element(div) return + if (@type='title_page') then + html:block($config, ., ("tei-div1", css:map-rend-to-class(.)), .) + else + if (parent::body or parent::front or parent::back) then + html:section($config, ., ("tei-div2", css:map-rend-to-class(.)), .) + else + html:block($config, ., ("tei-div3", css:map-rend-to-class(.)), .) + case element(trailer) return + html:block($config, ., ("tei-trailer", css:map-rend-to-class(.)), .) + case element(reg) return + html:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) + case element(graphic) return + html:graphic($config, ., ("tei-graphic", css:map-rend-to-class(.)), ., @url, @width, @height, @scale, desc) + case element(ref) return + if (@target) then + html:link($config, ., ("tei-ref1", css:map-rend-to-class(.)), ., @target, (), map {}) + else + if (not(node())) then + html:link($config, ., ("tei-ref2", css:map-rend-to-class(.)), @target, @target, (), map {}) + else + html:inline($config, ., ("tei-ref3", css:map-rend-to-class(.)), .) + case element(titlePart) return + html:block($config, ., css:get-rendition(., ("tei-titlePart", css:map-rend-to-class(.))), .) + case element(ab) return + html:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) + case element(add) return + html:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) + case element(revisionDesc) return + html:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) + case element(subst) return + html:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) + case element(head) return + if ($parameters?header='short') then + html:inline($config, ., ("tei-head1", css:map-rend-to-class(.)), replace(string-join(.//text()[not(parent::ref)]), '^(.*?)[^\w]*$', '$1')) + else + if (parent::figure) then + html:block($config, ., ("tei-head2", css:map-rend-to-class(.)), .) + else + if (parent::table) then + html:block($config, ., ("tei-head3", css:map-rend-to-class(.)), .) + else + if (parent::lg) then + html:block($config, ., ("tei-head4", css:map-rend-to-class(.)), .) + else + if (parent::list) then + html:block($config, ., ("tei-head5", css:map-rend-to-class(.)), .) + else + if (parent::div) then + html:heading($config, ., ("tei-head6", css:map-rend-to-class(.)), ., count(ancestor::div)) + else + html:block($config, ., ("tei-head7", css:map-rend-to-class(.)), .) + case element(roleDesc) return + html:block($config, ., ("tei-roleDesc", css:map-rend-to-class(.)), .) + case element(opener) return + html:block($config, ., ("tei-opener", css:map-rend-to-class(.)), .) + case element(speaker) return + html:block($config, ., ("tei-speaker", css:map-rend-to-class(.)), .) + case element(castGroup) return + if (child::*) then + (: Insert list. :) + html:list($config, ., ("tei-castGroup", css:map-rend-to-class(.)), castItem|castGroup, ()) + else + $config?apply($config, ./node()) + case element(time) return + html:inline($config, ., ("tei-time", css:map-rend-to-class(.)), .) + case element(bibl) return + if (parent::listBibl) then + html:listItem($config, ., ("tei-bibl1", css:map-rend-to-class(.)), ., ()) + else + html:inline($config, ., ("tei-bibl2", css:map-rend-to-class(.)), .) + case element(imprimatur) return + html:block($config, ., ("tei-imprimatur", css:map-rend-to-class(.)), .) + case element(salute) return + if (parent::closer) then + html:inline($config, ., ("tei-salute1", css:map-rend-to-class(.)), .) + else + html:block($config, ., ("tei-salute2", css:map-rend-to-class(.)), .) + case element(unclear) return + html:inline($config, ., ("tei-unclear", css:map-rend-to-class(.)), .) + case element(argument) return + html:block($config, ., ("tei-argument", css:map-rend-to-class(.)), .) + case element(date) return + if (@when) then + printcss:alternate($config, ., ("tei-date1", css:map-rend-to-class(.)), ., ., @when) + else + html:inline($config, ., ("tei-date2", css:map-rend-to-class(.)), .) + case element(title) return + if ($parameters?header='short') then + html:heading($config, ., ("tei-title1", css:map-rend-to-class(.)), ., 5) + else + if (parent::titleStmt/parent::fileDesc) then + ( + if (preceding-sibling::title) then + html:text($config, ., ("tei-title2", css:map-rend-to-class(.)), ' — ') + else + (), + html:inline($config, ., ("tei-title3", css:map-rend-to-class(.)), .) + ) + + else + if (not(@level) and parent::bibl) then + html:inline($config, ., ("tei-title4", css:map-rend-to-class(.)), .) + else + if (@level='m' or not(@level)) then + ( + html:inline($config, ., ("tei-title5", css:map-rend-to-class(.)), .), + if (ancestor::biblFull) then + html:text($config, ., ("tei-title6", css:map-rend-to-class(.)), ', ') + else + () + ) + + else + if (@level='s' or @level='j') then + ( + html:inline($config, ., ("tei-title7", css:map-rend-to-class(.)), .), + if (following-sibling::* and ( ancestor::biblFull)) then + html:text($config, ., ("tei-title8", css:map-rend-to-class(.)), ', ') + else + () + ) + + else + if (@level='u' or @level='a') then + ( + html:inline($config, ., ("tei-title9", css:map-rend-to-class(.)), .), + if (following-sibling::* and ( ancestor::biblFull)) then + html:text($config, ., ("tei-title10", css:map-rend-to-class(.)), '. ') + else + () + ) + + else + html:inline($config, ., ("tei-title11", css:map-rend-to-class(.)), .) + case element(corr) return + if (parent::choice and count(parent::*/*) gt 1) then + (: simple inline, if in parent choice. :) + html:inline($config, ., ("tei-corr1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-corr2", css:map-rend-to-class(.)), .) + case element(foreign) return + html:inline($config, ., ("tei-foreign", css:map-rend-to-class(.)), .) + case element(mei:mdiv) return + (: Single MEI mdiv needs to be wrapped to create complete MEI document :) let $params := map { - "label": @xml:id, + "data": let $title := root($parameters?root)//titleStmt/title let $data := {.} return serialize($data), "content": . } let $content := - model:template-cb($config, ., $params) + model:template-mei_mdiv($config, ., $params) return - html:block(map:merge(($config, map:entry("template", true()))), ., ("tei-cb", css:map-rend-to-class(.)), $content) + html:pass-through(map:merge(($config, map:entry("template", true()))), ., ("tei-mei_mdiv", css:map-rend-to-class(.)), $content) + case element(cit) return + if (child::quote and child::bibl) then + (: Insert citation :) + html:cit($config, ., ("tei-cit", css:map-rend-to-class(.)), ., ()) + else + $config?apply($config, ./node()) + case element(sic) return + if (parent::choice and count(parent::*/*) gt 1) then + html:inline($config, ., ("tei-sic1", css:map-rend-to-class(.)), .) + else + html:inline($config, ., ("tei-sic2", css:map-rend-to-class(.)), .) + case element(fileDesc) return + if ($parameters?header='short') then + ( + html:block($config, ., ("tei-fileDesc1", "header-short", css:map-rend-to-class(.)), titleStmt), + html:block($config, ., ("tei-fileDesc2", "header-short", css:map-rend-to-class(.)), editionStmt), + html:block($config, ., ("tei-fileDesc3", "header-short", css:map-rend-to-class(.)), publicationStmt), + (: Output abstract containing demo description :) + html:block($config, ., ("tei-fileDesc4", "sample-description", css:map-rend-to-class(.)), ../profileDesc/abstract) + ) + + else + html:title($config, ., ("tei-fileDesc5", css:map-rend-to-class(.)), titleStmt) + case element(titleStmt) return + if ($parameters?mode='title') then + html:heading($config, ., ("tei-titleStmt3", css:map-rend-to-class(.)), title[not(@type)], 5) + else + if ($parameters?header='short') then + ( + html:link($config, ., ("tei-titleStmt4", css:map-rend-to-class(.)), title[1], $parameters?doc, (), map {}), + html:block($config, ., ("tei-titleStmt5", css:map-rend-to-class(.)), subsequence(title, 2)), + html:block($config, ., ("tei-titleStmt6", css:map-rend-to-class(.)), author) + ) + + else + html:block($config, ., ("tei-titleStmt7", css:map-rend-to-class(.)), .) + case element(body) return + ( + html:index($config, ., ("tei-body1", css:map-rend-to-class(.)), 'toc', .), + html:block($config, ., ("tei-body2", css:map-rend-to-class(.)), .) + ) + + case element(spGrp) return + html:block($config, ., ("tei-spGrp", css:map-rend-to-class(.)), .) + case element(fw) return + if (ancestor::p or ancestor::ab) then + html:inline($config, ., ("tei-fw1", css:map-rend-to-class(.)), .) + else + html:block($config, ., ("tei-fw2", css:map-rend-to-class(.)), .) + case element(encodingDesc) return + html:omit($config, ., ("tei-encodingDesc", css:map-rend-to-class(.)), .) + case element(gap) return + if (desc) then + html:inline($config, ., ("tei-gap1", css:map-rend-to-class(.)), .) + else + if (@extent) then + html:inline($config, ., ("tei-gap2", css:map-rend-to-class(.)), @extent) + else + html:inline($config, ., ("tei-gap3", css:map-rend-to-class(.)), .) + case element(quote) return + if (ancestor::p) then + (: If it is inside a paragraph then it is inline, otherwise it is block level :) + html:inline($config, ., css:get-rendition(., ("tei-quote1", css:map-rend-to-class(.))), .) + else + (: If it is inside a paragraph then it is inline, otherwise it is block level :) + html:block($config, ., css:get-rendition(., ("tei-quote2", css:map-rend-to-class(.))), .) + case element(notatedMusic) return + html:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) + case element(seg) return + html:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) + case element(profileDesc) return + html:omit($config, ., ("tei-profileDesc", css:map-rend-to-class(.)), .) + case element(row) return + if (@role='label') then + html:row($config, ., ("tei-row1", css:map-rend-to-class(.)), .) + else + (: Insert table row. :) + html:row($config, ., ("tei-row2", css:map-rend-to-class(.)), .) + case element(floatingText) return + html:block($config, ., ("tei-floatingText", css:map-rend-to-class(.)), .) + case element(text) return + html:body($config, ., ("tei-text", css:map-rend-to-class(.)), .) + case element(byline) return + html:block($config, ., ("tei-byline", css:map-rend-to-class(.)), .) + case element(sp) return + html:block($config, ., ("tei-sp", css:map-rend-to-class(.)), .) + case element(table) return + html:table($config, ., ("tei-table", css:map-rend-to-class(.)), .) + case element(cb) return + html:break($config, ., ("tei-cb", css:map-rend-to-class(.)), ., 'column', @n) + case element(group) return + html:block($config, ., ("tei-group", css:map-rend-to-class(.)), .) case element(exist:match) return html:match($config, ., .) case element() return diff --git a/src/teipb/transform/parzival-verse-web.xql b/src/teipb/transform/parzival-verse-web.xql index d85f34b5..2b643624 100644 --- a/src/teipb/transform/parzival-verse-web.xql +++ b/src/teipb/transform/parzival-verse-web.xql @@ -11,6 +11,8 @@ declare default element namespace "http://www.tei-c.org/ns/1.0"; declare namespace xhtml='http://www.w3.org/1999/xhtml'; +declare namespace mei='http://www.music-encoding.org/ns/mei'; + declare namespace pb='http://teipublisher.com/1.0'; import module namespace css="http://www.tei-c.org/tei-simple/xquery/css"; @@ -23,9 +25,15 @@ import module namespace global="http://www.tei-c.org/tei-simple/config" at "../m declare %private function model:template-l($config as map(*), $node as node()*, $params as map(*)) { {$config?apply-children($config, $node, $params?id)}{$config?apply-children($config, $node, $params?content)}/* }; -(: generated template function for element spec: cb :) -declare %private function model:template-cb($config as map(*), $node as node()*, $params as map(*)) { -

Spalte: {$config?apply-children($config, $node, $params?label)}

/* +(: generated template function for element spec: ptr :) +declare %private function model:template-ptr($config as map(*), $node as node()*, $params as map(*)) { + + Original Clefs + /* +}; +(: generated template function for element spec: mei:mdiv :) +declare %private function model:template-mei_mdiv($config as map(*), $node as node()*, $params as map(*)) { + /* }; (:~ @@ -68,6 +76,62 @@ declare function model:apply($config as map(*), $input as node()*) { . return typeswitch(.) + case element(licence) return + if (@target) then + html:link($config, ., ("tei-licence1", "licence", css:map-rend-to-class(.)), 'Licence', @target, (), map {}) => model:map($node, $trackIds) + else + html:omit($config, ., ("tei-licence2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(castItem) return + (: Insert item, rendered as described in parent list rendition. :) + html:listItem($config, ., ("tei-castItem", css:map-rend-to-class(.)), ., ()) => model:map($node, $trackIds) + case element(listBibl) return + if (bibl) then + html:list($config, ., ("tei-listBibl1", css:map-rend-to-class(.)), ., ()) => model:map($node, $trackIds) + else + html:block($config, ., ("tei-listBibl2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(item) return + html:listItem($config, ., ("tei-item", css:map-rend-to-class(.)), ., ()) => model:map($node, $trackIds) + case element(figure) return + if (head or @rendition='simple:display') then + html:block($config, ., ("tei-figure1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + html:inline($config, ., ("tei-figure2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(teiHeader) return + if ($parameters?header='short') then + html:block($config, ., ("tei-teiHeader3", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + html:metadata($config, ., ("tei-teiHeader4", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(g) return + if (not(text())) then + html:glyph($config, ., ("tei-g1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + html:inline($config, ., ("tei-g2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(supplied) return + if (parent::choice) then + html:inline($config, ., ("tei-supplied1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + if (@reason='damage') then + html:inline($config, ., ("tei-supplied2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + if (@reason='illegible' or not(@reason)) then + html:inline($config, ., ("tei-supplied3", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + if (@reason='omitted') then + html:inline($config, ., ("tei-supplied4", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + html:inline($config, ., ("tei-supplied5", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(author) return + if (ancestor::teiHeader) then + html:block($config, ., ("tei-author1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + html:inline($config, ., ("tei-author2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(castList) return + if (child::*) then + html:list($config, ., css:get-rendition(., ("tei-castList", css:map-rend-to-class(.))), castItem, ()) => model:map($node, $trackIds) + else + $config?apply($config, ./node()) + case element(milestone) return + html:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(l) return let $params := map { @@ -79,17 +143,365 @@ declare function model:apply($config as map(*), $input as node()*) { model:template-l($config, ., $params) return html:block(map:merge(($config, map:entry("template", true()))), ., css:get-rendition(., ("tei-l", "line", css:map-rend-to-class(.))), $content) => model:map($node, $trackIds) - case element(cb) return + case element(closer) return + html:block($config, ., ("tei-closer", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(ptr) return + if (parent::notatedMusic) then + (: Load and display external MEI :) + let $params := + map { + "url": @target, + "content": . + } + + let $content := + model:template-ptr($config, ., $params) + return + html:pass-through(map:merge(($config, map:entry("template", true()))), ., ("tei-ptr", css:map-rend-to-class(.)), $content) => model:map($node, $trackIds) + else + $config?apply($config, ./node()) + case element(signed) return + if (parent::closer) then + html:block($config, ., ("tei-signed1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + html:inline($config, ., ("tei-signed2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(list) return + html:list($config, ., css:get-rendition(., ("tei-list", css:map-rend-to-class(.))), item, ()) => model:map($node, $trackIds) + case element(p) return + html:paragraph($config, ., css:get-rendition(., ("tei-p2", css:map-rend-to-class(.))), .) => model:map($node, $trackIds) + case element(q) return + if (l) then + html:block($config, ., css:get-rendition(., ("tei-q1", css:map-rend-to-class(.))), .) => model:map($node, $trackIds) + else + if (ancestor::p or ancestor::cell) then + html:inline($config, ., css:get-rendition(., ("tei-q2", css:map-rend-to-class(.))), .) => model:map($node, $trackIds) + else + html:block($config, ., css:get-rendition(., ("tei-q3", css:map-rend-to-class(.))), .) => model:map($node, $trackIds) + case element(epigraph) return + html:block($config, ., ("tei-epigraph", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(pb) return + if (@facs) then + (: Use the url from the facs attribute to link with IIIF image :) + html:webcomponent($config, ., ("tei-pb1", css:map-rend-to-class(.)), ., 'pb-facs-link', map {"facs": @facs, "label": @n, "emit": 'transcription'}) => model:map($node, $trackIds) + else + if (starts-with(@facs, 'iiif:')) then + (: If facs attribute starts with iiif prefix, use the trailing part as a link to the IIIF image :) + html:webcomponent($config, ., ("tei-pb2", css:map-rend-to-class(.)), ., 'pb-facs-link', map {"facs": replace(@facs, '^iiif:(.*)$', '$1'), "label": 'Page', "emit": 'transcription'}) => model:map($node, $trackIds) + else + html:break($config, ., css:get-rendition(., ("tei-pb3", css:map-rend-to-class(.))), ., 'page', (concat(if(@n) then concat(@n,' ') else '',if(@facs) then concat('@',@facs) else ''))) => model:map($node, $trackIds) + case element(docTitle) return + html:block($config, ., css:get-rendition(., ("tei-docTitle", css:map-rend-to-class(.))), .) => model:map($node, $trackIds) + case element(lb) return + html:break($config, ., css:get-rendition(., ("tei-lb", css:map-rend-to-class(.))), ., 'line', @n) => model:map($node, $trackIds) + case element(anchor) return + html:anchor($config, ., ("tei-anchor", css:map-rend-to-class(.)), ., @xml:id) => model:map($node, $trackIds) + case element(TEI) return + html:document($config, ., ("tei-TEI", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(w) return + html:inline($config, ., ("tei-w", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(stage) return + html:block($config, ., ("tei-stage", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(titlePage) return + html:block($config, ., css:get-rendition(., ("tei-titlePage", css:map-rend-to-class(.))), .) => model:map($node, $trackIds) + case element(name) return + (: delete me after testing :) + html:inline($config, ., ("tei-name", css:map-rend-to-class(.)), (given-names,surname)) => model:map($node, $trackIds) + case element(formula) return + if (@rendition='simple:display') then + html:block($config, ., ("tei-formula1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + if (@rend='display') then + html:webcomponent($config, ., ("tei-formula4", css:map-rend-to-class(.)), ., 'pb-formula', map {"display": true()}) => model:map($node, $trackIds) + else + html:webcomponent($config, ., ("tei-formula5", css:map-rend-to-class(.)), ., 'pb-formula', map {}) => model:map($node, $trackIds) + case element(front) return + html:block($config, ., ("tei-front", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(lg) return + html:block($config, ., ("tei-lg", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(choice) return + if (sic and corr) then + html:alternate($config, ., ("tei-choice1", css:map-rend-to-class(.)), ., corr[1], sic[1], map {}) => model:map($node, $trackIds) + else + if (abbr and expan) then + html:alternate($config, ., ("tei-choice2", css:map-rend-to-class(.)), ., expan[1], abbr[1], map {}) => model:map($node, $trackIds) + else + if (orig and reg) then + html:alternate($config, ., ("tei-choice3", css:map-rend-to-class(.)), ., reg[1], orig[1], map {}) => model:map($node, $trackIds) + else + $config?apply($config, ./node()) + case element(publicationStmt) return + html:block($config, ., ("tei-publicationStmt1", css:map-rend-to-class(.)), availability/licence) => model:map($node, $trackIds) + case element(hi) return + html:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(role) return + html:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(code) return + html:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(note) return + html:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(dateline) return + html:block($config, ., ("tei-dateline", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(postscript) return + html:block($config, ., ("tei-postscript", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(back) return + html:block($config, ., ("tei-back", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(edition) return + if (ancestor::teiHeader) then + html:block($config, ., ("tei-edition", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + $config?apply($config, ./node()) + case element(del) return + html:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(cell) return + (: Insert table cell. :) + html:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) => model:map($node, $trackIds) + case element(div) return + if (@type='title_page') then + html:block($config, ., ("tei-div1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + if (parent::body or parent::front or parent::back) then + html:section($config, ., ("tei-div2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + html:block($config, ., ("tei-div3", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(trailer) return + html:block($config, ., ("tei-trailer", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(reg) return + html:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(graphic) return + html:graphic($config, ., ("tei-graphic", css:map-rend-to-class(.)), ., @url, @width, @height, @scale, desc) => model:map($node, $trackIds) + case element(ref) return + if (@target) then + html:link($config, ., ("tei-ref1", css:map-rend-to-class(.)), ., @target, (), map {}) => model:map($node, $trackIds) + else + if (not(node())) then + html:link($config, ., ("tei-ref2", css:map-rend-to-class(.)), @target, @target, (), map {}) => model:map($node, $trackIds) + else + html:inline($config, ., ("tei-ref3", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(titlePart) return + html:block($config, ., css:get-rendition(., ("tei-titlePart", css:map-rend-to-class(.))), .) => model:map($node, $trackIds) + case element(ab) return + html:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(add) return + html:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(revisionDesc) return + html:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(subst) return + html:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(head) return + if ($parameters?header='short') then + html:inline($config, ., ("tei-head1", css:map-rend-to-class(.)), replace(string-join(.//text()[not(parent::ref)]), '^(.*?)[^\w]*$', '$1')) => model:map($node, $trackIds) + else + if (parent::figure) then + html:block($config, ., ("tei-head2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + if (parent::table) then + html:block($config, ., ("tei-head3", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + if (parent::lg) then + html:block($config, ., ("tei-head4", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + if (parent::list) then + html:block($config, ., ("tei-head5", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + if (parent::div) then + html:heading($config, ., ("tei-head6", css:map-rend-to-class(.)), ., count(ancestor::div)) => model:map($node, $trackIds) + else + html:block($config, ., ("tei-head7", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(roleDesc) return + html:block($config, ., ("tei-roleDesc", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(opener) return + html:block($config, ., ("tei-opener", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(speaker) return + html:block($config, ., ("tei-speaker", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(castGroup) return + if (child::*) then + (: Insert list. :) + html:list($config, ., ("tei-castGroup", css:map-rend-to-class(.)), castItem|castGroup, ()) => model:map($node, $trackIds) + else + $config?apply($config, ./node()) + case element(time) return + html:inline($config, ., ("tei-time", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(bibl) return + if (parent::listBibl) then + html:listItem($config, ., ("tei-bibl1", css:map-rend-to-class(.)), ., ()) => model:map($node, $trackIds) + else + html:inline($config, ., ("tei-bibl2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(imprimatur) return + html:block($config, ., ("tei-imprimatur", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(salute) return + if (parent::closer) then + html:inline($config, ., ("tei-salute1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + html:block($config, ., ("tei-salute2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(unclear) return + html:inline($config, ., ("tei-unclear", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(argument) return + html:block($config, ., ("tei-argument", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(date) return + if (@when) then + html:alternate($config, ., ("tei-date1", css:map-rend-to-class(.)), ., ., @when, map {}) => model:map($node, $trackIds) + else + html:inline($config, ., ("tei-date2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(title) return + if ($parameters?header='short') then + html:heading($config, ., ("tei-title1", css:map-rend-to-class(.)), ., 5) => model:map($node, $trackIds) + else + if (parent::titleStmt/parent::fileDesc) then + ( + if (preceding-sibling::title) then + html:text($config, ., ("tei-title2", css:map-rend-to-class(.)), ' — ') => model:map($node, $trackIds) + else + (), + html:inline($config, ., ("tei-title3", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + ) + + else + if (not(@level) and parent::bibl) then + html:inline($config, ., ("tei-title4", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + if (@level='m' or not(@level)) then + ( + html:inline($config, ., ("tei-title5", css:map-rend-to-class(.)), .) => model:map($node, $trackIds), + if (ancestor::biblFull) then + html:text($config, ., ("tei-title6", css:map-rend-to-class(.)), ', ') => model:map($node, $trackIds) + else + () + ) + + else + if (@level='s' or @level='j') then + ( + html:inline($config, ., ("tei-title7", css:map-rend-to-class(.)), .) => model:map($node, $trackIds), + if (following-sibling::* and ( ancestor::biblFull)) then + html:text($config, ., ("tei-title8", css:map-rend-to-class(.)), ', ') => model:map($node, $trackIds) + else + () + ) + + else + if (@level='u' or @level='a') then + ( + html:inline($config, ., ("tei-title9", css:map-rend-to-class(.)), .) => model:map($node, $trackIds), + if (following-sibling::* and ( ancestor::biblFull)) then + html:text($config, ., ("tei-title10", css:map-rend-to-class(.)), '. ') => model:map($node, $trackIds) + else + () + ) + + else + html:inline($config, ., ("tei-title11", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(corr) return + if (parent::choice and count(parent::*/*) gt 1) then + (: simple inline, if in parent choice. :) + html:inline($config, ., ("tei-corr1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + html:inline($config, ., ("tei-corr2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(foreign) return + html:inline($config, ., ("tei-foreign", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(mei:mdiv) return + (: Single MEI mdiv needs to be wrapped to create complete MEI document :) let $params := map { - "label": @xml:id, + "data": let $title := root($parameters?root)//titleStmt/title let $data := {.} return serialize($data), "content": . } let $content := - model:template-cb($config, ., $params) + model:template-mei_mdiv($config, ., $params) return - html:block(map:merge(($config, map:entry("template", true()))), ., ("tei-cb", css:map-rend-to-class(.)), $content) => model:map($node, $trackIds) + html:pass-through(map:merge(($config, map:entry("template", true()))), ., ("tei-mei_mdiv", css:map-rend-to-class(.)), $content) => model:map($node, $trackIds) + case element(cit) return + if (child::quote and child::bibl) then + (: Insert citation :) + html:cit($config, ., ("tei-cit", css:map-rend-to-class(.)), ., ()) => model:map($node, $trackIds) + else + $config?apply($config, ./node()) + case element(sic) return + if (parent::choice and count(parent::*/*) gt 1) then + html:inline($config, ., ("tei-sic1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + html:inline($config, ., ("tei-sic2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(fileDesc) return + if ($parameters?header='short') then + ( + html:block($config, ., ("tei-fileDesc1", "header-short", css:map-rend-to-class(.)), titleStmt) => model:map($node, $trackIds), + html:block($config, ., ("tei-fileDesc2", "header-short", css:map-rend-to-class(.)), editionStmt) => model:map($node, $trackIds), + html:block($config, ., ("tei-fileDesc3", "header-short", css:map-rend-to-class(.)), publicationStmt) => model:map($node, $trackIds), + (: Output abstract containing demo description :) + html:block($config, ., ("tei-fileDesc4", "sample-description", css:map-rend-to-class(.)), ../profileDesc/abstract) => model:map($node, $trackIds) + ) + + else + html:title($config, ., ("tei-fileDesc5", css:map-rend-to-class(.)), titleStmt) => model:map($node, $trackIds) + case element(titleStmt) return + if ($parameters?mode='title') then + html:heading($config, ., ("tei-titleStmt3", css:map-rend-to-class(.)), title[not(@type)], 5) => model:map($node, $trackIds) + else + if ($parameters?header='short') then + ( + html:link($config, ., ("tei-titleStmt4", css:map-rend-to-class(.)), title[1], $parameters?doc, (), map {}) => model:map($node, $trackIds), + html:block($config, ., ("tei-titleStmt5", css:map-rend-to-class(.)), subsequence(title, 2)) => model:map($node, $trackIds), + html:block($config, ., ("tei-titleStmt6", css:map-rend-to-class(.)), author) => model:map($node, $trackIds) + ) + + else + html:block($config, ., ("tei-titleStmt7", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(body) return + ( + html:index($config, ., ("tei-body1", css:map-rend-to-class(.)), 'toc', .) => model:map($node, $trackIds), + html:block($config, ., ("tei-body2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + ) + + case element(spGrp) return + html:block($config, ., ("tei-spGrp", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(fw) return + if (ancestor::p or ancestor::ab) then + html:inline($config, ., ("tei-fw1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + html:block($config, ., ("tei-fw2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(encodingDesc) return + html:omit($config, ., ("tei-encodingDesc", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(gap) return + if (desc) then + html:inline($config, ., ("tei-gap1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + if (@extent) then + html:inline($config, ., ("tei-gap2", css:map-rend-to-class(.)), @extent) => model:map($node, $trackIds) + else + html:inline($config, ., ("tei-gap3", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(quote) return + if (ancestor::p) then + (: If it is inside a paragraph then it is inline, otherwise it is block level :) + html:inline($config, ., css:get-rendition(., ("tei-quote1", css:map-rend-to-class(.))), .) => model:map($node, $trackIds) + else + (: If it is inside a paragraph then it is inline, otherwise it is block level :) + html:block($config, ., css:get-rendition(., ("tei-quote2", css:map-rend-to-class(.))), .) => model:map($node, $trackIds) + case element(notatedMusic) return + html:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) => model:map($node, $trackIds) + case element(seg) return + html:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(profileDesc) return + html:omit($config, ., ("tei-profileDesc", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(row) return + if (@role='label') then + html:row($config, ., ("tei-row1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + else + (: Insert table row. :) + html:row($config, ., ("tei-row2", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(floatingText) return + html:block($config, ., ("tei-floatingText", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(text) return + html:body($config, ., ("tei-text", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(byline) return + html:block($config, ., ("tei-byline", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(sp) return + html:block($config, ., ("tei-sp", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(table) return + html:table($config, ., ("tei-table", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(cb) return + html:break($config, ., ("tei-cb", css:map-rend-to-class(.)), ., 'column', @n) => model:map($node, $trackIds) + case element(group) return + html:block($config, ., ("tei-group", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(exist:match) return html:match($config, ., .) case element() return diff --git a/src/teipb/transform/parzival-verse.css b/src/teipb/transform/parzival-verse.css index a4b30c66..6595a90e 100644 --- a/src/teipb/transform/parzival-verse.css +++ b/src/teipb/transform/parzival-verse.css @@ -1,5 +1,100 @@ /* Generated stylesheet. Do not edit. */ /* Global styles */ +.simple_allcaps { text-transform: uppercase; } +.simple_blackletter { font-family: fantasy; } +.simple_bold { font-weight: bold; } +.simple_bottombraced { padding-bottom: 2pt; border-bottom: dashed gray 2pt; } +.simple_block { display:block; } +.simple_boxed { padding: 2pt; border: solid black 1pt; } +.simple_centre { text-align: center; } +.simple_cursive { font-family: cursive; } +.simple_doublestrikethrough { text-decoration: line-through; color: red; } +.simple_doubleunderline { text-decoration: underline; color: red; } +.simple_dropcap { font-size : 6em; font-family: cursive; font-weight : bold; vertical-align: top; height: 1em; line-height: 1em; float : left; width : 1em; color : #c00; margin: 0em; padding: 0px; } +.simple_float { float:right; display: block; font-size: smaller; clear: right; padding: 4pt; width: 15%; } +.simple_hyphen { } +.simple_inline { display:inline; } +.simple_italic { font-style: italic; } +.simple_justify { text-align: justify; } +.simple_larger { font-size: larger; } +.simple_left { text-align: left; } +.simple_leftbraced { padding-left: 2pt; border-left: dotted gray 2pt; } +.simple_letterspace { letter-spacing: 0.5em; } +.simple_literal { font-family:monospace; white-space:pre; } +.simple_normalstyle { font-style:roman; } +.simple_normalweight { font-weight:normal; } +.simple_right { text-align: right; } +.simple_rightbraced { padding-right: 2pt; border-right: dotted gray 2pt; } +.simple_rotateleft { -webkit-transform: rotate(90deg); transform: rotate(90deg); } +.simple_rotateright { -webkit-transform: rotate(-90deg); transform: rotate(-90deg); } +.simple_rules { border: 1px solid black; padding: 2px;border-collapse:collapse;border-spacing:0; } +.simple_smallcaps { font-variant: small-caps; } +.simple_smaller { font-size: smaller; } +.simple_strikethrough { text-decoration: line-through; } +.simple_subscript { vertical-align: bottom; font-size: smaller; } +.simple_superscript { vertical-align: super; font-size: smaller; } +.simple_topbraced { padding-top: 2pt; border-top: dotted gray 2pt; } +.simple_typewriter { font-family:monospace; } +.simple_underline { text-decoration: underline; } +.simple_wavyunderline { text-decoration: underline; text-decoration-style: wavy; } /* Model rendition styles */ + +.tei-supplied2:before { content:"<"; } +.tei-supplied2:after { content:">"; } +.tei-supplied3:before { content:"["; } +.tei-supplied3:after { content:"]"; } +.tei-supplied4:before { content:"("; } +.tei-supplied4:after { content:")"; } +.tei-supplied5:before { content:"{"; } +.tei-supplied5:after { content:"}"; } +.tei-castList { list-style: ordered; } +.tei-signed1 { text-align: right; } +.tei-signed2 { font-style: italic; } +.tei-p2 { text-align: justify; } +.tei-q1 { margin-left: 10px; margin-right: 10px; } +.tei-q2:before { content: '‘'; } +.tei-q2:after { content: '’'; } +.tei-q3 { margin-left: 10px; margin-right: 10px; } +.tei-pb3 { display: block; margin-left: 4pt; color: grey; float: right; } +.tei-pb3:before { content: '[Page '; } +.tei-pb3:after { content: ']'; } +.tei-docTitle { font-size: larger; } +.tei-stage { font-style: italic; } +.tei-titlePage { text-align: center; } +.tei-hi3 { font-style: italic; } +.tei-code { font-family:monospace } +.tei-edition:before { content: 'Edition: '; } +.tei-del2 { text-decoration: line-through; } +.tei-div1 { border: 1px solid black; padding: 5px; } +.tei-trailer { color: green; } +.tei-add2 { color: green; text-decoration: underline; } +.tei-head2 { font-style: italic; } +.tei-head3 { font-style: italic; } +.tei-head4 { font-style: italic; } +.tei-head5 { font-weight: bold; } +.tei-speaker { font-style:italic; } +.tei-unclear:after { content: ' [?] '; } +.tei-title5 { font-style: italic; } +.tei-title7 { font-style: italic; } +.tei-title9 { font-style: italic; } +.tei-title11 { font-style: italic; } +.tei-corr2:before { content: '['; } +.tei-corr2:after { content: ']'; } +.tei-foreign { font-style:italic; } +.tei-sic2:before { content: '{'; } +.tei-sic2:after { content: '}'; } +.tei-gap1 { color: grey; } +.tei-gap2:before { content: '[..'; } +.tei-gap2:after { content: '..]'; } +.tei-gap2 { color: grey; } +.tei-gap3:before { content: '[...]'; } +.tei-quote1:before { content: '‘'; } +.tei-quote1:after { content: '’'; } +.tei-quote2 { margin-left: 10px; margin-right: 10px; } +.tei-seg8 { } +.tei-seg9 { } +.tei-row1 { font-weight: bold; } +.tei-floatingText { margin: 6pt; border: solid black 1pt; } +.tei-table { font-size: smaller; background-color: #F0F0F0; } \ No newline at end of file diff --git a/src/teipb/transform/parzival-web.xql b/src/teipb/transform/parzival-web.xql index 6a54bd33..5ce7bcbd 100644 --- a/src/teipb/transform/parzival-web.xql +++ b/src/teipb/transform/parzival-web.xql @@ -216,9 +216,9 @@ declare function model:apply($config as map(*), $input as node()*) { case element(role) return html:block($config, ., ("tei-role", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(hi) return - html:inline($config, ., css:get-rendition(., ("tei-hi", css:map-rend-to-class(.))), .) => model:map($node, $trackIds) + html:inline($config, ., ("tei-hi1", "underline", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(note) return - html:note($config, ., ("tei-note", css:map-rend-to-class(.)), ., @place, @n) => model:map($node, $trackIds) + html:inline($config, ., ("tei-note1", "note", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(code) return html:inline($config, ., ("tei-code", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(postscript) return @@ -233,7 +233,7 @@ declare function model:apply($config as map(*), $input as node()*) { else $config?apply($config, ./node()) case element(del) return - html:inline($config, ., ("tei-del", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + html:inline($config, ., ("tei-del1", "deleted", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(cell) return (: Insert table cell. :) html:cell($config, ., ("tei-cell", css:map-rend-to-class(.)), ., ()) => model:map($node, $trackIds) @@ -262,7 +262,7 @@ declare function model:apply($config as map(*), $input as node()*) { case element(ab) return html:paragraph($config, ., ("tei-ab", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(add) return - html:inline($config, ., ("tei-add", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + html:inline($config, ., ("tei-add1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(revisionDesc) return html:omit($config, ., ("tei-revisionDesc", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(head) return @@ -455,7 +455,7 @@ declare function model:apply($config as map(*), $input as node()*) { else html:inline($config, ., ("tei-gap3", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(seg) return - html:inline($config, ., ("tei-seg1", "glory-initial", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + html:inline($config, ., ("tei-seg1", "not-executed", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(notatedMusic) return html:figure($config, ., ("tei-notatedMusic", css:map-rend-to-class(.)), (ptr, mei:mdiv), label) => model:map($node, $trackIds) case element(profileDesc) return @@ -479,10 +479,16 @@ declare function model:apply($config as map(*), $input as node()*) { case element(group) return html:block($config, ., ("tei-group", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(cb) return - html:block($config, ., ("tei-cb", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + html:break($config, ., ("tei-cb", css:map-rend-to-class(.)), ., 'column', @n) => model:map($node, $trackIds) case element(name) return (: delete me after testing :) html:inline($config, ., ("tei-name", css:map-rend-to-class(.)), (given-names,surname)) => model:map($node, $trackIds) + case element(reg) return + html:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(milestone) return + html:inline($config, ., ("tei-milestone", "verse", "-change", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) + case element(subst) return + html:inline($config, ., ("tei-subst1", css:map-rend-to-class(.)), .) => model:map($node, $trackIds) case element(exist:match) return html:match($config, ., .) case element() return diff --git a/src/teipb/transform/parzival.css b/src/teipb/transform/parzival.css index c3d18e06..08d9cc95 100644 --- a/src/teipb/transform/parzival.css +++ b/src/teipb/transform/parzival.css @@ -64,13 +64,13 @@ .tei-docTitle { font-size: larger; } .tei-titlePage { text-align: center; } .tei-stage { font-style: italic; } -.tei-hi { font-style: italic; } +.tei-hi3 { font-style: italic; } .tei-code { font-family:monospace } .tei-edition:before { content: 'Edition: '; } -.tei-del { text-decoration: line-through; } +.tei-del2 { text-decoration: line-through; } .tei-trailer { color: green; } .tei-div1 { border: 1px solid black; padding: 5px; } -.tei-add { color: green; text-decoration: underline; } +.tei-add2 { color: green; text-decoration: underline; } .tei-head2 { font-style: italic; } .tei-head3 { font-style: italic; } .tei-head4 { font-style: italic; } @@ -94,6 +94,8 @@ .tei-gap2:after { content: '..]'; } .tei-gap2 { color: grey; } .tei-gap3:before { content: '[...]'; } +.tei-seg8 { } +.tei-seg9 { } .tei-row1 { font-weight: bold; } .tei-floatingText { margin: 6pt; border: solid black 1pt; } .tei-table { font-size: smaller; background-color: #F0F0F0; } \ No newline at end of file