Ignore:
Timestamp:
10/11/10 21:12:09 (14 years ago)
Author:
vronk
Message:

adding first version terms2autocomplete

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MDService2/trunk/MDService2/src/xsl/terms2view.xsl

    r773 r775  
    5353                                                                               
    5454                        </xsl:when>                             
    55                 <xsl:when test="$format='terms2htmllist'" >                     
     55<!--                    <xsl:when test="$format='terms2htmllist'" >                     
    5656                        <xsl:call-template name="list"/>   
    57                 </xsl:when>
     57                </xsl:when> -->
     58                <xsl:when test="$format='terms2autocomplete'" >                         
     59                        <xsl:call-template name="autocomplete"/>   
     60                </xsl:when>
    5861                <xsl:when test="$format='terms2htmlselect'" >                                                         
    5962                                        <select id="terms-select">             
     
    197200        <xsl:variable name="count" select="Term/@count" />     
    198201        <option value="{@name}" ><xsl:value-of select="@name" /> |<xsl:value-of select="$count" />|</option>                                   
     202</xsl:template>
     203
     204<xsl:template name="autocomplete">
     205       
     206                <xsl:for-each-group select="//Term[not(ancestor::Term[@type='datcat'])]" group-by="@name" >
     207                        <Term name="{@name}">
     208                                <xsl:for-each select="current-group()[not(@type='datcat')]" >
     209                                        <context><xsl:value-of select="ancestor::Termset[1]/@name" />:<xsl:value-of select="@path" /></context>
     210                                </xsl:for-each>
     211                                <xsl:for-each select="current-group()[@type='datcat']" >
     212                                        <xsl:variable name="datcat" select="." />
     213                                        <context><xsl:value-of select="ancestor::Termset[1]/@name" />:<xsl:value-of select="@name" /></context>
     214                                        <xsl:for-each select="$datcat/Term" >
     215                                                <context><xsl:value-of select="@path" /></context>
     216                                        </xsl:for-each>                         
     217                                </xsl:for-each>
     218                        </Term>
     219                </xsl:for-each-group>
    199220</xsl:template>
    200221
Note: See TracChangeset for help on using the changeset viewer.