Changeset 174 for MDService/trunk/xquery/cmd-model.xqm
- Timestamp:
- 02/03/10 23:33:28 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService/trunk/xquery/cmd-model.xqm
r125 r174 11 11 declare variable $cmd-model:cmdiMirrorPath as xs:string {"/db/cmdi-mirror"}; 12 12 13 declare variable $cmd-model:typeActorPath as xs:string {"//MDGroup/Actors/Actor"}; 13 declare variable $cmd-model:typeActorPath as xs:string {"MDGroup/Actors/Actor"}; 14 declare variable $cmd-model:typeActorPath0 as xs:string {"Actor"}; 14 15 15 16 declare variable $cmd-model:typeActorPathElementPrefix as xs:string {"actor"}; … … 20 21 21 22 declare function cmd-model:elem($collection as xs:string, $path as xs:string, $depth as xs:integer) as element() { 22 let $path-nodes := util:eval(fn:concat("collection('", $collection, "') ", $path))23 let $path-nodes := util:eval(fn:concat("collection('", $collection, "')//", $path)) 23 24 let $path-count := count($path-nodes) 24 25 … … 28 29 let $text-count-distinct := count(distinct-values($text-nodes)) 29 30 return 30 <elem path="{ $path}" count="{$path-count}" count_text="{$text-count}" count_distinct_text="{$text-count-distinct}" >31 <elem path="{fn:concat("//", $path)}" count="{$path-count}" count_text="{$text-count}" count_distinct_text="{$text-count-distinct}" > 31 32 { if ($depth > 0) then 32 33 for $elname in $subs[. != ''] … … 82 83 cmd-model:create-doc($collection, $type-name, $depth) 83 84 return 84 fn:doc(fn:concat($collection, "/", $ type-name, xs:string($depth), $cmd-model:xmlExt))85 fn:doc(fn:concat($collection, "/", $new-name, xs:string($depth), $cmd-model:xmlExt)) 85 86 }; 86 87 … … 163 164 if ($type-name eq $cmd-model:typeActorPath) then 164 165 fn:concat($cmd-model:typeActorPathElementPrefix, $cmd-model:docTypeSuffix) 166 else if ($type-name eq $cmd-model:typeActorPath0) then 167 fn:concat($cmd-model:typeActorPathElementPrefix, $cmd-model:docTypeSuffix) 165 168 else 166 169 ()
Note: See TracChangeset
for help on using the changeset viewer.