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 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.
精彩评论