<xsl:attribute
name="width">$length</xsl:attribute>
This will create an attribute with a string value $length. But you need the xsl: param value with the name $length.
<xsl:attribute
name="width"><xsl:value-of-select="$length"></xsl:attribute>
The element is <xsl:value-of>not closed here - this makes the XSLT code incorrect. xml.
Decision
Use one of the following actions:
<xsl:attribute name="width"><xsl:value-of select="$length"/></xsl:attribute>
or
<someElement width="{$length}"/>
For readability and compactness, prefer to use 2. above when possible.
source
share