GNOME Bugzilla – Bug 730171
<xsl:fallback> doesn't add elements into the correct result tree hierarchy
Last modified: 2019-05-12 13:55:13 UTC
The <xsl:fallback> instruction element is instantiated when its enclosing extension element is undefined; however, <xsl:fallback>, simply inserting them at the same hierarchy level as the <xsl:fallback> element, it instead appends them to the root node. So appending to the root node is not happening. Sample template: <xsl:template match="/"> <xsl:variable name="ns-temp-1"> <parent> <older-sibling/> <test:test> <xsl:fallback> <middle-sibling/> </xsl:fallback> </test:test> <younger-sibling/> </parent> </xsl:variable> <xsl:variable xmlns:exslt-ext="http://xmlsoft.org/XSLT/namespace" name="ns" select="exslt:node-set($ns-temp-1)"/> <xsl:for-each select="$ns/*"> <output> <xsl:value-of select="concat("Name: ", name())"/> </output> <xsl:for-each select="./*"> <output> <xsl:value-of select="concat(" Child name: ", name())"/> </output> </xsl:for-each> </xsl:for-each> </xsl:template> Above template results in: Name: parent Child name: older-sibling Child name: younger-sibling Name: middle-sibling
Fixed here: https://gitlab.gnome.org/GNOME/libxslt/commit/7434b5569fe9bc858900e66580d17e3b80cb80fc