File: OTRSFunctions.xsl

package info (click to toggle)
otrs2 6.0.32-6
  • links: PTS
  • area: non-free
  • in suites: bullseye
  • size: 197,336 kB
  • sloc: perl: 1,003,018; javascript: 75,060; xml: 70,883; php: 51,819; sql: 22,361; sh: 379; makefile: 51
file content (29 lines) | stat: -rw-r--r-- 1,036 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:func="http://exslt.org/functions"
                xmlns:otrs="http://otrs.org"
                extension-element-prefixes="func otrs">

<func:function name="otrs:date-xsd-to-iso">
    <xsl:param name="date-time" />
    <xsl:variable name="formatted">
        <xsl:value-of select="substring($date-time, 1, 10)" />
        <xsl:text> </xsl:text>
        <xsl:value-of select="substring($date-time, 12, 8)" />
   </xsl:variable>
   <func:result select="string($formatted)" />
</func:function>

<func:function name="otrs:date-iso-to-xsd">
    <xsl:param name="date-time" />
    <xsl:variable name="formatted">
        <xsl:value-of select="substring($date-time, 1, 10)" />
        <xsl:text>T</xsl:text>
        <xsl:value-of select="substring($date-time, 12, 8)" />
        <xsl:text>Z</xsl:text>
   </xsl:variable>
   <func:result select="string($formatted)" />
</func:function>

</xsl:stylesheet>