- Timestamp:
- 03/18/10 15:58:32 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService/trunk/xquery/cmd-model.xqm
r248 r251 17 17 declare variable $cmd-model:typeActorRolePath as xs:string := "MDGroup/Actors/Actor/Role"; 18 18 19 declare variable $cmd-model:docTypeModelTrees as xs:string := "ModelTrees";20 19 declare variable $cmd-model:docTypeTerms as xs:string := "Terms"; 21 20 declare variable $cmd-model:docTypeSuffix as xs:string := "Values"; … … 32 31 let $text-count-distinct := count(distinct-values($text-nodes)) 33 32 return 34 < elem path="{fn:concat("//", $path)}" count="{$path-count}" count_text="{$text-count}" count_distinct_text="{$text-count-distinct}">33 <Term path="{fn:concat("//", $path)}" count="{$path-count}" count_text="{$text-count}" count_distinct_text="{$text-count-distinct}"> 35 34 { if ($depth > 0) then 36 35 for $elname in $subs[. != ''] … … 38 37 cmd-model:elem($collection, concat($path, '/', $elname), $depth - 1) 39 38 else 'maxdepth' 40 }</ elem>39 }</Term> 41 40 }; 42 41 43 42 declare function cmd-model:paths($n) { 44 43 for $el in $n 45 return < elem name="{$el/name()}"> {44 return <Term name="{$el/name()}"> { 46 45 for $anc in $el/parent::element() 47 46 return util:node-xpath($anc) 48 }</ elem>47 }</Term> 49 48 }; 50 49 … … 168 167 :) 169 168 declare function cmd-model:get-doc-type-element-name($type-name as xs:string) as xs:string { 170 let $name-last := text:groups($type-name, "/(\w+)$")[last()] 171 return 172 if (fn:empty($name-last)) then $cmd-model:ModelTrees else $cmd-model:Terms 173 169 $cmd-model:docTypeTerms 174 170 };
Note: See TracChangeset
for help on using the changeset viewer.