mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-09-14 05:09:26 +03:00
Commit 05f70130
broke the precedence of attributes on literal result
elements and attributes from xsl:use-attribute-sets.
Process xsl:use-attribute-sets first. Then if any attributes were added
to the target node, use xmlSetNsProp to copy the remaining attributes,
replacing the previous values.
Thanks to Alexey Neyman for the report.
25 lines
807 B
XML
25 lines
807 B
XML
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
|
<xsl:template match="*">
|
|
<xsl:apply-templates/>
|
|
</xsl:template>
|
|
|
|
<xsl:attribute-set name="as1">
|
|
<xsl:attribute name="a1">as1</xsl:attribute>
|
|
<xsl:attribute name="a2">as1</xsl:attribute>
|
|
<xsl:attribute name="a3">as1</xsl:attribute>
|
|
<xsl:attribute name="a4">as1</xsl:attribute>
|
|
</xsl:attribute-set>
|
|
|
|
<xsl:attribute-set name="as2">
|
|
<xsl:attribute name="a1">as2</xsl:attribute>
|
|
<xsl:attribute name="a2">as2</xsl:attribute>
|
|
<xsl:attribute name="a3">as2</xsl:attribute>
|
|
</xsl:attribute-set>
|
|
|
|
<xsl:template match="foo">
|
|
<bar xsl:use-attribute-sets="as1 as2" a1="element" a2="element">
|
|
<xsl:attribute name="a1">attr</xsl:attribute>
|
|
</bar>
|
|
</xsl:template>
|
|
</xsl:stylesheet>
|