array.xsl 490 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?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">
    <xsl:function name="h2m:array">
        <xsl:param name="nodeset"/>
        [
        <xsl:for-each select="$nodeset[not(position() = last())]">
            "<xsl:value-of select="."/>",
        </xsl:for-each>
        <xsl:value-of select="$nodeset[last()]"/>
        ]
    </xsl:function>
</xsl:stylesheet>