24 lines
No EOL
727 B
Text
24 lines
No EOL
727 B
Text
declare default element namespace "http://www.tei-c.org/ns/1.0";
|
|
declare namespace tei = "http://www.tei-c.org/ns/1.0";
|
|
declare namespace abv = "http://ossetic-studies.org/ns/abaevdict";
|
|
|
|
declare function local:genLookupEntry($doc as document-node())
|
|
as element()?
|
|
{
|
|
let $node := $doc/tei:TEI/tei:text/tei:body/tei:entry
|
|
let $phon := $node/tei:form[1]/tei:orth[1]/text()[1]
|
|
|
|
return element entry {
|
|
attribute xml:id { $node/@xml:id },
|
|
attribute filename { db:path($doc) },
|
|
if ($node/@n) then attribute n {$node/@n} else (),
|
|
text { $phon }
|
|
}
|
|
};
|
|
|
|
let $tbl := <table>
|
|
{for $doc in collection('abaevdict')
|
|
return local:genLookupEntry($doc)}
|
|
</table>
|
|
|
|
return db:put('abaevdict_index', $tbl, 'lookup.xml') |