array.xsl 576 Bytes
Newer Older
1 2 3 4
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:h2m="http://www.utc.fr/hdoc/hdoc_to_mongo">
Nyashes's avatar
Nyashes committed
5
    <xsl:import href="../xsl-import/string.xsl"/>
6 7 8 9
    <xsl:function name="h2m:array">
        <xsl:param name="nodeset"/>
        [
        <xsl:for-each select="$nodeset[not(position() = last())]">
Nyashes's avatar
Nyashes committed
10
            <xsl:value-of select="h2m:escape-string(.)"/>,
11
        </xsl:for-each>
Nyashes's avatar
Nyashes committed
12
        <xsl:value-of select="h2m:escape-string($nodeset[last()])"/>
13 14 15
        ]
    </xsl:function>
</xsl:stylesheet>