Skip to content

Commit 17ee9d5

Browse files
committed
refactor teitext:getLabel#2
to make use of the canonical function `eutil:getLocalizedTitle#2`
1 parent a068e65 commit 17ee9d5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

add/data/xqm/teitext.xqm

+2-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ declare namespace tei="http://www.tei-c.org/ns/1.0";
2828
:)
2929
declare function teitext:isText($uri as xs:string) as xs:boolean {
3030

31-
exists(doc($uri)/tei:TEI)
31+
exists(eutil:getDoc($uri)/tei:TEI)
3232

3333
};
3434

@@ -40,8 +40,6 @@ declare function teitext:isText($uri as xs:string) as xs:boolean {
4040
:)
4141
declare function teitext:getLabel($uri as xs:string, $edition as xs:string) as xs:string {
4242

43-
let $language := eutil:getLanguage($edition)
44-
45-
return doc($uri)//tei:titleStmt/data(tei:title[not(@xml:lang) or @xml:lang = $language])
43+
eutil:getLocalizedTitle(eutil:getDoc($uri), eutil:getLanguage($edition))
4644

4745
};

0 commit comments

Comments
 (0)