嗨,我想以百分比格式填充宽度中的 maxbars 变量的值,但由于某些原因,它没有采用它的值。你能帮忙吗?
示例:我想将其显示为 width:10.9% 格式
<xsl:for-each select="catalog/cd/price">
Current node:
<xsl:variable name="maxbars" select="."/>
<div style="width: 200px; height: 20px;">
<div style="width: maxbars%; height: 18px; background-color: red"></div>
</div>
<br/>
</xsl:for-each>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>