Changeset 732 for MDRepository
- Timestamp:
- 09/29/10 13:56:25 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MDRepository/trunk/xquery/cmd-model.xqm
r729 r732 49 49 util:eval(fn:concat("$collection//", $path)) 50 50 else 51 for $coll in $collections return util:eval(fn:concat("$collection//ft:query(descendant::IsPartOf, <query><term>", xdb:decode($coll) ,"</term></query>)//", $path, "/ancestor::CMD")) 52 53 let $path-count := count($path-nodes) 51 for $coll in $collections 52 return 53 util:eval(fn:concat("$collection//ft:query(descendant::IsPartOf, <query><term>", xdb:decode($coll), "</term></query>)//", $path, "/ancestor::CMD")) 54 55 let $path-count := count($path-nodes) 54 56 55 let $subs := distinct-values($path-nodes/child::element()/name())56 let $text-nodes := $path-nodes//text()57 let $text-count := count($text-nodes)58 let $text-count-distinct := count(distinct-values($text-nodes))59 return57 let $subs := distinct-values($path-nodes/child::element()/name()) 58 let $text-nodes := $path-nodes//text() 59 let $text-count := count($text-nodes) 60 let $text-count-distinct := count(distinct-values($text-nodes)) 61 return 60 62 <Term path="{fn:concat("//", $path)}" name="{text:groups($path, "/([^/]+)$")[last()]}" count="{$path-count}" count_text="{$text-count}" count_distinct_text="{$text-count-distinct}">{ 61 63 if ($depth > 0) then 62 64 (for $elname in $subs[. != ''] 63 65 return 64 cmd-model:elem-r($collection , concat($path, '/', $elname), $max-depth, $depth - 1),66 cmd-model:elem-r($collections, concat($path, '/', $elname), $max-depth, $depth - 1), 65 67 if ($max-depth eq 1) then cmd-model:values($path-nodes) else ()) 66 68 else 'maxdepth'
Note: See TracChangeset
for help on using the changeset viewer.