Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Flick committed Nov 4, 2024
1 parent 59ae568 commit 8b6ee61
Show file tree
Hide file tree
Showing 12 changed files with 212 additions and 39 deletions.
8 changes: 4 additions & 4 deletions src/teipb/odd/parzival-verse.odd
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
<body>
<schemaSpec start="TEI teiCorpus" ident="parzival-verse" source="parzival.odd"> <elementSpec ident="l" mode="change">
<model behaviour="block" cssClass="line" useSourceRendition="true">
<param name="id" value="(substring-after(@xml:id,'_'),substring-after(@n,' '))"/>
<param name="id" value="substring-after(if (@xml:id) then @xml:id else @n, if (@xml:id) then '_' else ' ')"/>
<param name="content" value="."/>
<pb:template xmlns="" xml:space="preserve"><span class="verse" data-verse="[[id]]">[[id]]</span><span class="content">[[content]]</span></pb:template>
</model>
</elementSpec>
<elementSpec ident="cb" mode="add">
<elementSpec ident="cb" mode="change">
<model behaviour="block">
<param name="label" value="@xml:id"/>
<pb:template xmlns="" xml:space="preserve"><p>Spalte: [[label]]</p></pb:template>
<param name="label" value="concat( if (contains(substring(@xml:id, 5, 1), 'r') or contains(substring(@xml:id, 5, 1), 'v')) then &#34;Bl. &#34; else &#34;S. &#34;, number(substring(@xml:id, 2, 3)), &#34;, Spalte &#34;, substring(@xml:id, string-length(@xml:id), 1) )"/>
<pb:template xmlns="" xml:space="preserve"><p>[[label]]</p></pb:template>
</model>
</elementSpec>
</schemaSpec>
Expand Down
8 changes: 3 additions & 5 deletions src/teipb/odd/parzival.odd
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
</elementSpec>
<elementSpec ident="name" mode="add">
<model behaviour="inline">
<desc>delete me after testing</desc>
<param name="content" value="(given-names,surname)"/>
<param name="content" value="."/>
<pb:template xmlns="" xml:space="preserve">.</pb:template>
</model>
</elementSpec>
<elementSpec ident="reg" mode="add">
Expand All @@ -102,9 +102,7 @@
</model>
</elementSpec>
<elementSpec ident="add" mode="change">
<model behaviour="inline">
<param name="hand" value="#sr"/>
</model>
<model behaviour="inline"/>
<model behaviour="inline">
<outputRendition xml:space="preserve">
color: green; text-decoration: underline;
Expand Down
15 changes: 13 additions & 2 deletions src/teipb/transform/parzival-epub.xql
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ declare %private function model:template-ptr($config as map(*), $node as node()*
declare %private function model:template-mei_mdiv($config as map(*), $node as node()*, $params as map(*)) {
<t xmlns=""><pb-mei player="player" data="{$config?apply-children($config, $node, $params?data)}"/></t>/*
};
(: generated template function for element spec: name :)
declare %private function model:template-name($config as map(*), $node as node()*, $params as map(*)) {
``[.]``
};
(:~
Main entry point for the transformation.
Expand Down Expand Up @@ -483,8 +487,15 @@ declare function model:apply($config as map(*), $input as node()*) {
case element(cb) return
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))
let $params :=
map {
"content": .
}

let $content :=
model:template-name($config, ., $params)
return
html:inline(map:merge(($config, map:entry("template", true()))), ., ("tei-name", css:map-rend-to-class(.)), $content)
case element(reg) return
html:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .)
case element(milestone) return
Expand Down
15 changes: 13 additions & 2 deletions src/teipb/transform/parzival-fo.xql
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ declare %private function model:template-ptr($config as map(*), $node as node()*
declare %private function model:template-mei_mdiv($config as map(*), $node as node()*, $params as map(*)) {
<t xmlns=""><pb-mei player="player" data="{$config?apply-children($config, $node, $params?data)}"/></t>/*
};
(: generated template function for element spec: name :)
declare %private function model:template-name($config as map(*), $node as node()*, $params as map(*)) {
``[.]``
};
(:~
Main entry point for the transformation.
Expand Down Expand Up @@ -463,8 +467,15 @@ declare function model:apply($config as map(*), $input as node()*) {
case element(cb) return
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))
let $params :=
map {
"content": .
}

let $content :=
model:template-name($config, ., $params)
return
fo:inline(map:merge(($config, map:entry("template", true()))), ., ("tei-name", css:map-rend-to-class(.)), $content)
case element(reg) return
fo:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .)
case element(milestone) return
Expand Down
15 changes: 13 additions & 2 deletions src/teipb/transform/parzival-latex.xql
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ declare %private function model:template-formula3($config as map(*), $node as no
declare %private function model:template-mei_mdiv($config as map(*), $node as node()*, $params as map(*)) {
<t xmlns=""><pb-mei player="player" data="{$config?apply-children($config, $node, $params?data)}"/></t>/*
};
(: generated template function for element spec: name :)
declare %private function model:template-name($config as map(*), $node as node()*, $params as map(*)) {
``[.]``
};
(:~
Main entry point for the transformation.
Expand Down Expand Up @@ -491,8 +495,15 @@ declare function model:apply($config as map(*), $input as node()*) {
case element(cb) return
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))
let $params :=
map {
"content": .
}

let $content :=
model:template-name($config, ., $params)
return
latex:inline(map:merge(($config, map:entry("template", true()))), ., ("tei-name", css:map-rend-to-class(.)), $content)
case element(reg) return
latex:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .)
case element(milestone) return
Expand Down
15 changes: 13 additions & 2 deletions src/teipb/transform/parzival-print.xql
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ declare %private function model:template-ptr($config as map(*), $node as node()*
declare %private function model:template-mei_mdiv($config as map(*), $node as node()*, $params as map(*)) {
<t xmlns=""><pb-mei player="player" data="{$config?apply-children($config, $node, $params?data)}"/></t>/*
};
(: generated template function for element spec: name :)
declare %private function model:template-name($config as map(*), $node as node()*, $params as map(*)) {
``[.]``
};
(:~
Main entry point for the transformation.
Expand Down Expand Up @@ -486,8 +490,15 @@ declare function model:apply($config as map(*), $input as node()*) {
case element(cb) return
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))
let $params :=
map {
"content": .
}

let $content :=
model:template-name($config, ., $params)
return
html:inline(map:merge(($config, map:entry("template", true()))), ., ("tei-name", css:map-rend-to-class(.)), $content)
case element(reg) return
html:inline($config, ., ("tei-reg", "syncope", css:map-rend-to-class(.)), .)
case element(milestone) return
Expand Down
32 changes: 28 additions & 4 deletions src/teipb/transform/parzival-verse-epub.xql
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,18 @@ declare %private function model:template-ptr($config as map(*), $node as node()*
<pb-option name="appXPath" on="./rdg[contains(@label, 'original')]" off="">Original Clefs</pb-option>
</pb-mei></t>/*
};
(: generated template function for element spec: name :)
declare %private function model:template-name($config as map(*), $node as node()*, $params as map(*)) {
``[.]``
};
(: generated template function for element spec: mei:mdiv :)
declare %private function model:template-mei_mdiv($config as map(*), $node as node()*, $params as map(*)) {
<t xmlns=""><pb-mei player="player" data="{$config?apply-children($config, $node, $params?data)}"/></t>/*
};
(: generated template function for element spec: cb :)
declare %private function model:template-cb($config as map(*), $node as node()*, $params as map(*)) {
<t xmlns=""><p>{$config?apply-children($config, $node, $params?label)}</p></t>/*
};
(:~
Main entry point for the transformation.
Expand Down Expand Up @@ -137,7 +145,7 @@ declare function model:apply($config as map(*), $input as node()*) {
case element(l) return
let $params :=
map {
"id": (substring-after(@xml:id,'_'),substring-after(@n,' ')),
"id": substring-after(if (@xml:id) then @xml:id else @n, if (@xml:id) then '_' else ' '),
"content": .
}

Expand Down Expand Up @@ -206,8 +214,15 @@ declare function model:apply($config as map(*), $input as node()*) {
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))
let $params :=
map {
"content": .
}

let $content :=
model:template-name($config, ., $params)
return
html:inline(map:merge(($config, map:entry("template", true()))), ., ("tei-name", css:map-rend-to-class(.)), $content)
case element(formula) return
if (@rendition='simple:display') then
epub:block($config, ., ("tei-formula1", css:map-rend-to-class(.)), .)
Expand Down Expand Up @@ -501,7 +516,16 @@ declare function model:apply($config as map(*), $input as node()*) {
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)
let $params :=
map {
"label": concat( if (contains(substring(@xml:id, 5, 1), 'r') or contains(substring(@xml:id, 5, 1), 'v')) then "Bl. " else "S. ", number(substring(@xml:id, 2, 3)), ", Spalte ", substring(@xml:id, string-length(@xml:id), 1) ),
"content": .
}

let $content :=
model:template-cb($config, ., $params)
return
epub:block(map:merge(($config, map:entry("template", true()))), ., ("tei-cb", css:map-rend-to-class(.)), $content)
case element(group) return
epub:block($config, ., ("tei-group", css:map-rend-to-class(.)), .)
case element(exist:match) return
Expand Down
32 changes: 28 additions & 4 deletions src/teipb/transform/parzival-verse-fo.xql
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@ declare %private function model:template-ptr($config as map(*), $node as node()*
<pb-option name="appXPath" on="./rdg[contains(@label, 'original')]" off="">Original Clefs</pb-option>
</pb-mei></t>/*
};
(: generated template function for element spec: name :)
declare %private function model:template-name($config as map(*), $node as node()*, $params as map(*)) {
``[.]``
};
(: generated template function for element spec: mei:mdiv :)
declare %private function model:template-mei_mdiv($config as map(*), $node as node()*, $params as map(*)) {
<t xmlns=""><pb-mei player="player" data="{$config?apply-children($config, $node, $params?data)}"/></t>/*
};
(: generated template function for element spec: cb :)
declare %private function model:template-cb($config as map(*), $node as node()*, $params as map(*)) {
<t xmlns=""><p>{$config?apply-children($config, $node, $params?label)}</p></t>/*
};
(:~
Main entry point for the transformation.
Expand Down Expand Up @@ -129,7 +137,7 @@ declare function model:apply($config as map(*), $input as node()*) {
case element(l) return
let $params :=
map {
"id": (substring-after(@xml:id,'_'),substring-after(@n,' ')),
"id": substring-after(if (@xml:id) then @xml:id else @n, if (@xml:id) then '_' else ' '),
"content": .
}

Expand Down Expand Up @@ -198,8 +206,15 @@ declare function model:apply($config as map(*), $input as node()*) {
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))
let $params :=
map {
"content": .
}

let $content :=
model:template-name($config, ., $params)
return
fo:inline(map:merge(($config, map:entry("template", true()))), ., ("tei-name", css:map-rend-to-class(.)), $content)
case element(formula) return
if (@rendition='simple:display') then
fo:block($config, ., ("tei-formula1", css:map-rend-to-class(.)), .)
Expand Down Expand Up @@ -481,7 +496,16 @@ declare function model:apply($config as map(*), $input as node()*) {
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)
let $params :=
map {
"label": concat( if (contains(substring(@xml:id, 5, 1), 'r') or contains(substring(@xml:id, 5, 1), 'v')) then "Bl. " else "S. ", number(substring(@xml:id, 2, 3)), ", Spalte ", substring(@xml:id, string-length(@xml:id), 1) ),
"content": .
}

let $content :=
model:template-cb($config, ., $params)
return
fo:block(map:merge(($config, map:entry("template", true()))), ., ("tei-cb", css:map-rend-to-class(.)), $content)
case element(group) return
fo:block($config, ., ("tei-group", css:map-rend-to-class(.)), .)
case element() return
Expand Down
Loading

0 comments on commit 8b6ee61

Please sign in to comment.