-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
Using the XSLT
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="div">
<div><xsl:apply-templates/></div>
</xsl:template>
<xsl:template match="button">
<button>
<xsl:attribute name="style">width:<xsl:call-template name="widthUnit"/>;</xsl:attribute>
<xsl:text>OK</xsl:text>
</button>
</xsl:template>
<xsl:template name="widthUnit">
<xsl:param name="width" select="@width"/>
<xsl:choose>
<xsl:when test="contains($width, '%') or contains($width, 'px')"><xsl:value-of select="$width"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$width"/>px</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>and the input XML
<div>
<button width="100%"/>
<button width="80"/>
</div>the output is
<div><button style="width:100%;">OK</button><button style="width:100%;">OK</button></div>instead of the expected
<div><button style="width:100%;">OK</button><button style="width:80px;">OK</button></div>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels