Skip to content
Snippets Groups Projects
Commit d4bb2b65 authored by Peter Stadler's avatar Peter Stadler Committed by Daniel Jettka
Browse files

make function more robust

in the Pintos there's a siglum encoded like
```xml
<add xml:id="x38284ce9-f2be-4ca6-a8cb-227d85357ae1" place="rightmar" type="siglum">
    <rend xml:id="x9bbd3666-54ac-4287-b7f7-1d19347c7e14" color="red">Classe III.
        <lb xml:id="x7e7c09da-9ed9-4ed4-9339-75a18868a860"/>Band
        <lb xml:id="xd18991b0-bc11-447b-881a-b732d8f3b3c4"/>V. No. <rend xml:id="x4904459c-a4c4-40a9-beb5-d9f3c21ddeca" rend="underline">80</rend>.</rend>
</add>
```
which features multiple text nodes causing the original function `source:getSiglum#1` to fail.
parent ce4c0d4c
No related branches found
No related tags found
No related merge requests found
......@@ -135,11 +135,8 @@ declare function source:getSiglum($source as xs:string) as xs:string? {
let $doc := doc($source)
let $elems := $doc//mei:*[@type eq 'siglum']
let $siglum :=
if(exists($elems)) then
($elems[1]//text())
else
()
return $siglum
return
if(exists($elems))
then $elems[1] => normalize-space()
else ()
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment