summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorPeter Jentsch <pjotr@guineapics.de>2012-05-01 00:26:25 +0200
committerDavid Tardon <dtardon@redhat.com>2012-09-10 07:56:35 +0200
commitb5107faa150aab3c5480708219fc8d392a97f718 (patch)
tree4d55a72eb5c223b92289f0b796b6ed080472f620 /filter
parent9f29890d4e4fa916d46eeae081ef6e04eb1bfe81 (diff)
add for exslt:set:distinct template
..for processors not supporting it natively, namely Saxon &gt; 8.2 Change-Id: I33ceedd7f70f0469c039b8e90aa8d492d5c27ce2
Diffstat (limited to 'filter')
-rw-r--r--filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl21
1 files changed, 21 insertions, 0 deletions
diff --git a/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl b/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
index 15874f2bae90..62586680b72d 100644
--- a/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
+++ b/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
@@ -9145,4 +9145,25 @@
<xsl:param name="string"/>
<xsl:value-of select="translate($string, '.%()/\+[]', '')"/>
</xsl:template>
+
+ <xsl:template name="set:distinct">
+ <xsl:param name="nodes" select="/.."/>
+ <xsl:param name="distinct" select="/.."/>
+ <xsl:choose>
+ <xsl:when test="$nodes">
+ <xsl:call-template name="set:distinct">
+ <xsl:with-param name="distinct" select="$distinct | $nodes[1][not(. = $distinct)]"/>
+ <xsl:with-param name="nodes" select="$nodes[position() > 1]"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$distinct" mode="set:distinct"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="node()|@*" mode="set:distinct">
+ <xsl:copy-of select="." />
+ </xsl:template>
+
</xsl:stylesheet>