Changeset 725 for MDRepository


Ignore:
Timestamp:
09/28/10 10:45:51 (14 years ago)
Author:
vronk
Message:

corrected root-handling in get-collection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MDRepository/trunk/xquery/cmd-model.xqm

    r714 r725  
    277277    (: let $key := xdb:decode(($doc-name, $id)[1])
    278278    return ft:query(//MdSelfLink, <term>{$key}</term>)[matches(., concat("^", $key, "$"))]/ancestor::CMD :)
    279   else if (empty($doc-name)) then
    280     collection($id)//IsPartOf[. = "root"]/ancestor::CMD
     279  else if (empty($doc-name) or $id=$cmd-model:collectionRoot ) then
     280    collection($cmd-model:cmdiMirrorPath)//IsPartOf[. = $cmd-model:collectionRoot]/ancestor::CMD
    281281  else
    282282    doc(concat($id, "/", $doc-name))
     
    307307:)
    308308declare function cmd-model:get-collections($collections as xs:string+, $format as xs:string, $max-depth as xs:integer) as item() {
    309   let $names := ($cmd-model:commonFreqsPath, cmd-model:make-compound-doc-name($collections, "collection", $max-depth)),
     309  let $names := ($cmd-model:commonFreqsPath, cmd-model:make-compound-doc-name($collections, "collection", xs:string($max-depth))),
    310310 $dummy :=
    311311      if (cmd-model:is-doc-available($names[1], $names[2])) then
Note: See TracChangeset for help on using the changeset viewer.