开发者

xsl param default string cannot start with period

开发者 https://www.devze.com 2023-02-09 02:43 出处:网络
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 tode开发者_JS百科n \'eof\' fo

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 tode开发者_JS百科n '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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消