Changeset 251 for MDService


Ignore:
Timestamp:
03/18/10 15:58:32 (14 years ago)
Author:
ljo
Message:

cmd-model.xqm - ModelTrees? -> Terms and elem -> Term.

File:
1 edited

Legend:

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

    r248 r251  
    1717declare variable $cmd-model:typeActorRolePath as xs:string := "MDGroup/Actors/Actor/Role";
    1818
    19 declare variable $cmd-model:docTypeModelTrees as xs:string := "ModelTrees";
    2019declare variable $cmd-model:docTypeTerms as xs:string := "Terms";
    2120declare variable $cmd-model:docTypeSuffix as xs:string := "Values";
     
    3231  let $text-count-distinct := count(distinct-values($text-nodes))
    3332  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}">
    3534        { if ($depth > 0) then
    3635            for $elname in $subs[. != '']
     
    3837              cmd-model:elem($collection, concat($path, '/', $elname), $depth - 1)
    3938          else 'maxdepth'
    40         }</elem>
     39        }</Term>
    4140};
    4241
    4342declare function cmd-model:paths($n) {
    4443        for $el in $n
    45         return <elem name="{$el/name()}"> {
     44        return <Term name="{$el/name()}"> {
    4645        for $anc in $el/parent::element()
    4746        return util:node-xpath($anc)
    48         }</elem>
     47        }</Term>
    4948};
    5049
     
    168167:)
    169168declare 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
    174170};
Note: See TracChangeset for help on using the changeset viewer.