XSLT:是否可以将HTML标签插入XSL的格式编号函数的输出中?



给定以下内容:

<xsl:value-of select="format-number(//items/subitem[@name = 'name']/@value, '#,###.00')" />

甚至有可能将生成的小数包含在上标标签(<sup>(中吗?

我的研究、探索和尝试表明事实并非如此,但我远非使用 XSLT 的专家。

任何建议,指针,链接将不胜感激。

我被难住了。

答案确实是否定的。format-number 函数的第二个参数是格式模式字符串(在 XSLT 1.0 中(或图片字符串(在 XSLT 2.0 中,您可以在此处阅读:https://www.w3.org/TR/xslt20/#processing-picture-string(

你可以做的一件事是这样的

<xsl:variable name="value" select="//items/subitem[@name = 'name']/@value" />
<xsl:value-of select="format-number(floor($value), '#,###')" />
<sup>
   <xsl:value-of select="format-number($value - floor($value), '.00')" />
</sup>

最新更新