XSLT refactor operation for extracting attributes from LREs
Posted: Tue Jan 31, 2006 4:50 pm
I'd like to see an addition to the XSLT refactoring operation list, extracting attributes in Literal Result Elements into xsl:attribute instruction. If you have, say
The extract attributes would turn this into
Not the most used feature, but still something I occasionally would like to be able to automatically. And if you have
this would be turned into e.g.
or
Code: Select all
<foo bar="baz"/>
Code: Select all
<foo>
<xsl:attribute name="bar">baz</xsl:attribute>
</foo>
Code: Select all
<foo bar="baz{qux}quxx"/>
Code: Select all
<foo>
<xsl:attribute name="bar">
<xsl:text>baz</xsl:text>
<xsl:value-of select="qux"/>
<xsl:text>quxx</xsl:text>
</xsl:attribute>
</foo>
Code: Select all
<foo>
<xsl:attribute name="bar">
<xsl:value-of select="concat('baz', qux, 'quxx')"/>
</xsl:attribute>
</foo>