Changeset 711 for MDRepository
- Timestamp:
- 09/20/10 16:04:17 (14 years ago)
- Location:
- MDRepository/trunk/xquery
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
MDRepository/trunk/xquery/cmd-model.xql
r710 r711 10 10 at "xmldb:exist:///db/clarin/cmd-model.xqm"; 11 11 12 (: path="olac/OLAC/The_LINGUIST_List_Language_Resources", q="MDGroup.Actors.Actor", maxdepth=4 :)13 12 14 13 declare function local:cmd-model() as item()* { -
MDRepository/trunk/xquery/cmd-model.xqm
r709 r711 43 43 }; 44 44 45 declare function cmd-model:elem-r($collection as xs:string+, $path as xs:string, $max-depth as xs:integer, $depth as xs:integer) as element() {46 (: let $path-nodes := util:eval(fn:concat("collection('", $collection, "')//", $path)) :)47 let$path-nodes :=48 if ($collection[1]=$cmd-model:collectionRoot) then49 util:eval(fn:concat("collection('", $cmd-model:cmdiMirrorPath, "')//", $path))50 51 for $coll in $collection return util:eval(fn:concat("collection('", $cmd-model:cmdiMirrorPath, "')//CMD[.//IsPartOf='", xdb:decode($coll) ,"']//", $path))45 declare function cmd-model:elem-r($collections as xs:string+, $path as xs:string, $max-depth as xs:integer, $depth as xs:integer) as element() { 46 let $collection := collection($cmd-model:cmdiMirrorPath), 47 $path-nodes := 48 if ($collections[1] = $cmd-model:collectionRoot) then 49 util:eval(fn:concat("$collection//", $path)) 50 else 51 for $coll in $collections return util:eval(fn:concat("$collection//CMD[descendant::IsPartOf = '", xdb:decode($coll) ,"']//", $path)) 52 52 53 53 let $path-count := count($path-nodes) … … 322 322 API function searchRetrieve. 323 323 :) 324 declare function cmd-model:search-retrieve($cql-query as xs:string, $collection as xs:string+, $format as xs:string, $start-item as xs:integer, $end-item as xs:integer) as item()* { 325 let $results := 326 if ($collection[1] = $cmd-model:collectionRoot) then 327 util:eval(fn:concat("collection('", $cmd-model:cmdiMirrorPath, "')", xdb:decode($cql-query), "/ancestor::CMD")) 324 declare function cmd-model:search-retrieve($cql-query as xs:string, $collections as xs:string+, $format as xs:string, $start-item as xs:integer, $end-item as xs:integer) as item()* { 325 let $collection := collection($cmd-model:cmdiMirrorPath), 326 $results := 327 if ($collections[1] = $cmd-model:collectionRoot) then 328 util:eval(fn:concat("$collection", xdb:decode($cql-query), "/ancestor::CMD")) 328 329 else 329 for $coll in $collection return util:eval(fn:concat("collection('", $cmd-model:cmdiMirrorPath, "')", xdb:decode($cql-query), "/ancestor::CMD[descendant::IsPartOf = '", xdb:decode($coll) ,"']"))330 for $coll in $collections return util:eval(fn:concat("$collection", xdb:decode($cql-query), "/ancestor::CMD[descendant::IsPartOf = '", xdb:decode($coll) ,"']")) 330 331 331 332 let $result-count := fn:count($results),
Note: See TracChangeset
for help on using the changeset viewer.