A new request with request id 6665 has been created by koha-devel-request@lists.koha-community.org. Short info on the request is :

Title : Koha-devel Digest, Vol 203, Issue 21
Category :
Description :
Send Koha-devel mailing list submissions to
    koha-devel@lists.koha-community.org

To subscribe or unsubscribe via the World Wide Web, visit
    https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
or, via email, send a message with subject or body 'help' to
    koha-devel-request@lists.koha-community.org

You can reach the person managing the list at
    koha-devel-owner@lists.koha-community.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Koha-devel digest..."


Today's Topics:

1. XSLT functions (David Cook)


----------------------------------------------------------------------

Message: 1
Date: Mon, 31 Oct 2022 16:38:35 +1100
From: "David Cook" <dcook@prosentient.com.au>
To: "'koha-devel'" <koha-devel@lists.koha-community.org>
Subject: [Koha-devel] XSLT functions
Message-ID: <0b4d01d8eceb$07fcb020$17f61060$@prosentient.com.au>
Content-Type: text/plain; charset="utf-8"

Hi all,



I've probably already shared this, but I thought that I'd share it again
anyways.



Here's a neat way you can create functions in your Koha XSLTs:



<xsl:stylesheet version="1.0"

xmlns:marc="http://www.loc.gov/MARC21/slim"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:common="http://exslt.org/common"

xmlns:str="http://exslt.org/strings"

xmlns:func="http://exslt.org/functions"

xmlns:my="http://prosentient.com.au/xsltfunctions"

extension-element-prefixes="func"

exclude-result-prefixes="marc str my common">



<func:function name = "my:strToLower">

<xsl:param name="string" />

<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"
/>

<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"
/>

<xsl:variable name="translated" select="translate($string,
$uppercase, $lowercase)" />

<func:result select="$translated"/>

</func:function>



Most of the time you can probably just use templates with call-template and
a parameter, but I find functions can just be really handy.



David Cook

Senior Software Engineer

Prosentient Systems

Suite 7.03

6a Glen St

Milsons Point NSW 2061

Australia



Office: 02 9212 0899

Online: 02 8005 0595



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20221031/a36cacb6/attachment-0001.htm>

------------------------------

Subject: Digest Footer

_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : https://www.koha-community.org/
git : https://git.koha-community.org/
bugs : https://bugs.koha-community.org/


------------------------------

End of Koha-devel Digest, Vol 203, Issue 21
*******************************************


NOTE: You are receiving this mail because, the Requester/Technician wanted you to get notified on this request creation.