Changeset 800 for MDRepository


Ignore:
Timestamp:
10/17/10 21:52:22 (14 years ago)
Author:
vronk
Message:

small but important change to get-children-colls()

File:
1 edited

Legend:

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

    r798 r800  
    123123        $text-count-distinct := count(distinct-values($text-nodes))
    124124        return
     125(:      <Term path="{fn:concat("//", $path)}" name="{text:groups($path, "/([^/]+)$")[last()]}" count="{$path-count}" count_text="{$text-count}"  count_distinct_text="{$text-count-distinct}">{ :)
    125126        <Term path="{fn:concat("//", $path)}" name="{(text:groups($path, "/([^/]+)$")[last()],$path)[1] }" count="{$path-count}" count_text="{$text-count}"  count_distinct_text="{$text-count-distinct}">{
    126127          if ($depth > 0) then
     
    219220:)
    220221declare function cmd-model:get-children-colls($collection as node()+) as node()* {
    221         let $proxies := $collection//ResourceProxy[ResourceType='Metadata']/ResourceRef
     222(:      let $proxies := $collection//ResourceProxy[ResourceType='Metadata']/ResourceRef :)
    222223        let $handle := $collection//MdSelfLink
     224  return collection($cmd-model:cmdiMirrorPath)//IsPartOf[@level=1][matches(.,$handle)]/ancestor::CMD[descendant::ResourceType[. = "Metadata"]]
     225(: this turned out to be very inefficient!!:
    223226        return collection($cmd-model:cmdiMirrorPath)//CMD[descendant::MdSelfLink = $proxies/.][descendant::ResourceType = "Metadata"]   
    224 
    225 (: alternatively we could rely on IsPartOf + IsPartOf/@level
    226   return collection($cmd-model:cmdiMirrorPath)//IsPartOf[. eq $handle]/ancestor::CMD[descendant::ResourceType[. = "Metadata"]] :)
     227:)
    227228  };
    228229
Note: See TracChangeset for help on using the changeset viewer.