gpt4 book ai didi

带有 xlt 格式错误的 Javascript

转载 作者:行者123 更新时间:2023-11-29 17:21:02 24 4
gpt4 key购买 nike

我正在使用 javascript 在我的 xslt 文件中填充数字。但是在调试时我收到一条错误消息。

Extension function parameters or return values which have Clr type 'ConcatString' are not supported.

我该如何解决这个问题?

xslt

<xsl:template name="padNumber">
<xsl:param name="value"></xsl:param>
<xsl:param name="length"></xsl:param>
<xsl:value-of select="user:PadDigits($value,$length)"/>
</xsl:template>

JavaScript

function PadDigits(n, totalDigits)
{
n = n.toString();
var pd = '';
if (totalDigits &gt; n.length)
{
var i;
for (i=0; i&lt;(totalDigits-n.length); i++)
{
pd += '0';
}
}
pd = pd + n.toString();
return pd;
}

最佳答案

更改 PadDigits 以返回字符串:

return "" + pd;

关于带有 xlt 格式错误的 Javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12917802/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com