Mercurial > hg > mpdl-group
comparison software/eXist/webapp/mpdl/presentation/functions-functx.xsl @ 7:5589d865af7a
Erstellung XQL/XSL Applikation
author | Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 08 Feb 2011 15:16:46 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
6:2396a569e446 | 7:5589d865af7a |
---|---|
1 <?xml version="1.0"?> | |
2 <xsl:stylesheet version="2.0" | |
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
4 xmlns:xlink="http://www.w3.org/1999/xlink" | |
5 xmlns:functx="http://www.functx.com" | |
6 xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |
7 | |
8 <!-- see http://www.xsltfunctions.com --> | |
9 <xsl:function name="functx:contains-any-of" as="xs:boolean"> | |
10 <xsl:param name="arg" as="xs:string?"/> | |
11 <xsl:param name="searchStrings" as="xs:string*"/> | |
12 <xsl:sequence select="some $searchString in $searchStrings satisfies contains($arg,$searchString)"/> | |
13 </xsl:function> | |
14 | |
15 <xsl:function name="functx:cutStringBefore"> | |
16 <xsl:param name="inputString" as="xs:string"/> | |
17 <xsl:param name="cutLength" as="xs:integer"/> | |
18 <xsl:variable name="length" select="string-length($inputString)"/> | |
19 <xsl:if test="$length > $cutLength"> (...)</xsl:if> | |
20 <xsl:value-of select="substring($inputString, $length - $cutLength)"/> | |
21 </xsl:function> | |
22 | |
23 <xsl:function name="functx:cutStringAfter"> | |
24 <xsl:param name="inputString" as="xs:string"/> | |
25 <xsl:param name="cutLength" as="xs:integer"/> | |
26 <xsl:variable name="length" select="string-length($inputString)"/> | |
27 <xsl:value-of select="substring($inputString, 0, $cutLength)"/> | |
28 <xsl:if test="$length > $cutLength">(...) </xsl:if> | |
29 </xsl:function> | |
30 | |
31 <xsl:function name="functx:sort" as="item()*"> | |
32 <xsl:param name="seq" as="item()*"/> | |
33 <xsl:for-each select="$seq"> | |
34 <xsl:sort select="."/> | |
35 <xsl:copy-of select="."/> | |
36 </xsl:for-each> | |
37 </xsl:function> | |
38 | |
39 | |
40 </xsl:stylesheet> |