| 
      
            Lines 257-337
          definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
      
      
        Link Here
      
     | 
  
        
          | 257 | 
              </xsl:template>  | 
          257 | 
              </xsl:template>  | 
        
        
          | 258 | 
           | 
          258 | 
           | 
        
        
          | 259 | 
              <xsl:template name="handle-one-index-subfields">  | 
          259 | 
              <xsl:template name="handle-one-index-subfields">  | 
        
            
              | 260 | 
                      <xsl:variable name="offset"><xsl:value-of select="@offset"/></xsl:variable>  | 
               | 
               | 
            
            
              | 261 | 
                      <xsl:variable name="length"><xsl:value-of select="@length"/></xsl:variable>  | 
            
            
              | 262 | 
                      <xsl:variable name="indexes">  | 
            
            
              | 263 | 
                          <xsl:call-template name="get-target-indexes"/>  | 
            
            
              | 264 | 
                      </xsl:variable>  | 
            
            
              | 265 | 
               | 
            
        
          | 266 | 
                  <xsl:choose>  | 
          260 | 
                  <xsl:choose>  | 
        
        
          | 267 | 
                      <xsl:when test="@condition">  | 
          261 | 
                      <xsl:when test="@condition">  | 
        
        
          | 268 | 
                          <xslo:if>  | 
          262 | 
                          <xslo:if>  | 
        
        
          | 269 | 
                              <xsl:attribute name="test">  | 
          263 | 
                              <xsl:attribute name="test">  | 
        
        
          | 270 | 
                                  <xsl:value-of select="@condition"/>  | 
          264 | 
                                  <xsl:value-of select="@condition"/>  | 
        
        
          | 271 | 
                              </xsl:attribute>  | 
          265 | 
                              </xsl:attribute>  | 
        
          
            
              | 272 | 
                                  <xslo:for-each select="marc:subfield">  | 
              266 | 
                                  <xsl:call-template name="handle-one-index-subfields-helper" />  | 
            
            
              | 273 | 
                                      <xslo:if>  | 
               | 
               | 
            
            
              | 274 | 
                                          <xsl:attribute name="test">  | 
            
            
              | 275 | 
                                              <xsl:text>contains('</xsl:text> | 
            
            
              | 276 | 
                                              <xsl:value-of select="@subfields"/>  | 
            
            
              | 277 | 
                                              <xsl:text>', @code)</xsl:text>  | 
            
            
              | 278 | 
                                          </xsl:attribute>  | 
            
            
              | 279 | 
                                          <z:index>  | 
            
            
              | 280 | 
                                              <xsl:attribute name="name"><xsl:value-of select="normalize-space($indexes)"/></xsl:attribute>  | 
            
            
              | 281 | 
                                              <xslo:value-of>  | 
            
            
              | 282 | 
                                                  <xsl:attribute name="select">  | 
            
            
              | 283 | 
                                                      <xsl:choose>  | 
            
            
              | 284 | 
                                                          <xsl:when test="@length">  | 
            
            
              | 285 | 
                                                              <xsl:text>substring(., </xsl:text>  | 
            
            
              | 286 | 
                                                              <xsl:value-of select="$offset + 1" />  | 
            
            
              | 287 | 
                                                              <xsl:text>, </xsl:text>  | 
            
            
              | 288 | 
                                                              <xsl:value-of select="$length"/>  | 
            
            
              | 289 | 
                                                              <xsl:text>)</xsl:text>  | 
            
            
              | 290 | 
                                                          </xsl:when>  | 
            
            
              | 291 | 
                                                          <xsl:otherwise>  | 
            
            
              | 292 | 
                                                              <xsl:text>.</xsl:text>  | 
            
            
              | 293 | 
                                                          </xsl:otherwise>  | 
            
            
              | 294 | 
                                                      </xsl:choose>  | 
            
            
              | 295 | 
                                                  </xsl:attribute>  | 
            
            
              | 296 | 
                                              </xslo:value-of>  | 
            
            
              | 297 | 
                                          </z:index>  | 
            
            
              | 298 | 
                                      </xslo:if>  | 
            
            
              | 299 | 
                                  </xslo:for-each>  | 
            
        
          | 300 | 
                          </xslo:if>  | 
          267 | 
                          </xslo:if>  | 
        
        
          | 301 | 
                      </xsl:when>  | 
          268 | 
                      </xsl:when>  | 
        
        
          | 302 | 
                      <xsl:otherwise>  | 
          269 | 
                      <xsl:otherwise>  | 
        
          
            
              | 303 | 
                              <xslo:for-each select="marc:subfield">  | 
              270 | 
                              <xsl:call-template name="handle-one-index-subfields-helper" />  | 
            
            
              | 304 | 
                                  <xslo:if>  | 
               | 
               | 
            
            
              | 305 | 
                                      <xsl:attribute name="test">  | 
            
            
              | 306 | 
                                          <xsl:text>contains('</xsl:text> | 
            
            
              | 307 | 
                                          <xsl:value-of select="@subfields"/>  | 
            
            
              | 308 | 
                                          <xsl:text>', @code)</xsl:text>  | 
            
            
              | 309 | 
                                      </xsl:attribute>  | 
            
            
              | 310 | 
                                      <z:index>  | 
            
            
              | 311 | 
                                          <xsl:attribute name="name"><xsl:value-of select="normalize-space($indexes)"/></xsl:attribute>  | 
            
            
              | 312 | 
                                          <xslo:value-of>  | 
            
            
              | 313 | 
                                              <xsl:attribute name="select">  | 
            
            
              | 314 | 
                                                  <xsl:choose>  | 
            
            
              | 315 | 
                                                      <xsl:when test="@length">  | 
            
            
              | 316 | 
                                                          <xsl:text>substring(., </xsl:text>  | 
            
            
              | 317 | 
                                                          <xsl:value-of select="$offset + 1" />  | 
            
            
              | 318 | 
                                                          <xsl:text>, </xsl:text>  | 
            
            
              | 319 | 
                                                          <xsl:value-of select="$length"/>  | 
            
            
              | 320 | 
                                                          <xsl:text>)</xsl:text>  | 
            
            
              | 321 | 
                                                      </xsl:when>  | 
            
            
              | 322 | 
                                                      <xsl:otherwise>  | 
            
            
              | 323 | 
                                                          <xsl:text>.</xsl:text>  | 
            
            
              | 324 | 
                                                      </xsl:otherwise>  | 
            
            
              | 325 | 
                                                  </xsl:choose>  | 
            
            
              | 326 | 
                                              </xsl:attribute>  | 
            
            
              | 327 | 
                                          </xslo:value-of>  | 
            
            
              | 328 | 
                                      </z:index>  | 
            
            
              | 329 | 
                                  </xslo:if>  | 
            
            
              | 330 | 
                              </xslo:for-each>  | 
            
        
          | 331 | 
                      </xsl:otherwise>  | 
          271 | 
                      </xsl:otherwise>  | 
        
        
          | 332 | 
                  </xsl:choose>  | 
          272 | 
                  </xsl:choose>  | 
        
        
          | 333 | 
              </xsl:template>  | 
          273 | 
              </xsl:template>  | 
        
        
          | 334 | 
           | 
          274 | 
           | 
        
            
               | 
               | 
              275 | 
                  <xsl:template name="handle-one-index-subfields-helper">  | 
            
            
              | 276 | 
                      <xsl:variable name="offset"><xsl:value-of select="@offset"/></xsl:variable>  | 
            
            
              | 277 | 
                      <xsl:variable name="length"><xsl:value-of select="@length"/></xsl:variable>  | 
            
            
              | 278 | 
                      <xsl:variable name="indexes">  | 
            
            
              | 279 | 
                          <xsl:call-template name="get-target-indexes"/>  | 
            
            
              | 280 | 
                      </xsl:variable>  | 
            
            
              | 281 | 
               | 
            
            
              | 282 | 
                      <xslo:for-each select="marc:subfield">  | 
            
            
              | 283 | 
                          <xslo:if>  | 
            
            
              | 284 | 
                              <xsl:attribute name="test">  | 
            
            
              | 285 | 
                                  <xsl:text>contains('</xsl:text> | 
            
            
              | 286 | 
                                  <xsl:value-of select="@subfields"/>  | 
            
            
              | 287 | 
                                  <xsl:text>', @code)</xsl:text>  | 
            
            
              | 288 | 
                              </xsl:attribute>  | 
            
            
              | 289 | 
                              <z:index>  | 
            
            
              | 290 | 
                                  <xsl:attribute name="name"><xsl:value-of select="normalize-space($indexes)"/></xsl:attribute>  | 
            
            
              | 291 | 
                                  <xslo:value-of>  | 
            
            
              | 292 | 
                                      <xsl:attribute name="select">  | 
            
            
              | 293 | 
                                          <xsl:choose>  | 
            
            
              | 294 | 
                                              <xsl:when test="@length">  | 
            
            
              | 295 | 
                                                  <xsl:text>substring(., </xsl:text>  | 
            
            
              | 296 | 
                                                  <xsl:value-of select="$offset + 1" />  | 
            
            
              | 297 | 
                                                  <xsl:text>, </xsl:text>  | 
            
            
              | 298 | 
                                                  <xsl:value-of select="$length"/>  | 
            
            
              | 299 | 
                                                  <xsl:text>)</xsl:text>  | 
            
            
              | 300 | 
                                              </xsl:when>  | 
            
            
              | 301 | 
                                              <xsl:otherwise>  | 
            
            
              | 302 | 
                                                  <xsl:text>.</xsl:text>  | 
            
            
              | 303 | 
                                              </xsl:otherwise>  | 
            
            
              | 304 | 
                                          </xsl:choose>  | 
            
            
              | 305 | 
                                      </xsl:attribute>  | 
            
            
              | 306 | 
                                  </xslo:value-of>  | 
            
            
              | 307 | 
                              </z:index>  | 
            
            
              | 308 | 
                          </xslo:if>  | 
            
            
              | 309 | 
                      </xslo:for-each>  | 
            
            
              | 310 | 
                  </xsl:template>  | 
            
            
              | 311 | 
               | 
            
        
          | 335 | 
              <xsl:template name="handle-index-facets">  | 
          312 | 
              <xsl:template name="handle-index-facets">  | 
        
        
          | 336 | 
                <xsl:for-each select="//kohaidx:facet[generate-id() = generate-id(key('index_facet_tag', @tag)[1])]"> | 
          313 | 
                <xsl:for-each select="//kohaidx:facet[generate-id() = generate-id(key('index_facet_tag', @tag)[1])]"> | 
        
        
          | 337 | 
                    <xslo:template mode="index_facets">  | 
          314 | 
                    <xslo:template mode="index_facets">  | 
        
            
              | 338 | 
              -   | 
               | 
               |