xsl param默认字符串不能以句点开头

发布于 2024-10-16 01:23:28 字数 210 浏览 12 评论 0原文

在我的样式表中,我尝试将输入参数的默认值设置为以点字符开头的字符串。并且总是收到错误代码 0x8004005 - 预期的 toden 'eof' 找到 'NAME'。例如:

<xsl:param name="p1" select=".exe"/>

但是,点后面的内容并不重要。总是同样的错误。 如何形成该字符串以包含第一个点?

In my stylesheet I try to set the default value for an input parameter to a string beginning with the dot character. And always receive an error code 0x8004005 - Expected toden 'eof' found 'NAME'. For example:

<xsl:param name="p1" select=".exe"/>

However it doesn't matter what follows the dot. Always same error.
How do I form this string to include the first dot?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

緦唸λ蓇 2024-10-23 01:23:29

您需要将“默认值”指定为字符串

只需将: 更改

<xsl:param name="p1" select=".exe"/>

为:

<xsl:param name="p1" select="'.exe'"/>

在前一种情况下,select 属性的值将作为 XPath 表达式进行计算,而不是作为字符串。

You need to specify the "default value" as a string literal.

Simply change:

<xsl:param name="p1" select=".exe"/>

to:

<xsl:param name="p1" select="'.exe'"/>

In the former case the value of the select attribute is evaluated as an XPath expression -- not as a string.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文