Attribute value templates

To specify element-content, xsl:value-of can be used this does not work to specify attribute content...

  • Use { } around an XPath expression to include the value for an attribute-value.

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template name="test">
        <test test-type="{test/@type}"/>
      </xsl:template>
    </xsl:stylesheet>
    					
  • Use double curly braces to escape a single curly brace.