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/lib/jquery/jquery-3.6.0.min.js"></script>
30 <script src="/opac-tmpl/lib/jquery/jquery-migrate-3.3.2.min.js"></script>
31 <script src="/opac-tmpl/lib/bootstrap/js/bootstrap.bundle.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/*" />
334 <xsl:if test="oai:about">
335 <div class="panel panel-success">
336 <a data-toggle="collapse">
337 <xsl:attribute name="href">#about<xsl:value-of select="translate(oai:header/oai:identifier/text(), ':/.', '')"></xsl:value-of></xsl:attribute>
338 <div class="panel-heading">
339 <h5 class="panel-title">
344 <div class="panel-collapse collapse">
345 <xsl:attribute name="id">about<xsl:value-of select="translate(oai:header/oai:identifier/text(), ':/.', '')"></xsl:value-of></xsl:attribute>
346 <div class="panel-body list-group">
347 <xsl:for-each select="oai:about">
348 <div class="list-group-item">
351 <xsl:when test="text()='INVALID_METADATA'">
352 There was a problem decoding the metadata for this record, an attempt was made to ignore invalid characters, the metadata view may be degraded. See system logs for details
355 <xsl:value-of select="text()" />
369 <xsl:apply-templates select="oai:resumptionToken"/>
372 <xsl:template match="oai:OAI-PMH/oai:GetRecord">
373 <h2>Record Details</h2>
375 <xsl:for-each select="oai:record">
376 <div class="panel panel-default">
377 <div class="panel-heading">
379 <div class="col-lg-6">
380 <h5>Identifier <small><xsl:value-of select="oai:header/oai:identifier/text()"></xsl:value-of></small></h5>
382 <div class="col-lg-6">
383 <h5>Last Modified <small><xsl:value-of select="translate(oai:header/oai:datestamp/text(), 'TZ', ' ')"></xsl:value-of></small></h5>
387 <div class="panel-body">
388 <!-- If this record has a "status", display it as a warning -->
389 <xsl:if test="oai:header/@status">
390 <div class="alert alert-warning">Record Status: <xsl:value-of select="oai:header/@status"/></div>
392 <div class="panel panel-success">
393 <div class="panel-heading">
394 <h5 class="panel-title">
398 <div class="panel-body list-group">
399 <xsl:for-each select="oai:header/oai:setSpec">
400 <div class="list-group-item">
402 <xsl:attribute name="href">
404 select="concat($oai_script_name, '?verb=ListRecords&metadataPrefix=oai_dc&set=', text())" />
406 <xsl:value-of select="text()" />
412 <div class="panel panel-info">
413 <div class="panel-heading">
414 <h5 class="panel-title">
418 <div class="panel-body">
419 <xsl:apply-templates select="oai:metadata/*" />
422 <xsl:if test="oai:about">
423 <div class="panel panel-info">
424 <div class="panel-heading">
425 <h5 class="panel-title">
429 <div class="panel-body list-group">
430 <xsl:for-each select="oai:about">
431 <div class="list-group-item">
434 <xsl:when test="text()='INVALID_METADATA'">
435 There was a problem decoding the metadata for this record, invalid characters were stripped. See system logs for details
438 <xsl:value-of select="text()" />
452 <xsl:template match="oai:OAI-PMH/oai:ListIdentifiers">
453 <h2>List of Identifiers</h2>
455 <div class="well well-sm">
458 <xsl:call-template name="result-count">
459 <xsl:with-param name="path" select="oai:header" />
464 <xsl:for-each select="oai:header">
465 <div class="panel panel-default">
466 <div class="panel-heading">
468 <div class="col-lg-4">
469 <h5>Identifier <small><xsl:value-of select="oai:identifier/text()"></xsl:value-of></small></h5>
471 <div class="col-lg-4">
472 <h5>Last Modified <small><xsl:value-of select="translate(oai:datestamp/text(), 'TZ', ' ')"></xsl:value-of></small></h5>
474 <div class="col-lg-4">
475 <a class="btn btn-default pull-right">
476 <xsl:attribute name="href">
477 <xsl:value-of select="concat($oai_script_name, '?verb=GetRecord&metadataPrefix=oai_dc&identifier=', oai:identifier/text())" />
484 <div class="panel-body">
485 <!-- If this record has a "status", display it as a warning -->
486 <xsl:if test="@status">
487 <div class="alert alert-warning">Record Status: <xsl:value-of select="@status"/></div>
489 <div class="panel panel-success">
490 <a data-toggle="collapse">
491 <xsl:attribute name="href">#sets<xsl:value-of select="translate(oai:identifier/text(), ':/.', '')"></xsl:value-of></xsl:attribute>
492 <div class="panel-heading">
493 <h5 class="panel-title">
498 <div class="panel-collapse collapse">
499 <xsl:attribute name="id">sets<xsl:value-of select="translate(oai:identifier/text(), ':/.', '')"></xsl:value-of></xsl:attribute>
500 <div class="panel-body list-group">
501 <xsl:for-each select="oai:setSpec">
502 <div class="list-group-item">
504 <xsl:attribute name="href">
506 select="concat($oai_script_name, '?verb=ListRecords&metadataPrefix=oai_dc&set=', text())" />
508 <xsl:value-of select="text()" />
519 <xsl:apply-templates select="oai:resumptionToken"/>
522 <xsl:template match="oai:OAI-PMH/oai:ListMetadataFormats">
523 <h2>List of Metadata Formats</h2>
525 <div class="well well-sm">
528 <xsl:value-of select="count(oai:OAI-PMH/oai:ListMetadataFormats/oai:metadataFormat)" />
532 <xsl:for-each select="oai:metadataFormat">
533 <div class="panel panel-default">
534 <div class="panel-heading">
536 <div class="col-lg-9">
537 <h5><xsl:value-of select="oai:metadataPrefix/text()"></xsl:value-of></h5>
539 <div class="col-lg-3">
540 <a class="btn btn-default pull-right">
541 <xsl:attribute name="href">
543 select="concat($oai_script_name, '?verb=ListRecords&metadataPrefix=', oai:metadataPrefix/text())" />
550 <div class="panel-body">
552 <div class="col-lg-9">
553 <h5>Namespace <small><xsl:value-of select="oai:metadataNamespace/text()"></xsl:value-of></small></h5>
554 <h5>Schema <small><xsl:value-of select="oai:schema/text()"></xsl:value-of></small></h5>
562 <xsl:template match="oai:resumptionToken">
563 <xsl:if test="text() != ''">
564 <div class="text-center">
565 <a class="btn btn-primary">
566 <xsl:attribute name="href">
567 <xsl:value-of select="concat($oai_script_name, '?verb=',/oai:OAI-PMH/oai:request/@verb,'&resumptionToken=', text())"></xsl:value-of>
575 <xsl:template name="result-count">
576 <xsl:param name="path" />
577 <xsl:variable name="cursor" select="$path/../oai:resumptionToken/@cursor" />
578 <xsl:variable name="count" select="count($path)" />
579 <xsl:variable name="total" select="$path/../oai:resumptionToken/@completeListSize" />
581 <xsl:when test="$cursor">
583 <xsl:when test="normalize-space($path/../oai:resumptionToken/text()) = ''">
584 <!-- on the last page of results we have to assume that @completeListSize is available -->
586 select="$total - $count" />
588 <xsl:value-of select="$total" />
591 <xsl:value-of select="$cursor + 1 - $count" />
593 <xsl:value-of select="$cursor" />
598 <xsl:value-of select="$count" />
601 <xsl:if test="$total">
603 <xsl:value-of select="$total" />
607 <xsl:template match="oai:metadata/*" priority='-20'>
608 <xsl:apply-templates select="." mode='xmlverb' />
611 <xsl:param name="indent-elements" select="false()" />
613 <xsl:template match="/" mode="xmlverb">
614 <xsl:text>
</xsl:text>
616 <xsl:text> converted by xmlverbatim.xsl 1.1, (c) O. Becker </xsl:text>
618 <xsl:text>
</xsl:text>
619 <div class="xmlverb-default">
620 <xsl:apply-templates mode="xmlverb">
621 <xsl:with-param name="indent-elements" select="$indent-elements" />
622 </xsl:apply-templates>
624 <xsl:text>
</xsl:text>
628 <xsl:template match="verb:wrapper">
629 <xsl:apply-templates mode="xmlverb">
630 <xsl:with-param name="indent-elements" select="$indent-elements" />
631 </xsl:apply-templates>
634 <xsl:template match="verb:wrapper" mode="xmlverb">
635 <xsl:apply-templates mode="xmlverb">
636 <xsl:with-param name="indent-elements" select="$indent-elements" />
637 </xsl:apply-templates>
640 <!-- element nodes -->
641 <xsl:template match="*" mode="xmlverb">
642 <xsl:param name="indent-elements" select="true()" />
643 <xsl:param name="indent" select="''" />
644 <xsl:param name="indent-increment" select="'   '" />
645 <xsl:if test="$indent-elements">
647 <xsl:value-of select="$indent" />
649 <xsl:text><</xsl:text>
650 <xsl:variable name="ns-prefix"
651 select="substring-before(name(),':')" />
652 <xsl:if test="$ns-prefix != ''">
653 <span class="xmlverb-element-nsprefix">
654 <xsl:value-of select="$ns-prefix"/>
656 <xsl:text>:</xsl:text>
658 <span class="xmlverb-element-name">
659 <xsl:value-of select="local-name()"/>
661 <xsl:variable name="pns" select="../namespace::*"/>
662 <xsl:if test="$pns[name()=''] and not(namespace::*[name()=''])">
663 <span class="xmlverb-ns-name">
664 <xsl:text> xmlns</xsl:text>
666 <xsl:text>=""</xsl:text>
668 <xsl:for-each select="namespace::*">
669 <xsl:if test="not($pns[name()=name(current()) and
671 <xsl:call-template name="xmlverb-ns" />
674 <xsl:for-each select="@*">
675 <xsl:call-template name="xmlverb-attrs" />
678 <xsl:when test="node()">
679 <xsl:text>></xsl:text>
680 <xsl:apply-templates mode="xmlverb">
681 <xsl:with-param name="indent-elements"
682 select="$indent-elements"/>
683 <xsl:with-param name="indent"
684 select="concat($indent, $indent-increment)"/>
685 <xsl:with-param name="indent-increment"
686 select="$indent-increment"/>
687 </xsl:apply-templates>
688 <xsl:if test="* and $indent-elements">
690 <xsl:value-of select="$indent" />
692 <xsl:text></</xsl:text>
693 <xsl:if test="$ns-prefix != ''">
694 <span class="xmlverb-element-nsprefix">
695 <xsl:value-of select="$ns-prefix"/>
697 <xsl:text>:</xsl:text>
699 <span class="xmlverb-element-name">
700 <xsl:value-of select="local-name()"/>
702 <xsl:text>></xsl:text>
705 <xsl:text> /></xsl:text>
708 <xsl:if test="not(parent::*)"><br /><xsl:text>
</xsl:text></xsl:if>
711 <!-- attribute nodes -->
712 <xsl:template name="xmlverb-attrs">
713 <xsl:text> </xsl:text>
714 <span class="xmlverb-attr-name">
715 <xsl:value-of select="name()"/>
717 <xsl:text>="</xsl:text>
718 <span class="xmlverb-attr-content">
719 <xsl:call-template name="html-replace-entities">
720 <xsl:with-param name="text" select="normalize-space(.)" />
721 <xsl:with-param name="attrs" select="true()" />
724 <xsl:text>"</xsl:text>
727 <!-- namespace nodes -->
728 <xsl:template name="xmlverb-ns">
729 <xsl:if test="name()!='xml'">
730 <span class="xmlverb-ns-name">
731 <xsl:text> xmlns</xsl:text>
732 <xsl:if test="name()!=''">
733 <xsl:text>:</xsl:text>
735 <xsl:value-of select="name()"/>
737 <xsl:text>="</xsl:text>
738 <span class="xmlverb-ns-uri">
739 <xsl:value-of select="."/>
741 <xsl:text>"</xsl:text>
746 <xsl:template match="text()" mode="xmlverb">
747 <span class="xmlverb-text">
748 <xsl:call-template name="preformatted-output">
749 <xsl:with-param name="text">
750 <xsl:call-template name="html-replace-entities">
751 <xsl:with-param name="text" select="." />
759 <xsl:template match="comment()" mode="xmlverb">
760 <xsl:text><!--</xsl:text>
761 <span class="xmlverb-comment">
762 <xsl:call-template name="preformatted-output">
763 <xsl:with-param name="text" select="." />
766 <xsl:text>--></xsl:text>
767 <xsl:if test="not(parent::*)"><br /><xsl:text>
</xsl:text></xsl:if>
770 <!-- processing instructions -->
771 <xsl:template match="processing-instruction()" mode="xmlverb">
772 <xsl:text><?</xsl:text>
773 <span class="xmlverb-pi-name">
774 <xsl:value-of select="name()"/>
776 <xsl:if test=".!=''">
777 <xsl:text> </xsl:text>
778 <span class="xmlverb-pi-content">
779 <xsl:value-of select="."/>
782 <xsl:text>?></xsl:text>
783 <xsl:if test="not(parent::*)"><br /><xsl:text>
</xsl:text></xsl:if>
787 <!-- =========================================================== -->
788 <!-- Procedures / Functions -->
789 <!-- =========================================================== -->
791 <!-- generate entities by replacing &, ", < and > in $text -->
792 <xsl:template name="html-replace-entities">
793 <xsl:param name="text" />
794 <xsl:param name="attrs" />
795 <xsl:variable name="tmp">
796 <xsl:call-template name="replace-substring">
797 <xsl:with-param name="from" select="'>'" />
798 <xsl:with-param name="to" select="'&gt;'" />
799 <xsl:with-param name="value">
800 <xsl:call-template name="replace-substring">
801 <xsl:with-param name="from" select="'<'" />
802 <xsl:with-param name="to" select="'&lt;'" />
803 <xsl:with-param name="value">
804 <xsl:call-template name="replace-substring">
805 <xsl:with-param name="from"
807 <xsl:with-param name="to"
808 select="'&amp;'" />
809 <xsl:with-param name="value"
818 <!-- $text is an attribute value -->
819 <xsl:when test="$attrs">
820 <xsl:call-template name="replace-substring">
821 <xsl:with-param name="from" select="'
'" />
822 <xsl:with-param name="to" select="'&#xA;'" />
823 <xsl:with-param name="value">
824 <xsl:call-template name="replace-substring">
825 <xsl:with-param name="from"
827 <xsl:with-param name="to"
828 select="'&quot;'" />
829 <xsl:with-param name="value" select="$tmp" />
835 <xsl:value-of select="$tmp" />
840 <!-- replace in $value substring $from with $to -->
841 <xsl:template name="replace-substring">
842 <xsl:param name="value" />
843 <xsl:param name="from" />
844 <xsl:param name="to" />
846 <xsl:when test="contains($value,$from)">
847 <xsl:value-of select="substring-before($value,$from)" />
848 <xsl:value-of select="$to" />
849 <xsl:call-template name="replace-substring">
850 <xsl:with-param name="value"
851 select="substring-after($value,$from)" />
852 <xsl:with-param name="from" select="$from" />
853 <xsl:with-param name="to" select="$to" />
857 <xsl:value-of select="$value" />
862 <!-- preformatted output: space as , tab as 8
864 <xsl:template name="preformatted-output">
865 <xsl:param name="text" />
866 <xsl:call-template name="output-nl">
867 <xsl:with-param name="text">
868 <xsl:call-template name="replace-substring">
869 <xsl:with-param name="value"
870 select="translate($text,' ',' ')" />
871 <xsl:with-param name="from" select="'	'" />
872 <xsl:with-param name="to"
873 select="'        '" />
879 <!-- output nl as <br> -->
880 <xsl:template name="output-nl">
881 <xsl:param name="text" />
883 <xsl:when test="contains($text,'
')">
884 <xsl:value-of select="substring-before($text,'
')" />
886 <xsl:text>
</xsl:text>
887 <xsl:call-template name="output-nl">
888 <xsl:with-param name="text"
889 select="substring-after($text,'
')" />
893 <xsl:value-of select="$text" />