简体   繁体   English

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

[英]xsl param default string cannot start with period

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'. 并始终收到错误代码0x8004005 - 期望toden'eof'找到'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? 如何形成此字符串以包含第一个点?

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. 在前一种情况下, select属性的值被计算为XPath表达式 - 而不是字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM