Commit 7e09de761b220aaa0889315af52fd083f2c1e055

Authored by Colomban Wendling
1 parent 00336365
Exists in python

Simplify code renaming a parameter

Rely on XSLT keeping the last attribute in case of duplicates.
Showing 1 changed file with 5 additions and 12 deletions   Show diff stats
strip-frames.xsl
... ... @@ -61,18 +61,11 @@
61 61 text:h[draw:frame]">
62 62 <xsl:comment>Removed outer <xsl:value-of select="name()"/></xsl:comment>
63 63 <xsl:copy>
64   - <!-- FIXME: there's probably a better way to do that -->
65   - <xsl:for-each select="@*">
66   - <xsl:choose>
67   - <xsl:when test="../@text:style-name = .">
68   - <xsl:attribute name="text:style-name">
69   - <xsl:value-of select="concat('Placeholder', .)"/>
70   - </xsl:attribute>
71   - </xsl:when>
72   - <xsl:otherwise>
73   - <xsl:apply-templates select="."/>
74   - </xsl:otherwise>
75   - </xsl:choose>
  64 + <xsl:apply-templates select="@*"/>
  65 + <xsl:for-each select="@text:style-name">
  66 + <xsl:attribute name="{name(.)}">
  67 + <xsl:value-of select="concat('Placeholder', .)"/>
  68 + </xsl:attribute>
76 69 </xsl:for-each>
77 70 </xsl:copy>
78 71 <xsl:apply-templates/>
... ...