Project

Profile

Help

Bug #6467 » Merge.xslt

Simple xsl:merge test case - Adrian Bird, 2024-07-04 09:50

 
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template name="xsl:initial-template">
<root>
<!-- 2 data sets to be merged -->
<xsl:variable name="mergeSourceA">
<node>100</node>
<node>300</node>
<node>500</node>
</xsl:variable>
<xsl:variable name="mergeSourceB">
<node>200</node>
<node>400</node>
<node>600</node>
</xsl:variable>
<xsl:merge>
<xsl:merge-source select="$mergeSourceA/*">
<xsl:merge-key select="." />
</xsl:merge-source>
<xsl:merge-source select="$mergeSourceB/*">
<xsl:merge-key select="." />
</xsl:merge-source>
<xsl:merge-action>
<node>
<xsl:value-of select="current-merge-key()"/>
</node>
</xsl:merge-action>
</xsl:merge>
</root>
</xsl:template>
</xsl:stylesheet>
    (1-1/1)