forked from abaevdict/abaev-basex
initial commit
This commit is contained in:
parent
cee3efab31
commit
71219733bd
31 changed files with 9242 additions and 0 deletions
24
xq/make-lookup.xq
Normal file
24
xq/make-lookup.xq
Normal file
|
@ -0,0 +1,24 @@
|
|||
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')
|
Loading…
Add table
Add a link
Reference in a new issue