Skip to content

Commit

Permalink
Fix flatten bug with duplicate map key
Browse files Browse the repository at this point in the history
  • Loading branch information
jelovirt committed Dec 22, 2024
1 parent b174565 commit 7391778
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/generator/com/elovirta/pdf/merge.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@

<xsl:function name="x:flatten" as="item()*" visibility="public">
<xsl:param name="root" as="item()"/>
<xsl:variable name="flattened" as="map(*)">
<xsl:map>
<xsl:sequence select="x:flatten-walker($root, $root, ())"/>
</xsl:map>
</xsl:variable>
<xsl:sequence select="map:merge(($flattened), map{ 'duplicates': 'use-first' })"/>
<xsl:sequence select="map:merge(x:flatten-walker($root, $root, ()),
map{ 'duplicates': 'use-first' })"/>
</xsl:function>

<xsl:function name="x:flatten-walker" as="item()*">
Expand Down

0 comments on commit 7391778

Please sign in to comment.