- Timestamp:
- 2020-08-06T16:04:04+12:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/wmtb/transform/layouts/main.xsl
r34275 r34313 121 121 <xsl:template name="navBar"> 122 122 <xsl:choose> 123 <xsl:when test="page/pageResponse/collection"> 124 <xsl:variable name="count" select="count(/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier)"/> 125 <xsl:variable name="currentPage" select="page/pageRequest/@fullURL"/> 123 <xsl:when test="page/pageResponse/collection"> 124 <!-- Using select statement to count only non-empty elements, is harder than testing 125 for non-empty elements. Solution of using normalize-space() is from 126 https://stackoverflow.com/questions/31602369/xsl-return-only-the-first-non-empty-element 127 --> 128 <xsl:variable name="count" select="count(/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier/displayItem[@name = 'name'][normalize-space()])"/> 129 <xsl:variable name="currentPage" select="page/pageRequest/@fullURL"/> 126 130 127 131 <li><a href="{$library_name}">DL Home</a></li> … … 162 166 163 167 <xsl:template name="Browsing"> 164 <xsl:for-each select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier"> 168 <xsl:for-each select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier"> 169 <xsl:choose> 170 <!-- Only display browsing classifiers that have a name. 171 Those that don't have a name are empty classifiers 172 denoted by no value/empty value for displayItem name=name elements. 173 Testing for non empty elements is easy: not() test. --> 174 <xsl:when test="not(displayItem[@name='name'] ='')"> 165 175 <li> 166 176 <xsl:choose> … … 191 201 </a> 192 202 </li> 203 </xsl:when> 204 </xsl:choose> 193 205 </xsl:for-each> 194 206 </xsl:template>
Note:
See TracChangeset
for help on using the changeset viewer.