Changeset 3436 for SMC


Ignore:
Timestamp:
08/20/13 11:29:47 (11 years ago)
Author:
vronk
Message:

prefixed dataset-elements to ds-namespace, renamed some keys

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SMC/trunk/SMC/src/xsl/smc2stats_datasets.xsl

    r2482 r3436  
    44  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    55  xmlns:xs="http://www.w3.org/2001/XMLSchema"
    6  
    7   exclude-result-prefixes="xs"
     6  xmlns:ds="http://aac.ac.at/corpus_shell/dataset"
     7  xmlns:my="myFunctions"   
     8  exclude-result-prefixes="xs my"
    89 
    910>
     
    2526<xsl:import href="smc_commons.xsl"/>
    2627
    27         <xsl:output method="html" indent="yes" />
     28        <xsl:output method="xml" indent="yes" />
    2829       
    2930  <xsl:param name="title" select="'SMC Stats'" />
     
    4243
    4344        <xsl:variable name="all_profiles" select="$cmd-terms//Termset" />
     45        <xsl:variable name="all_datcats" select="$dcr-terms//Concept" />
    4446 
    4547<!--<xsl:template name="continue-root">-->     
     
    5052                        <xsl:call-template name="summary-components"></xsl:call-template>
    5153                        <xsl:call-template name="summary-datcats"></xsl:call-template>
     54                        <xsl:call-template name="ambigue-terms"></xsl:call-template>
    5255                </multiresult>
    5356<!--            <xsl:call-template name="summary-concepts"></xsl:call-template>
     
    6164<xsl:template name="summary-overall">
    6265               
    63         <dataset key="summary" label="Summary">
    64                 <labels>
    65                         <label key="creation-date">created</label>
    66                         <label key="count-terms">all Terms</label>
    67                         <label key="profiles">Profiles</label>
    68                         <label key="components">Components</label>
    69                         <label key="distinct-components">distinct Components</label>
    70                         <label key="elements">Elements</label>
    71                         <label key="distinct-elements">distinct Elements</label>
     66        <ds:dataset key="summary" label="Summary">
     67                <ds:labels>
     68                        <ds:label key="creation-date">created</ds:label>
     69                        <ds:label key="profiles">Profiles</ds:label>
     70                        <ds:label key="components">Components</ds:label>
     71                        <ds:label key="distinct-components">distinct Components</ds:label>
     72                        <ds:label key="elements">Elements</ds:label>
     73                        <ds:label key="distinct-elements">distinct Elements</ds:label>
    7274                       
    73                         <label key="distinct-datcats">distinct DatCats</label>
    74                         <label key="elems-with-datcats">Elements with DatCats</label>
    75                         <label key="elems-without-datcats">Elements without DatCats</label>
    76                         <label key="elems-without-datcats-ratio" >ratio of elements without DatCats</label>
    77                         <label key="available-concepts">available Concepts</label>
    78                         <label key="used-concepts">used Concept</label>
    79                         <label key="blind-concepts">blind Concepts (not in public ISOcat)</label>
    80                         <label key="unused-concepts">unused Concepts</label>                   
    81                 </labels>
    82                 <dataseries key="overall" label="Overall">
    83                         <value key="creation-date"><xsl:value-of select="current-date()"/></value>
    84                         <value key="count-terms" ><xsl:value-of select="count($dcr-cmd-map//Term)"/></value>
    85                         <value key="profiles"><xsl:value-of select="count($cmd-terms//Termset)"/></value>
    86                         <value key="components"><xsl:value-of select="count($cmd-terms//Term[@type='CMD_Component'])"/></value>
    87                         <value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></value>
    88                         <value key="elements"><xsl:value-of select="$count_elems"/></value>
    89                         <value key="distinct-elements"><xsl:value-of select="$count_distinct_elems"/></value>
    90                         <value key="elems-with-datcats"><xsl:value-of select="count(distinct-values($cmd-terms//Term[@type='CMD_Element'][@datcat[not(.='')]]/@id))"/></value>
    91                         <value key="elems-without-datcats"><xsl:value-of select="count(distinct-values($cmd-terms//Term[@type='CMD_Element'][@datcat='']/@id))"/></value>
     75                        <ds:label key="distinct-datcats">distinct DatCats</ds:label>
     76                        <ds:label key="elems-with-datcats">Elements with DatCats</ds:label>
     77                        <ds:label key="elems-without-datcats">Elements without DatCats</ds:label>
     78                        <ds:label key="elems-without-datcats-ratio" >ratio of elements without DatCats</ds:label>
     79                        <ds:label key="available-concepts">available Concepts</ds:label>
     80                        <ds:label key="used-concepts">used Concept</ds:label>
     81                        <ds:label key="blind-concepts">blind Concepts (not in public ISOcat)</ds:label>
     82                        <ds:label key="unused-concepts">Concepts not used in CMD</ds:label>                     
     83                </ds:labels>
     84                <ds:dataseries key="overall" label="Overall">
     85                        <ds:value key="creation-date"><xsl:value-of select="current-date()"/></ds:value>
     86                        <ds:value key="profiles"><xsl:value-of select="count($cmd-terms//Termset)"/></ds:value>
     87                        <ds:value key="components"><xsl:value-of select="count($cmd-terms//Term[@type='CMD_Component'])"/></ds:value>
     88                        <ds:value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></ds:value>
     89                        <ds:value key="elements"><xsl:value-of select="$count_elems"/></ds:value>
     90                        <ds:value key="distinct-elements"><xsl:value-of select="$count_distinct_elems"/></ds:value>
     91                        <ds:value key="elems-with-datcats"><xsl:value-of select="count(distinct-values($cmd-terms//Term[@type='CMD_Element'][@datcat[not(.='')]]/@id))"/></ds:value>
     92                        <ds:value key="elems-without-datcats"><xsl:value-of select="count(distinct-values($cmd-terms//Term[@type='CMD_Element'][@datcat='']/@id))"/></ds:value>
    9293                        <!--<xsl:variable name="elems-without-datcats-ratio" select="count($cmd-terms//Term[@type='CMD_Element'][@datcat='']) div $count_elems"></xsl:variable>
    93                         <value key="elems-without-datcats-ratio" formatted="{format-number($elems-without-datcats-ratio, '0.00 %')}">
    94                                 <xsl:value-of select="$elems-without-datcats-ratio"/></value>-->
     94                        <ds:value key="elems-without-datcats-ratio" formatted="{format-number($elems-without-datcats-ratio, '0.00 %')}">
     95                                <xsl:value-of select="$elems-without-datcats-ratio"/></ds:value>-->
    9596                        <xsl:variable name="elems-distinct-without-datcats-ratio" select="count(distinct-values($cmd-terms//Term[@type='CMD_Element'][@datcat='']/@id)) div $count_distinct_elems"></xsl:variable>
    96                         <value key="elems-without-datcats-ratio" formatted="{format-number($elems-distinct-without-datcats-ratio, '0.00 %')}">
    97                                 <xsl:value-of select="$elems-distinct-without-datcats-ratio"/></value>
    98                         <value key="distinct-datcats"><xsl:value-of select="$count_distinct_datcats"/></value>
    99                         <value key="used-concepts"><xsl:value-of select="count($dcr-cmd-map//Concept)"/></value>
    100                         <value key="blind-concepts"><xsl:value-of select="count(//Concept[not(Term[@set='isocat'])])"/></value>
    101                         <value key="available-concepts"><xsl:value-of select="count($dcr-terms//Concept)"/></value>
    102                         <value key="unused-concepts"><xsl:value-of select="count($dcr-terms//Concept except $dcr-terms//Concept[@id=$dcr-cmd-map//Concept/@id])"/></value>
    103                 </dataseries>   
    104                
    105         </dataset>
     97                        <ds:value key="elems-without-datcats-ratio" formatted="{format-number($elems-distinct-without-datcats-ratio, '0.00 %')}">
     98                                <xsl:value-of select="$elems-distinct-without-datcats-ratio"/></ds:value>
     99                        <ds:value key="distinct-datcats"><xsl:value-of select="$count_distinct_datcats"/></ds:value>
     100                        <ds:value key="used-concepts"><xsl:value-of select="count($dcr-cmd-map//Concept)"/></ds:value>
     101                        <ds:value key="blind-concepts"><xsl:value-of select="count(//Concept[not(Term[@set='isocat'])])"/></ds:value>
     102                        <ds:value key="available-concepts"><xsl:value-of select="count($dcr-terms//Concept)"/></ds:value>
     103                        <ds:value key="unused-concepts"><xsl:value-of select="count($dcr-terms//Concept except $dcr-terms//Concept[@id=$dcr-cmd-map//Concept/@id])"/></ds:value>
     104                </ds:dataseries>       
     105               
     106        </ds:dataset>
    106107                        <!--
    107108                    <tr><td>profileDescription</td><td align="right"><xsl:value-of select="count(//profileDescription)"/></td></tr>                     
     
    140141</xsl:template>
    141142
    142 <xsl:template name="summary-concepts">
    143        
    144     <table>
    145         <caption>Data Categories Sets</caption>
    146         <tbody>
    147             <xsl:for-each select="$dcr-terms//Termset" >
    148                 <tr><td><xsl:value-of select="@set"></xsl:value-of></td>
    149                         <td align="right"><xsl:value-of select="count(Concept)"></xsl:value-of></td>
    150                     </tr>       
    151             </xsl:for-each>           
    152         </tbody>
    153     </table>
    154 </xsl:template>
    155 
    156143       
    157144<xsl:template name="summary-profiles">
    158145       
    159         <dataset key="profile" label="Profiles" count="{count($cmd-terms//Termset)}">
    160                 <labels>
    161                         <label key="components"></label>
    162                         <label key="elements"></label>
    163                         <label key="distinct-datcats"></label>
    164                         <label key="elems-with-datcats"></label>
    165                         <label key="elems-without-datcats"></label>
    166                         <label key="elems-without-datcats-ratio" >ratio of elements without DatCats</label>
    167                 </labels>
     146        <ds:dataset key="profile" label="Profiles" count="{count($cmd-terms//Termset)}">
     147                <ds:labels>
     148                        <ds:label key="components">Components</ds:label>
     149                        <ds:label key="distinct-components">distinct Components</ds:label>
     150                        <ds:label key="elements">Elements</ds:label>
     151                        <ds:label key="distinct-elements">distinct Elements</ds:label>
     152                        <ds:label key="distinct-datcats"></ds:label>
     153                        <ds:label key="elems-with-datcats"></ds:label>
     154                        <ds:label key="elems-without-datcats"></ds:label>
     155                        <ds:label key="elems-without-datcats-ratio" >ratio of elements without DatCats</ds:label>
     156                </ds:labels>
    168157                               
    169158            <xsl:for-each select="$cmd-terms//Termset" >                         
    170159                        <xsl:sort select="@name" order="ascending"/>
     160                <xsl:variable name="profile_id" select="xs:string(@id)" ></xsl:variable>
    171161                <xsl:variable name="count_elems" select="count(./Term[@type='CMD_Element'])" ></xsl:variable>
    172162                <xsl:variable name="count_distinct_datcats" select="count(distinct-values(./Term[@type='CMD_Element']/@datcat[not(.='')]))" ></xsl:variable>
    173163                                       
    174                 <dataseries key="{@id}" label="{@name}" >
    175 <!--                    <value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></value>-->
    176                         <value key="components"><xsl:value-of select="count(./Term[@type='CMD_Component'])"/></value>
    177 <!--                    <value key="distinct-elements"><xsl:value-of select="$count_distinct_elems"/></value>-->
    178                         <value key="elements"><xsl:value-of select="$count_elems"/></value>
    179                         <value key="distinct-datcats"><xsl:value-of select="$count_distinct_datcats"/></value>
    180                         <value key="elems-with-datcats"><xsl:value-of select="count(./Term[@type='CMD_Element']/@datcat[not(.='')])"/></value>
    181                         <value key="elems-without-datcats"><xsl:value-of select="count(./Term[@type='CMD_Element'][@datcat=''])"/></value>
    182                         <xsl:variable name="elems-without-datcats-ratio" select="count(./Term[@type='CMD_Element'][@datcat='']) div $count_elems"></xsl:variable>
    183                         <value key="elems-without-datcats-ratio" formatted="{format-number($elems-without-datcats-ratio, '0.00 %')}">
    184                         <xsl:value-of select="$elems-without-datcats-ratio"/></value>
    185                 </dataseries>
     164                <ds:dataseries key="{@id}" label="{@name}" >
     165<!--                    <ds:value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></ds:value>-->
     166                        <xsl:call-template name="list">
     167                                <xsl:with-param name="key">components</xsl:with-param>
     168<!--                             exclude the profile as component-->
     169                                <xsl:with-param name="data" select="./Term[@type='CMD_Component'][not(xs:string(@id)=$profile_id)]"></xsl:with-param>
     170                        </xsl:call-template>
     171<!--                    <ds:value key="components"><xsl:value-of select="count(./Term[@type='CMD_Component'])"/></ds:value>-->
     172                        <ds:value key="distinct-components"><xsl:value-of select="count(distinct-values(.//Term[@type='CMD_Component'][not(@parent='')]/@id))" /></ds:value>
     173                        <xsl:call-template name="list">
     174                                <xsl:with-param name="key">elements</xsl:with-param>
     175                                <xsl:with-param name="data" select="./Term[@type='CMD_Element']"></xsl:with-param>
     176                        </xsl:call-template>
     177                        <ds:value key="distinct-elements"><xsl:value-of select="count(distinct-values(.//Term[@type='CMD_Element'][not(@parent='')]/@id))" /></ds:value>
     178<!--                    <ds:value key="elements"><xsl:value-of select="$count_elems"/></ds:value>-->
     179                        <xsl:call-template name="list">
     180                                <xsl:with-param name="key">distinct-datcats</xsl:with-param>
     181                                <xsl:with-param name="type">datcat</xsl:with-param>
     182                                <xsl:with-param name="data" select="distinct-values(./Term[@type='CMD_Element']/@datcat[not(.='')])"></xsl:with-param>
     183                        </xsl:call-template>
     184                       
     185<!--                    <ds:value key=""><xsl:value-of select="$count_distinct_datcats"/></ds:value>-->
     186                        <ds:value key="elems-with-datcats"><xsl:value-of select="count(./Term[@type='CMD_Element']/@datcat[not(.='')])"/></ds:value>
     187                        <ds:value key="elems-without-datcats"><xsl:value-of select="count(./Term[@type='CMD_Element'][@datcat=''])"/></ds:value>
     188                        <xsl:variable name="elems-without-datcats-ratio" select="if($count_elems &gt; 0) then count(./Term[@type='CMD_Element'][@datcat='']) div $count_elems else 0"></xsl:variable>
     189                        <ds:value key="elems-without-datcats-ratio" formatted="{format-number($elems-without-datcats-ratio, '0.00 %')}">
     190                        <xsl:value-of select="$elems-without-datcats-ratio"/></ds:value>
     191                </ds:dataseries>
    186192                </xsl:for-each>
    187         </dataset>
     193        </ds:dataset>
    188194</xsl:template>
    189195
    190196<xsl:template name="summary-components">
    191197               
    192         <dataset key="component" label="Components" count="{count($cmd-terms//Term[@type='CMD_Component'])}">
    193                         <labels>
    194                                 <label key="used">used in total</label>
    195                                 <label key="profiles">used in Profiles</label>
    196                                 <label key="components">has Components</label>
    197                                 <label key="distinct-elems">has Elements</label>
    198                                 <label key="elems-with-datcats">Elements with DatCats</label>
    199                                 <label key="distinct-datcats">uses DatCats</label>
    200                                 <label key="elems-without-datcats">Elements without DatCats</label>
    201                                 <label key="elems-without-datcats-ratio" >ratio of elements without DatCats</label>
    202                         </labels>
     198        <ds:dataset key="component" label="Components" count="{count($cmd-terms//Term[@type='CMD_Component'])}">
     199                        <ds:labels>
     200                                <ds:label key="used">used in total</ds:label>
     201                                <ds:label key="profiles">used in Profiles</ds:label>
     202                                <ds:label key="components">has Components</ds:label>
     203                                <ds:label key="distinct-elems">has Elements</ds:label>
     204                                <ds:label key="elems-with-datcats">Elements with DatCats</ds:label>
     205                                <ds:label key="distinct-datcats">uses DatCats</ds:label>
     206                                <ds:label key="elems-without-datcats">Elements without DatCats</ds:label>
     207                                <ds:label key="elems-without-datcats-ratio" >ratio of elements without DatCats</ds:label>
     208                        </ds:labels>
    203209                       
    204210                <xsl:for-each-group select="$cmd-terms-nested//Term[@type='CMD_Component']" group-by="@id">                       
     
    210216                                                <xsl:variable name="count_distinct_datcats" select="count(distinct-values(current-group()//Term/@datcat[not(.='')]))" ></xsl:variable>
    211217                               
    212                                 <dataseries key="{@id}" label="{@name}" >
    213                                         <!--                    <value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></value>-->
    214                                         <value key="used"><xsl:value-of select="$count_usage"/></value>
    215                                         <value key="profiles"><xsl:value-of select="$count_using_profiles"/></value>
    216                                         <value key="components"><xsl:value-of select="count(distinct-values(current-group()//Term[@type='CMD_Component']/@id))"/></value>
    217                                         <!--                    <value key="distinct-elements"><xsl:value-of select="$count_distinct_elems"/></value>-->
    218                                         <value key="distinct-elems"><xsl:value-of select="$count_distinct_elems"/></value>
    219                                         <value key="elems-with-datcats"><xsl:value-of select="count(distinct-values(current-group()//Term[@type='CMD_Element'][@datcat[not(.='')]]/@id))"/></value>
    220                                         <value key="distinct-datcats"><xsl:value-of select="$count_distinct_datcats"/></value>
     218                                <ds:dataseries key="{@id}" label="{@name}" >
     219                                        <!--                    <ds:value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></ds:value>-->
     220                                        <ds:value key="used"><xsl:value-of select="$count_usage"/></ds:value>
     221                                        <ds:value key="profiles"><xsl:value-of select="$count_using_profiles"/></ds:value>
     222                                        <ds:value key="components"><xsl:value-of select="count(distinct-values(current-group()//Term[@type='CMD_Component']/@id))"/></ds:value>
     223                                        <!--                    <ds:value key="distinct-elements"><xsl:value-of select="$count_distinct_elems"/></ds:value>-->
     224                                        <ds:value key="distinct-elems"><xsl:value-of select="$count_distinct_elems"/></ds:value>
     225                                        <ds:value key="elems-with-datcats"><xsl:value-of select="count(distinct-values(current-group()//Term[@type='CMD_Element'][@datcat[not(.='')]]/@id))"/></ds:value>
     226                                        <ds:value key="distinct-datcats"><xsl:value-of select="$count_distinct_datcats"/></ds:value>
    221227                                        <xsl:variable name="elems-without-datcats" select="count(distinct-values(current-group()//Term[@type='CMD_Element'][@datcat='']/@id))" />
    222                                         <value key="elems-without-datcats"><xsl:value-of select="$elems-without-datcats"/></value>
     228                                        <ds:value key="elems-without-datcats"><xsl:value-of select="$elems-without-datcats"/></ds:value>
    223229                                        <xsl:variable name="elems-without-datcats-ratio" select="if ($count_distinct_elems &gt; 0) then $elems-without-datcats div $count_distinct_elems else 0"></xsl:variable>
    224                                         <value key="elems-without-datcats-ratio" formatted="{format-number($elems-without-datcats-ratio, '0.00 %')}">
    225                                                 <xsl:value-of select="$elems-without-datcats-ratio"/></value>
    226                                 </dataseries>
     230                                        <ds:value key="elems-without-datcats-ratio" formatted="{format-number($elems-without-datcats-ratio, '0.00 %')}">
     231                                                <xsl:value-of select="$elems-without-datcats-ratio"/></ds:value>
     232                                </ds:dataseries>
    227233                        </xsl:for-each-group>
    228                 </dataset>
     234                </ds:dataset>
    229235        </xsl:template>
    230236       
     
    232238<xsl:template name="summary-datcats">
    233239       
    234         <dataset key="datcat" label="Data Categories" count="{count($dcr-cmd-map//Concept)}">
    235                 <labels>
    236                         <label key="def">Definition</label>
    237                         <label key="used-in-profiles">used in Profiles</label>
    238                         <label key="referenced-by-elements">referenced by Elements</label>
    239                 </labels>
     240        <ds:dataset key="datcat" label="Data Categories" count="{count($dcr-cmd-map//Concept)}">
     241                <ds:labels>
     242                        <ds:label key="def">Definition</ds:label>
     243                        <ds:label key="used-in-profiles">used in Profiles</ds:label>
     244                        <ds:label key="referenced-by-elements">referenced by Elements</ds:label>
     245                </ds:labels>
    240246               
    241247               
     
    249255                        <xsl:variable name="profiles" select="distinct-values(Term[@type='full-path']/@schema)" ></xsl:variable>
    250256                       
    251                         <dataseries key="{@id}" label="{Term[@type='label'][1]}" >
    252                                 <!--                    <value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></value>-->
     257                        <ds:dataseries key="{@id}" label="{Term[@type='label'][1]}" >
     258                                <!--                    <ds:value key="distinct-components"><xsl:value-of select="$count_distinct_components"/></ds:value>-->
    253259                               
    254                                 <value key="def"><xsl:value-of select="$def"/></value>
    255                                 <value key="used-in-profiles" abs="{count($profiles)}" >
    256                                         <list>
    257                                                 <xsl:for-each select="$profiles" >
    258                                                         <xsl:variable name="profile-name" select="$all_profiles[@id=current()]/@name"></xsl:variable>
    259                                                         <li><a href="#{.}" ><xsl:value-of select="$profile-name" /></a></li>
    260                                                 </xsl:for-each>
    261                                         </list>
    262                                 </value>
    263                                 <value key="referenced-by-elements"><xsl:value-of select="$count_elems"/></value>
    264                         </dataseries>
     260                                <ds:value key="def"><xsl:value-of select="$def"/></ds:value>
     261                                <xsl:call-template name="list">
     262                                        <xsl:with-param name="key" >used-in-profiles</xsl:with-param>
     263                                        <xsl:with-param name="type" >profile</xsl:with-param>
     264                                        <xsl:with-param name="data" select="$profiles" />
     265                                </xsl:call-template>
     266                               
     267                                <ds:value key="referenced-by-elements"><xsl:value-of select="$count_elems"/></ds:value>
     268                        </ds:dataseries>
    265269                </xsl:for-each>
    266         </dataset>
     270        </ds:dataset>
    267271        <!--
    268272                <table>
     
    340344
    341345       
    342 <xsl:template name="ambigue-elems">     
    343         <table>
    344                 <caption>Ambigue elements</caption>
    345                 <thead><tr><th>comp-name</th><th colspan="3">datcat</th><th>count</th><th>profiles</th></tr></thead>
    346                 <tbody>                 
    347                         <xsl:for-each-group select="$cmd-terms//Term" group-by="lower-case(@name)">                             
    348 <!--                            <xsl:sort select="lower-case(@name)" />                         -->
     346<xsl:template name="ambigue-terms">     
     347        <ds:dataset key="ambigue-terms" label="Ambigue terms" >
     348                <ds:label key="term">Term</ds:label>
     349                <ds:label key="usage">usage</ds:label>
     350                <ds:label key="datcat">distinct DatCats</ds:label>
     351                <ds:label key="profiles">used in Profiles</ds:label>
     352                        <xsl:for-each-group select="$cmd-terms//Term" group-by="lower-case(@name)">
     353                                <!--                            <xsl:sort select="lower-case(@name)" />                         -->
    349354                                <xsl:sort select="count(distinct-values(current-group()/@datcat))" order="descending" data-type="number"></xsl:sort>
     355                                <xsl:if test="count(distinct-values(current-group()/@id)) &gt; 1"  >
     356                                        <ds:dataseries key="{@name}" label="{@name}">
     357<!--                                            <ds:value key="term"><xsl:value-of select="@name"></xsl:value-of></ds:value>-->
     358                                                <xsl:call-template name="list">
     359                                                                <xsl:with-param name="key">usage</xsl:with-param>
     360                                                                <xsl:with-param name="data" select="distinct-values(current-group()/xs:string(@id))"></xsl:with-param>
     361                                                </xsl:call-template>
     362                                                <xsl:call-template name="list">
     363                                                        <xsl:with-param name="key">datcat</xsl:with-param>
     364                                                        <xsl:with-param name="type">datcat</xsl:with-param>
     365                                                        <xsl:with-param name="data" select="distinct-values(current-group()/xs:string(@datcat))"></xsl:with-param>
     366                                                </xsl:call-template>
     367                                                <xsl:call-template name="list">
     368                                                        <xsl:with-param name="key">profiles</xsl:with-param>
     369                                                        <xsl:with-param name="type">profile</xsl:with-param>
     370                                                        <xsl:with-param name="data" select="distinct-values(current-group()/ancestor::Termset/@id)"></xsl:with-param>
     371                                                </xsl:call-template>
     372                                        </ds:dataseries>
     373                                </xsl:if>
     374                               
     375                                <!--
    350376                                <tr>                                   
    351                                         <!--                                    <td><xsl:value-of select="@id"/></td>-->
     377                                        <!-\-                                   <td><xsl:value-of select="@id"/></td>-\->
    352378                                        <td><xsl:value-of select="@name"/></td>
    353379                                        <td><xsl:value-of select="count(distinct-values(current-group()/@datcat))"/></td>                                       
    354380                                        <td><xsl:value-of select="count(distinct-values(current-group()/@id))"/></td>
    355                                 </tr>
     381                                </tr>-->
    356382                        </xsl:for-each-group>
    357                 </tbody>
    358         </table>
     383        </ds:dataset>
    359384</xsl:template>
    360385       
     386       
     387<xsl:template name="list" >
     388<xsl:param name="key" ></xsl:param>     
     389<xsl:param name="type" ></xsl:param>
     390<xsl:param name="data" ></xsl:param>
     391       
     392        <xsl:variable name="processed_data">
     393                <xsl:choose>
     394                        <xsl:when test="$data[1] instance of element(li)">
     395                                <xsl:copy-of select="$data" />
     396                        </xsl:when>
     397                        <xsl:when test="$data[1] instance of element()">
     398                                <xsl:for-each select="$data">
     399                                        <ds:li key="{(@id,@path,@name)[1]}" title="{(@path,@id,@key,@name)[1]}"><xsl:value-of select="(@name,@label,@key, @path, @id)[1]"></xsl:value-of></ds:li>
     400                                </xsl:for-each>
     401                        </xsl:when>
     402                        <!--
     403                                <xsl:for-each select="$data">
     404                                        <li key="{.}"><xsl:value-of select="."></xsl:value-of></li>
     405                                </xsl:for-each>
     406                        </xsl:when>
     407                        <xsl:when test="$data[1] instance of xs:untypedAtomic">
     408                                <li key="data"><xsl:value-of select="$data"></xsl:value-of></li>
     409                                <xsl:for-each select="$data/node()">
     410                                        <li key="{.}"><xsl:value-of select="."></xsl:value-of></li>
     411                                </xsl:for-each>
     412                        </xsl:when>
     413                        <xsl:when test="$data[1] instance of attribute()">
     414                                <xsl:for-each select="$data">
     415                                        <li key="{xs:string(.)}"><xsl:value-of select="xs:string(.)"></xsl:value-of></li>
     416                                </xsl:for-each>
     417                        </xsl:when>-->
     418                        <xsl:otherwise>
     419                                <xsl:for-each select="$data">
     420                                       
     421                                        <xsl:variable name="label" >
     422                                                <xsl:choose>
     423                                                        <xsl:when test=".=''">_EMPTY_</xsl:when>
     424                                                        <xsl:when test="$type='profile'">
     425                                                                <xsl:value-of select="$all_profiles[@id=xs:string(current())]/@name" ></xsl:value-of>           
     426                                                        </xsl:when>
     427                                                        <xsl:when test="$type='datcat'">
     428                                                                <xsl:value-of select="$all_datcats[@id=xs:string(current())]/Term[@type='label'][1]/text()" ></xsl:value-of>           
     429                                                        </xsl:when>
     430                                                        <xsl:otherwise>
     431                                                                <xsl:value-of select="xs:string(.)"></xsl:value-of>
     432                                                        </xsl:otherwise>
     433                                                </xsl:choose>
     434                                        </xsl:variable>
     435                                               
     436                                        <ds:li key="{xs:string(.)}"><xsl:value-of select="($label, my:shortURL(xs:string(.)))[.!=''][1]"></xsl:value-of></ds:li>
     437                                </xsl:for-each>
     438                        </xsl:otherwise>
     439                </xsl:choose>
     440        </xsl:variable>
     441        <ds:value key="{$key}" abs="{count($processed_data/*)}" >
     442                <ds:list>
     443                        <xsl:for-each select="$processed_data/*" >
     444                                <xsl:sort select="lower-case(.)" ></xsl:sort>
     445                                <!--<xsl:variable name="profile-name" select="$all_profiles[@id=current()]/@name"></xsl:variable>-->
     446<!--                            <li><a href="#{.}" ><xsl:value-of select="$profile-name" /></a></li>-->
     447                                        <xsl:copy-of select="."></xsl:copy-of>
     448                        </xsl:for-each>
     449                </ds:list>
     450        </ds:value>
     451</xsl:template>
    361452        <!--
    362453<xsl:template name="list-terms">
Note: See TracChangeset for help on using the changeset viewer.