Changeset 707 for MDRepository
- Timestamp:
- 09/20/10 14:16:59 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MDRepository/trunk/xquery/cmd-model.xqm
r705 r707 30 30 declare variable $cmd-model:collectionDocName as xs:string := "collection.xml"; 31 31 32 declare variable $cmd-model:collectionRoot as xs:string := "root"; 33 32 34 declare variable $cmd-model:xmlExt as xs:string := ".xml"; 33 35 … … 41 43 }; 42 44 43 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() {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() { 44 46 (: let $path-nodes := util:eval(fn:concat("collection('", $collection, "')//", $path)) :) 45 let $path-nodes := for $coll in $collection return util:eval(fn:concat("collection('", $cmd-model:cmdiMirrorPath, "')//CMD[.//IsPartOf='", xdb:decode($coll) ,"']")) 47 let $path-nodes := 48 if ($collection[1]=$cmd-model:collectionRoot) then 49 util:eval(fn:concat("collection('", $cmd-model:cmdiMirrorPath, "')//", $path)) 50 else 51 for $coll in $collection return util:eval(fn:concat("collection('", $cmd-model:cmdiMirrorPath, "')//CMD[.//IsPartOf='", xdb:decode($coll) ,"']//", $path)) 52 46 53 let $path-count := count($path-nodes) 47 54 … … 250 257 251 258 (: 252 Skapa elementnamn fà ¶r dokumentet av typ.259 Skapa elementnamn för dokumentet av typ. 253 260 :) 254 261 declare function cmd-model:get-doc-type-element-name($type-name as xs:string) as xs:string { … … 316 323 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()* { 317 324 (: let $results := for $coll in $collection return util:eval(fn:concat("collection('", xdb:decode($coll), "')", xdb:decode($cql-query), "/ancestor::CMD")), :) 318 let $results := for $coll in $collection return util:eval(fn:concat("collection('", $cmd-model:cmdiMirrorPath, "')", xdb:decode($cql-query), "/ancestor::CMD", "[.//IsPartOf='", xdb:decode($coll) ,"']")), 319 $result-count := fn:count($results), 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")) 328 else 329 for $coll in $collection return util:eval(fn:concat("collection('", $cmd-model:cmdiMirrorPath, "')", xdb:decode($cql-query), "/ancestor::CMD", "[.//IsPartOf='", xdb:decode($coll) ,"']")) 330 331 let $result-count := fn:count($results), 320 332 $result-seq := fn:subsequence($results, $start-item, $end-item), 321 333 $seq-count := fn:count($result-seq),
Note: See TracChangeset
for help on using the changeset viewer.