1 <?xml version=
"1.0" encoding=
"utf-8"?>
4 The contents of this file are subject to the license and copyright
5 detailed in the LICENSE and NOTICE files at the root of the source
6 tree and available online at
8 http://www.dspace.org/license/
11 <xsl:stylesheet version=
"1.0"
12 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" xmlns:
oai=
"http://www.openarchives.org/OAI/2.0/"
13 xmlns:
koha=
"http://koha-community.org" xmlns:
oai_dc=
"http://www.openarchives.org/OAI/2.0/oai_dc/"
14 xmlns:
dc=
"http://purl.org/dc/doc:elements/1.1/" xmlns:
marc=
"http://www.loc.gov/MARC21/slim"
15 xmlns:
verb=
"http://informatik.hu-berlin.de/xmlverbatim"
16 xmlns:
oai_id=
"http://www.openarchives.org/OAI/2.0/oai-identifier"
17 exclude-result-prefixes=
"oai oai_dc dc marc marcxml verb oai_id">
19 <xsl:output method=
"html" doctype-public=
"-//W3C//DTD HTML 4.01//EN" doctype-system=
"http://www.w3.org/TR/html4/strict.dtd" />
21 <xsl:variable name=
"oai_script_name">/cgi-bin/koha/oai.pl
</xsl:variable>
23 <xsl:template match=
"/">
26 <title>Koha OAI-PMH Data Provider
</title>
27 <meta name=
"viewport" content=
"width=device-width, initial-scale=1.0" />
28 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
29 <script src=
"/opac-tmpl/bootstrap/lib/jquery/jquery-3.4.1.min.js"></script>
30 <script src=
"/opac-tmpl/bootstrap/lib/jquery/jquery-migrate-3.1.0.min.js"></script>
31 <script src=
"/opac-tmpl/bootstrap/lib/bootstrap/js/bootstrap.min.js"></script>
32 <link rel=
"stylesheet" href=
"/opac-tmpl/bootstrap/css/bootstrap-theme-oai.css" type=
"text/css" />
33 <link rel=
"stylesheet" href=
"/opac-tmpl/bootstrap/css/oai.css" type=
"text/css" />
36 <div class=
"container">
37 <div class=
"navbar navbar-default" role=
"navigation">
38 <div class=
"navbar-header">
39 <a class=
"navbar-brand" href=
"#">Koha OAI-PMH Data Provider
</a>
41 <div class=
"navbar-collapse collapse">
42 <ul class=
"nav navbar-nav navbar-right">
44 <a title=
"Institutional information">
45 <xsl:if test=
"/oai:OAI-PMH/oai:request/@verb = 'Identify'">
46 <xsl:attribute name=
"class">active
</xsl:attribute>
48 <xsl:attribute name=
"href">
50 select=
"concat($oai_script_name,'?verb=Identify')"></xsl:value-of>
56 <a title=
"Listing available sets">
57 <xsl:if test=
"/oai:OAI-PMH/oai:request/@verb = 'ListSets'">
58 <xsl:attribute name=
"class">active
</xsl:attribute>
60 <xsl:attribute name=
"href">
62 select=
"concat($oai_script_name, '?verb=ListSets')"></xsl:value-of>
68 <a title=
"Listing records (with metadata)">
69 <xsl:if test=
"/oai:OAI-PMH/oai:request/@verb = 'ListRecords'">
70 <xsl:attribute name=
"class">active
</xsl:attribute>
72 <xsl:attribute name=
"href">
74 select=
"concat($oai_script_name, '?verb=ListRecords&metadataPrefix=oai_dc')"></xsl:value-of>
80 <a title=
"Listing identifiers only">
81 <xsl:if test=
"/oai:OAI-PMH/oai:request/@verb = 'ListIdentifiers'">
82 <xsl:attribute name=
"class">active
</xsl:attribute>
84 <xsl:attribute name=
"href">
86 select=
"concat($oai_script_name, '?verb=ListIdentifiers&metadataPrefix=oai_dc')"></xsl:value-of>
92 <a title=
"Metadata Formats available">
94 test=
"/oai:OAI-PMH/oai:request/@verb = 'ListMetadataFormats'">
95 <xsl:attribute name=
"class">active
</xsl:attribute>
97 <xsl:attribute name=
"href">
99 select=
"concat($oai_script_name, '?verb=ListMetadataFormats')"></xsl:value-of>
105 </div><!--/.nav-collapse -->
108 <div class=
"col-lg-offset-1 col-lg-10">
110 <h5>Response Date
<small><xsl:value-of select=
"translate(oai:OAI-PMH/oai:responseDate/text(), 'TZ', ' ')" /></small></h5>
113 <xsl:apply-templates select=
"oai:OAI-PMH/oai:error" />
114 <xsl:apply-templates select=
"oai:OAI-PMH/oai:Identify" />
115 <xsl:apply-templates select=
"oai:OAI-PMH/oai:ListSets" />
116 <xsl:apply-templates select=
"oai:OAI-PMH/oai:ListRecords" />
117 <xsl:apply-templates select=
"oai:OAI-PMH/oai:ListIdentifiers" />
118 <xsl:apply-templates select=
"oai:OAI-PMH/oai:ListMetadataFormats" />
119 <xsl:apply-templates select=
"oai:OAI-PMH/oai:GetRecord" />
124 <div class=
"row-fluid text-center">
125 <div class=
"vertical-space"></div>
126 <p><small>Powered by
<a href=
"http://koha-community.org">Koha
</a></small></p>
133 <xsl:template match=
"oai:OAI-PMH/oai:error">
134 <div class=
"alert alert-danger">
137 <xsl:value-of select=
"text()"></xsl:value-of>
142 <xsl:template match=
"oai:OAI-PMH/oai:Identify">
143 <h2>Repository Information
</h2>
145 <table class=
"table table-striped table-bordered">
147 <td><strong>Repository Name
</strong></td>
148 <td><xsl:value-of select=
"oai:repositoryName/text()" /></td>
150 <xsl:for-each select=
"oai:adminEmail">
152 <td><strong>E-Mail Contact
</strong></td>
155 <xsl:attribute name=
"href">
156 <xsl:value-of select=
"concat('mailto:', text())" />
158 <xsl:value-of select=
"text()" />
164 <td><strong>Repository identifier
</strong></td>
166 <xsl:value-of select=
"oai:description/oai_id:oai-identifier/oai_id:repositoryIdentifier/text()" />
170 <td><strong>Sample identifier
</strong></td>
173 select=
"oai:description/oai_id:oai-identifier/oai_id:sampleIdentifier/text()" />
177 <td><strong>Protocol Version
</strong></td>
180 select=
"oai:protocolVersion/text()" />
185 <td><strong>Earliest Registered Date
</strong></td>
188 select=
"translate(oai:earliestDatestamp/text(), 'TZ' ,' ')" />
193 <td><strong>Date Granularity
</strong></td>
196 select=
"translate(oai:granularity/text(), 'TZ', ' ')" />
201 <td><strong>Deletion Mode
</strong></td>
204 select=
"oai:deletedRecord/text()" />
211 <xsl:template match=
"oai:OAI-PMH/oai:ListSets">
212 <h2>List of Sets
</h2>
214 <div class=
"well well-sm">
217 <xsl:call-template name=
"result-count">
218 <xsl:with-param name=
"path" select=
"oai:set" />
223 <div class=
"list-group">
224 <xsl:for-each select=
"oai:set">
225 <div class=
"list-group-item">
226 <h5 class=
"list-group-item-heading">
228 <xsl:when test=
"string-length(oai:setName/text()) > 83">
229 <xsl:value-of select=
"substring(oai:setName/text(),0, 80 )" />
233 <xsl:value-of select=
"oai:setName/text()" />
237 [
<xsl:value-of select=
"oai:setSpec/text()" />]
242 <xsl:attribute name=
"href">
244 select=
"concat($oai_script_name, '?verb=ListRecords&metadataPrefix=oai_dc&set=', oai:setSpec/text())" />
249 <xsl:attribute name=
"href">
251 select=
"concat($oai_script_name, '?verb=ListIdentifiers&metadataPrefix=oai_dc&set=', oai:setSpec/text())" />
260 <xsl:apply-templates select=
"oai:resumptionToken"/>
263 <xsl:template match=
"oai:OAI-PMH/oai:ListRecords">
264 <h2>List of Records
</h2>
266 <div class=
"well well-sm">
269 <xsl:call-template name=
"result-count">
270 <xsl:with-param name=
"path" select=
"oai:record" />
275 <xsl:for-each select=
"oai:record">
276 <div class=
"panel panel-default">
277 <div class=
"panel-heading">
279 <div class=
"col-lg-6">
280 <h5>Identifier
<small><xsl:value-of select=
"oai:header/oai:identifier/text()"></xsl:value-of></small></h5>
282 <div class=
"col-lg-6">
283 <h5>Last Modified
<small><xsl:value-of select=
"translate(oai:header/oai:datestamp/text(), 'TZ', ' ')"></xsl:value-of></small></h5>
287 <div class=
"panel-body">
288 <!-- If this record has a "status", display it as a warning -->
289 <xsl:if test=
"oai:header/@status">
290 <div class=
"alert alert-warning">Record Status:
<xsl:value-of select=
"oai:header/@status"/></div>
292 <div class=
"panel panel-success">
293 <a data-toggle=
"collapse">
294 <xsl:attribute name=
"href">#sets
<xsl:value-of select=
"translate(oai:header/oai:identifier/text(), ':/.', '')"></xsl:value-of></xsl:attribute>
295 <div class=
"panel-heading">
296 <h5 class=
"panel-title">
301 <div class=
"panel-collapse collapse">
302 <xsl:attribute name=
"id">sets
<xsl:value-of select=
"translate(oai:header/oai:identifier/text(), ':/.', '')"></xsl:value-of></xsl:attribute>
303 <div class=
"panel-body list-group">
304 <xsl:for-each select=
"oai:header/oai:setSpec">
305 <div class=
"list-group-item">
307 <xsl:attribute name=
"href">
309 select=
"concat($oai_script_name, '?verb=ListRecords&metadataPrefix=oai_dc&set=', text())" />
311 <xsl:value-of select=
"text()" />
318 <div class=
"panel panel-info">
319 <a data-toggle=
"collapse">
320 <xsl:attribute name=
"href">#
<xsl:value-of select=
"translate(oai:header/oai:identifier/text(), ':/.', '')"></xsl:value-of></xsl:attribute>
321 <div class=
"panel-heading">
322 <h5 class=
"panel-title">
327 <div class=
"panel-collapse collapse">
328 <xsl:attribute name=
"id"><xsl:value-of select=
"translate(oai:header/oai:identifier/text(), ':/.', '')"></xsl:value-of></xsl:attribute>
329 <div class=
"panel-body">
330 <xsl:apply-templates select=
"oai:metadata/*" />
338 <xsl:apply-templates select=
"oai:resumptionToken"/>
341 <xsl:template match=
"oai:OAI-PMH/oai:GetRecord">
342 <h2>Record Details
</h2>
344 <xsl:for-each select=
"oai:record">
345 <div class=
"panel panel-default">
346 <div class=
"panel-heading">
348 <div class=
"col-lg-6">
349 <h5>Identifier
<small><xsl:value-of select=
"oai:header/oai:identifier/text()"></xsl:value-of></small></h5>
351 <div class=
"col-lg-6">
352 <h5>Last Modified
<small><xsl:value-of select=
"translate(oai:header/oai:datestamp/text(), 'TZ', ' ')"></xsl:value-of></small></h5>
356 <div class=
"panel-body">
357 <!-- If this record has a "status", display it as a warning -->
358 <xsl:if test=
"oai:header/@status">
359 <div class=
"alert alert-warning">Record Status:
<xsl:value-of select=
"oai:header/@status"/></div>
361 <div class=
"panel panel-success">
362 <div class=
"panel-heading">
363 <h5 class=
"panel-title">
367 <div class=
"panel-body list-group">
368 <xsl:for-each select=
"oai:header/oai:setSpec">
369 <div class=
"list-group-item">
371 <xsl:attribute name=
"href">
373 select=
"concat($oai_script_name, '?verb=ListRecords&metadataPrefix=oai_dc&set=', text())" />
375 <xsl:value-of select=
"text()" />
381 <div class=
"panel panel-info">
382 <div class=
"panel-heading">
383 <h5 class=
"panel-title">
387 <div class=
"panel-body">
388 <xsl:apply-templates select=
"oai:metadata/*" />
396 <xsl:template match=
"oai:OAI-PMH/oai:ListIdentifiers">
397 <h2>List of Identifiers
</h2>
399 <div class=
"well well-sm">
402 <xsl:call-template name=
"result-count">
403 <xsl:with-param name=
"path" select=
"oai:header" />
408 <xsl:for-each select=
"oai:header">
409 <div class=
"panel panel-default">
410 <div class=
"panel-heading">
412 <div class=
"col-lg-4">
413 <h5>Identifier
<small><xsl:value-of select=
"oai:identifier/text()"></xsl:value-of></small></h5>
415 <div class=
"col-lg-4">
416 <h5>Last Modified
<small><xsl:value-of select=
"translate(oai:datestamp/text(), 'TZ', ' ')"></xsl:value-of></small></h5>
418 <div class=
"col-lg-4">
419 <a class=
"btn btn-default pull-right">
420 <xsl:attribute name=
"href">
421 <xsl:value-of select=
"concat($oai_script_name, '?verb=GetRecord&metadataPrefix=oai_dc&identifier=', oai:identifier/text())" />
428 <div class=
"panel-body">
429 <!-- If this record has a "status", display it as a warning -->
430 <xsl:if test=
"@status">
431 <div class=
"alert alert-warning">Record Status:
<xsl:value-of select=
"@status"/></div>
433 <div class=
"panel panel-success">
434 <a data-toggle=
"collapse">
435 <xsl:attribute name=
"href">#sets
<xsl:value-of select=
"translate(oai:identifier/text(), ':/.', '')"></xsl:value-of></xsl:attribute>
436 <div class=
"panel-heading">
437 <h5 class=
"panel-title">
442 <div class=
"panel-collapse collapse">
443 <xsl:attribute name=
"id">sets
<xsl:value-of select=
"translate(oai:identifier/text(), ':/.', '')"></xsl:value-of></xsl:attribute>
444 <div class=
"panel-body list-group">
445 <xsl:for-each select=
"oai:setSpec">
446 <div class=
"list-group-item">
448 <xsl:attribute name=
"href">
450 select=
"concat($oai_script_name, '?verb=ListRecords&metadataPrefix=oai_dc&set=', text())" />
452 <xsl:value-of select=
"text()" />
463 <xsl:apply-templates select=
"oai:resumptionToken"/>
466 <xsl:template match=
"oai:OAI-PMH/oai:ListMetadataFormats">
467 <h2>List of Metadata Formats
</h2>
469 <div class=
"well well-sm">
472 <xsl:value-of select=
"count(oai:OAI-PMH/oai:ListMetadataFormats/oai:metadataFormat)" />
476 <xsl:for-each select=
"oai:metadataFormat">
477 <div class=
"panel panel-default">
478 <div class=
"panel-heading">
480 <div class=
"col-lg-9">
481 <h5><xsl:value-of select=
"oai:metadataPrefix/text()"></xsl:value-of></h5>
483 <div class=
"col-lg-3">
484 <a class=
"btn btn-default pull-right">
485 <xsl:attribute name=
"href">
487 select=
"concat($oai_script_name, '?verb=ListRecords&metadataPrefix=', oai:metadataPrefix/text())" />
494 <div class=
"panel-body">
496 <div class=
"col-lg-9">
497 <h5>Namespace
<small><xsl:value-of select=
"oai:metadataNamespace/text()"></xsl:value-of></small></h5>
498 <h5>Schema
<small><xsl:value-of select=
"oai:schema/text()"></xsl:value-of></small></h5>
506 <xsl:template match=
"oai:resumptionToken">
507 <xsl:if test=
"text() != ''">
508 <div class=
"text-center">
509 <a class=
"btn btn-primary">
510 <xsl:attribute name=
"href">
511 <xsl:value-of select=
"concat($oai_script_name, '?verb=',/oai:OAI-PMH/oai:request/@verb,'&resumptionToken=', text())"></xsl:value-of>
519 <xsl:template name=
"result-count">
520 <xsl:param name=
"path" />
521 <xsl:variable name=
"cursor" select=
"$path/../oai:resumptionToken/@cursor" />
522 <xsl:variable name=
"count" select=
"count($path)" />
523 <xsl:variable name=
"total" select=
"$path/../oai:resumptionToken/@completeListSize" />
525 <xsl:when test=
"$cursor">
527 <xsl:when test=
"normalize-space($path/../oai:resumptionToken/text()) = ''">
528 <!-- on the last page of results we have to assume that @completeListSize is available -->
530 select=
"$total - $count" />
532 <xsl:value-of select=
"$total" />
535 <xsl:value-of select=
"$cursor + 1 - $count" />
537 <xsl:value-of select=
"$cursor" />
542 <xsl:value-of select=
"$count" />
545 <xsl:if test=
"$total">
547 <xsl:value-of select=
"$total" />
551 <xsl:template match=
"oai:metadata/*" priority='-
20'
>
552 <xsl:apply-templates select=
"." mode='xmlverb'
/>
555 <xsl:param name=
"indent-elements" select=
"false()" />
557 <xsl:template match=
"/" mode=
"xmlverb">
558 <xsl:text>
</xsl:text>
560 <xsl:text> converted by xmlverbatim.xsl
1.1, (c) O. Becker
</xsl:text>
562 <xsl:text>
</xsl:text>
563 <div class=
"xmlverb-default">
564 <xsl:apply-templates mode=
"xmlverb">
565 <xsl:with-param name=
"indent-elements" select=
"$indent-elements" />
566 </xsl:apply-templates>
568 <xsl:text>
</xsl:text>
572 <xsl:template match=
"verb:wrapper">
573 <xsl:apply-templates mode=
"xmlverb">
574 <xsl:with-param name=
"indent-elements" select=
"$indent-elements" />
575 </xsl:apply-templates>
578 <xsl:template match=
"verb:wrapper" mode=
"xmlverb">
579 <xsl:apply-templates mode=
"xmlverb">
580 <xsl:with-param name=
"indent-elements" select=
"$indent-elements" />
581 </xsl:apply-templates>
584 <!-- element nodes -->
585 <xsl:template match=
"*" mode=
"xmlverb">
586 <xsl:param name=
"indent-elements" select=
"true()" />
587 <xsl:param name=
"indent" select=
"''" />
588 <xsl:param name=
"indent-increment" select=
"'   '" />
589 <xsl:if test=
"$indent-elements">
591 <xsl:value-of select=
"$indent" />
593 <xsl:text><</xsl:text>
594 <xsl:variable name=
"ns-prefix"
595 select=
"substring-before(name(),':')" />
596 <xsl:if test=
"$ns-prefix != ''">
597 <span class=
"xmlverb-element-nsprefix">
598 <xsl:value-of select=
"$ns-prefix"/>
600 <xsl:text>:
</xsl:text>
602 <span class=
"xmlverb-element-name">
603 <xsl:value-of select=
"local-name()"/>
605 <xsl:variable name=
"pns" select=
"../namespace::*"/>
606 <xsl:if test=
"$pns[name()=''] and not(namespace::*[name()=''])">
607 <span class=
"xmlverb-ns-name">
608 <xsl:text> xmlns
</xsl:text>
610 <xsl:text>=
""</xsl:text>
612 <xsl:for-each select=
"namespace::*">
613 <xsl:if test=
"not($pns[name()=name(current()) and
615 <xsl:call-template name=
"xmlverb-ns" />
618 <xsl:for-each select=
"@*">
619 <xsl:call-template name=
"xmlverb-attrs" />
622 <xsl:when test=
"node()">
623 <xsl:text>></xsl:text>
624 <xsl:apply-templates mode=
"xmlverb">
625 <xsl:with-param name=
"indent-elements"
626 select=
"$indent-elements"/>
627 <xsl:with-param name=
"indent"
628 select=
"concat($indent, $indent-increment)"/>
629 <xsl:with-param name=
"indent-increment"
630 select=
"$indent-increment"/>
631 </xsl:apply-templates>
632 <xsl:if test=
"* and $indent-elements">
634 <xsl:value-of select=
"$indent" />
636 <xsl:text></
</xsl:text>
637 <xsl:if test=
"$ns-prefix != ''">
638 <span class=
"xmlverb-element-nsprefix">
639 <xsl:value-of select=
"$ns-prefix"/>
641 <xsl:text>:
</xsl:text>
643 <span class=
"xmlverb-element-name">
644 <xsl:value-of select=
"local-name()"/>
646 <xsl:text>></xsl:text>
649 <xsl:text> /
></xsl:text>
652 <xsl:if test=
"not(parent::*)"><br /><xsl:text>
</xsl:text></xsl:if>
655 <!-- attribute nodes -->
656 <xsl:template name=
"xmlverb-attrs">
657 <xsl:text> </xsl:text>
658 <span class=
"xmlverb-attr-name">
659 <xsl:value-of select=
"name()"/>
661 <xsl:text>=
"</xsl:text>
662 <span class=
"xmlverb-attr-content">
663 <xsl:call-template name=
"html-replace-entities">
664 <xsl:with-param name=
"text" select=
"normalize-space(.)" />
665 <xsl:with-param name=
"attrs" select=
"true()" />
668 <xsl:text>"</xsl:text>
671 <!-- namespace nodes -->
672 <xsl:template name=
"xmlverb-ns">
673 <xsl:if test=
"name()!='xml'">
674 <span class=
"xmlverb-ns-name">
675 <xsl:text> xmlns
</xsl:text>
676 <xsl:if test=
"name()!=''">
677 <xsl:text>:
</xsl:text>
679 <xsl:value-of select=
"name()"/>
681 <xsl:text>=
"</xsl:text>
682 <span class=
"xmlverb-ns-uri">
683 <xsl:value-of select=
"."/>
685 <xsl:text>"</xsl:text>
690 <xsl:template match=
"text()" mode=
"xmlverb">
691 <span class=
"xmlverb-text">
692 <xsl:call-template name=
"preformatted-output">
693 <xsl:with-param name=
"text">
694 <xsl:call-template name=
"html-replace-entities">
695 <xsl:with-param name=
"text" select=
"." />
703 <xsl:template match=
"comment()" mode=
"xmlverb">
704 <xsl:text><!--
</xsl:text>
705 <span class=
"xmlverb-comment">
706 <xsl:call-template name=
"preformatted-output">
707 <xsl:with-param name=
"text" select=
"." />
710 <xsl:text>--
></xsl:text>
711 <xsl:if test=
"not(parent::*)"><br /><xsl:text>
</xsl:text></xsl:if>
714 <!-- processing instructions -->
715 <xsl:template match=
"processing-instruction()" mode=
"xmlverb">
716 <xsl:text><?
</xsl:text>
717 <span class=
"xmlverb-pi-name">
718 <xsl:value-of select=
"name()"/>
720 <xsl:if test=
".!=''">
721 <xsl:text> </xsl:text>
722 <span class=
"xmlverb-pi-content">
723 <xsl:value-of select=
"."/>
726 <xsl:text>?
></xsl:text>
727 <xsl:if test=
"not(parent::*)"><br /><xsl:text>
</xsl:text></xsl:if>
731 <!-- =========================================================== -->
732 <!-- Procedures / Functions -->
733 <!-- =========================================================== -->
735 <!-- generate entities by replacing &, ", < and > in $text -->
736 <xsl:template name=
"html-replace-entities">
737 <xsl:param name=
"text" />
738 <xsl:param name=
"attrs" />
739 <xsl:variable name=
"tmp">
740 <xsl:call-template name=
"replace-substring">
741 <xsl:with-param name=
"from" select=
"'>'" />
742 <xsl:with-param name=
"to" select=
"'&gt;'" />
743 <xsl:with-param name=
"value">
744 <xsl:call-template name=
"replace-substring">
745 <xsl:with-param name=
"from" select=
"'<'" />
746 <xsl:with-param name=
"to" select=
"'&lt;'" />
747 <xsl:with-param name=
"value">
748 <xsl:call-template name=
"replace-substring">
749 <xsl:with-param name=
"from"
751 <xsl:with-param name=
"to"
752 select=
"'&amp;'" />
753 <xsl:with-param name=
"value"
762 <!-- $text is an attribute value -->
763 <xsl:when test=
"$attrs">
764 <xsl:call-template name=
"replace-substring">
765 <xsl:with-param name=
"from" select=
"'
'" />
766 <xsl:with-param name=
"to" select=
"'&#xA;'" />
767 <xsl:with-param name=
"value">
768 <xsl:call-template name=
"replace-substring">
769 <xsl:with-param name=
"from"
771 <xsl:with-param name=
"to"
772 select=
"'&quot;'" />
773 <xsl:with-param name=
"value" select=
"$tmp" />
779 <xsl:value-of select=
"$tmp" />
784 <!-- replace in $value substring $from with $to -->
785 <xsl:template name=
"replace-substring">
786 <xsl:param name=
"value" />
787 <xsl:param name=
"from" />
788 <xsl:param name=
"to" />
790 <xsl:when test=
"contains($value,$from)">
791 <xsl:value-of select=
"substring-before($value,$from)" />
792 <xsl:value-of select=
"$to" />
793 <xsl:call-template name=
"replace-substring">
794 <xsl:with-param name=
"value"
795 select=
"substring-after($value,$from)" />
796 <xsl:with-param name=
"from" select=
"$from" />
797 <xsl:with-param name=
"to" select=
"$to" />
801 <xsl:value-of select=
"$value" />
806 <!-- preformatted output: space as , tab as 8
808 <xsl:template name=
"preformatted-output">
809 <xsl:param name=
"text" />
810 <xsl:call-template name=
"output-nl">
811 <xsl:with-param name=
"text">
812 <xsl:call-template name=
"replace-substring">
813 <xsl:with-param name=
"value"
814 select=
"translate($text,' ',' ')" />
815 <xsl:with-param name=
"from" select=
"'	'" />
816 <xsl:with-param name=
"to"
817 select=
"'        '" />
823 <!-- output nl as <br> -->
824 <xsl:template name=
"output-nl">
825 <xsl:param name=
"text" />
827 <xsl:when test=
"contains($text,'
')">
828 <xsl:value-of select=
"substring-before($text,'
')" />
830 <xsl:text>
</xsl:text>
831 <xsl:call-template name=
"output-nl">
832 <xsl:with-param name=
"text"
833 select=
"substring-after($text,'
')" />
837 <xsl:value-of select=
"$text" />