Lines 12-21
Link Here
|
12 |
<xsl:template match="text()"/> |
12 |
<xsl:template match="text()"/> |
13 |
|
13 |
|
14 |
<!-- Keys on tags referenced in the index definitions --> |
14 |
<!-- Keys on tags referenced in the index definitions --> |
15 |
<xsl:key name="index_control_field_tag" match="kohaidx:index_control_field" use="@tag"/> |
15 |
<xsl:key name="index_control_field_tag" match="kohaidx:index_control_field" use="@tag"/> |
16 |
<xsl:key name="index_subfields_tag" match="kohaidx:index_subfields" use="@tag"/> |
16 |
<xsl:key name="index_subfields_tag" match="kohaidx:index_subfields" use="@tag"/> |
17 |
<xsl:key name="index_heading_tag" match="kohaidx:index_heading" use="@tag"/> |
17 |
<xsl:key name="index_heading_tag" match="kohaidx:index_heading" use="@tag"/> |
18 |
<xsl:key name="index_data_field_tag" match="kohaidx:index_data_field" use="@tag"/> |
18 |
<xsl:key name="index_data_field_tag" match="kohaidx:index_data_field" use="@tag"/> |
19 |
<xsl:key name="index_heading_conditional_tag" match="kohaidx:index_heading_conditional" use="@tag"/> |
19 |
<xsl:key name="index_heading_conditional_tag" match="kohaidx:index_heading_conditional" use="@tag"/> |
20 |
<xsl:key name="index_match_heading_tag" match="kohaidx:index_match_heading" use="@tag"/> |
20 |
<xsl:key name="index_match_heading_tag" match="kohaidx:index_match_heading" use="@tag"/> |
21 |
|
21 |
|
Lines 33-38
definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
Link Here
|
33 |
<xslo:template match="text()"/> |
33 |
<xslo:template match="text()"/> |
34 |
<xslo:template match="text()" mode="index_subfields"/> |
34 |
<xslo:template match="text()" mode="index_subfields"/> |
35 |
<xslo:template match="text()" mode="index_data_field"/> |
35 |
<xslo:template match="text()" mode="index_data_field"/> |
|
|
36 |
<xslo:template match="text()" mode="index_facets"/> |
36 |
<xslo:template match="text()" mode="index_heading"/> |
37 |
<xslo:template match="text()" mode="index_heading"/> |
37 |
<xslo:template match="text()" mode="index_heading_conditional"/> |
38 |
<xslo:template match="text()" mode="index_heading_conditional"/> |
38 |
<xslo:template match="text()" mode="index_match_heading"/> |
39 |
<xslo:template match="text()" mode="index_match_heading"/> |
Lines 57-62
definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
Link Here
|
57 |
<xslo:apply-templates/> |
58 |
<xslo:apply-templates/> |
58 |
<xslo:apply-templates mode="index_subfields"/> |
59 |
<xslo:apply-templates mode="index_subfields"/> |
59 |
<xslo:apply-templates mode="index_data_field"/> |
60 |
<xslo:apply-templates mode="index_data_field"/> |
|
|
61 |
<xslo:apply-templates mode="index_facets"/> |
60 |
<xslo:apply-templates mode="index_heading"/> |
62 |
<xslo:apply-templates mode="index_heading"/> |
61 |
<xslo:apply-templates mode="index_heading_conditional"/> |
63 |
<xslo:apply-templates mode="index_heading_conditional"/> |
62 |
<xslo:apply-templates mode="index_match_heading"/> |
64 |
<xslo:apply-templates mode="index_match_heading"/> |
Lines 69-74
definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
Link Here
|
69 |
<xsl:call-template name="handle-index-control-field"/> |
71 |
<xsl:call-template name="handle-index-control-field"/> |
70 |
<xsl:call-template name="handle-index-subfields"/> |
72 |
<xsl:call-template name="handle-index-subfields"/> |
71 |
<xsl:call-template name="handle-index-data-field"/> |
73 |
<xsl:call-template name="handle-index-data-field"/> |
|
|
74 |
<xsl:call-template name="handle-index-facets"/> |
72 |
<xsl:call-template name="handle-index-heading"/> |
75 |
<xsl:call-template name="handle-index-heading"/> |
73 |
<xsl:call-template name="handle-index-heading-conditional"/> |
76 |
<xsl:call-template name="handle-index-heading-conditional"/> |
74 |
<xsl:call-template name="handle-index-match-heading"/> |
77 |
<xsl:call-template name="handle-index-match-heading"/> |
Lines 104-110
definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
Link Here
|
104 |
</xslo:variable> |
107 |
</xslo:variable> |
105 |
</xsl:template> |
108 |
</xsl:template> |
106 |
|
109 |
|
107 |
<xsl:template match="kohaidx:index_subject_thesaurus"> |
110 |
<xsl:template match="kohaidx:index_subject_thesaurus"> |
108 |
<xsl:variable name="tag"><xsl:value-of select="@tag"/></xsl:variable> |
111 |
<xsl:variable name="tag"><xsl:value-of select="@tag"/></xsl:variable> |
109 |
<xsl:variable name="offset"><xsl:value-of select="@offset"/></xsl:variable> |
112 |
<xsl:variable name="offset"><xsl:value-of select="@offset"/></xsl:variable> |
110 |
<xsl:variable name="length"><xsl:value-of select="@length"/></xsl:variable> |
113 |
<xsl:variable name="length"><xsl:value-of select="@length"/></xsl:variable> |
Lines 288-293
definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
Link Here
|
288 |
</xslo:for-each> |
291 |
</xslo:for-each> |
289 |
</xsl:template> |
292 |
</xsl:template> |
290 |
|
293 |
|
|
|
294 |
<xsl:template name="handle-index-facets"> |
295 |
<xsl:for-each select="facet"> |
296 |
<xsl:variable name="indexes"> |
297 |
<xsl:call-template name="get-facets-target-indexes"/> |
298 |
</xsl:variable> |
299 |
<xsl:if test="not($indexes='')"> |
300 |
<xslo:template mode="index_facets"> |
301 |
<xsl:attribute name="match"> |
302 |
<xsl:text>marc:datafield[@tag='</xsl:text> |
303 |
<xsl:value-of select="@tag"/> |
304 |
<xsl:text>']</xsl:text> |
305 |
</xsl:attribute> |
306 |
<xslo:if> |
307 |
<xsl:attribute name="test"> |
308 |
<xsl:text>not(@ind1='z')</xsl:text> |
309 |
</xsl:attribute> |
310 |
<z:index> |
311 |
<xsl:attribute name="name"> |
312 |
<xsl:value-of select="normalize-space($indexes)"/> |
313 |
</xsl:attribute> |
314 |
<xsl:call-template name="build-facet-value"> |
315 |
<xsl:with-param name="subfields" select="@subfields"/> |
316 |
</xsl:call-template> |
317 |
<xsl:for-each select="//subfield"> |
318 |
<xslo:if test="not(position()='1')"><xslo:text>:*:</xslo:text></xslo:if> |
319 |
<xslo:value-of> |
320 |
<xsl:attribute name="select"> |
321 |
<xsl:text>marc:subfield</xsl:text> |
322 |
</xsl:attribute> |
323 |
</xslo:value-of> |
324 |
</xsl:for-each> |
325 |
</z:index> |
326 |
</xslo:if> |
327 |
</xslo:template> |
328 |
</xsl:if> |
329 |
</xsl:for-each> |
330 |
</xsl:template> |
331 |
|
291 |
<xsl:template name="handle-index-data-field"> |
332 |
<xsl:template name="handle-index-data-field"> |
292 |
<xsl:for-each select="//kohaidx:index_data_field[generate-id() = generate-id(key('index_data_field_tag', @tag)[1])]"> |
333 |
<xsl:for-each select="//kohaidx:index_data_field[generate-id() = generate-id(key('index_data_field_tag', @tag)[1])]"> |
293 |
<xslo:template mode="index_data_field"> |
334 |
<xslo:template mode="index_data_field"> |
Lines 475-478
definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
Link Here
|
475 |
<xsl:value-of select="." /><xsl:text> </xsl:text> |
516 |
<xsl:value-of select="." /><xsl:text> </xsl:text> |
476 |
</xsl:for-each> |
517 |
</xsl:for-each> |
477 |
</xsl:template> |
518 |
</xsl:template> |
|
|
519 |
|
520 |
<xsl:template name="get-facets-target-indexes"> |
521 |
<xsl:for-each select="target_index"> |
522 |
<xsl:value-of select="." /><xsl:text> </xsl:text> |
523 |
</xsl:for-each> |
524 |
</xsl:template> |
525 |
|
526 |
<!-- traverse subfields string character-wise --> |
527 |
<xsl:template name="build-facet-value"> |
528 |
<xsl:param name="subfields"/> |
529 |
<xsl:if test="string-length($subfields) > 0"> |
530 |
<xslo:value-of> |
531 |
<xsl:attribute name="select"> |
532 |
<xsl:text>marc:subfield[@code='</xsl:text> |
533 |
<xsl:value-of select="substring($subfields,1,1)"/> |
534 |
<xsl:text>']</xsl:text> |
535 |
</xsl:attribute> |
536 |
</xslo:value-of> |
537 |
<xsl:call-template name="build-facet-value-cont"> |
538 |
<xsl:with-param name="prev" select="substring($subfields,1,1)"/> |
539 |
<xsl:with-param name="subfields" select="substring($subfields,2)"/> |
540 |
</xsl:call-template> |
541 |
</xsl:if> |
542 |
</xsl:template> |
543 |
|
544 |
<xsl:template name="build-facet-value-cont"> |
545 |
<xsl:param name="prev"/> |
546 |
<xsl:param name="subfields"/> |
547 |
<xsl:if test="string-length($subfields) > 0"> |
548 |
<xslo:if> |
549 |
<xsl:attribute name="test"> |
550 |
<xsl:text>marc:subfield[@code='</xsl:text> |
551 |
<xsl:value-of select="$prev"/> |
552 |
<xsl:text>'] and marc:subfield[@code='</xsl:text> |
553 |
<xsl:value-of select="substring($subfields,1,1)"/> |
554 |
<xsl:text>']</xsl:text> |
555 |
</xsl:attribute> |
556 |
<xslo:text>::*::</xslo:text> |
557 |
</xslo:if> |
558 |
<xslo:value-of> |
559 |
<xsl:attribute name="select"> |
560 |
<xsl:text>marc:subfield[@code='</xsl:text> |
561 |
<xsl:value-of select="substring($subfields,1,1)"/> |
562 |
<xsl:text>']</xsl:text> |
563 |
</xsl:attribute> |
564 |
</xslo:value-of> |
565 |
<xsl:call-template name="build-facet-value-cont"> |
566 |
<xsl:with-param name="prev" select="substring($subfields,1,1)"/> |
567 |
<xsl:with-param name="subfields" select="substring($subfields,2)"/> |
568 |
</xsl:call-template> |
569 |
</xsl:if> |
570 |
</xsl:template> |
571 |
|
478 |
</xsl:stylesheet> |
572 |
</xsl:stylesheet> |
479 |
- |
|
|