Open daliboris opened 7 months ago
The raipi:prepare-record function contains typeswitch with identical code in two case clauses, maybe we can simplify it:
case
let $elements-to-change := ("person", "place") (: note: read names from the configuration, perhaps $config:register-map? :) let $element-name := if($node instance of element()) then local-name($node) else () return if($element-name = $elements-to-change) then element {node-name($node)} { (: copy attributes :) for $att in $node/@* except ($node/@xml:id, $node/@resp, $node/@when) return $att , attribute xml:id {$id} , attribute when {format-date(current-date(), '[Y]-[M,2]-[D,2]')} , attribute resp {$resp} , for $child in $node/node() return $child } else $node
Or you can keep typeswitch expression and modify case clauses like this (see here):
typeswitch
case element(tei:person) | element(tei:place)
The raipi:prepare-record function contains typeswitch with identical code in two
case
clauses, maybe we can simplify it:Or you can keep
typeswitch
expression and modifycase
clauses like this (see here):