How to escape a semicolon in xsl:param?
I'm writing an XSL transform in Visual Studio. It is reporting that the semicolon in the following is an "unexpected token":
<xsl:param name="delimiters" select=";#" />
Does anyone know how to escape the semicolon? It hasn't shown up on any character lists I've found so far.开发者_JAVA技巧
You presumably want the param delimiters
to have the string ;#
as it's value, given that that isn't a valid XPath expression? If so, you need to quote the attribute value:
<xsl:param name="delimiters" select="';#'" />
Note that the value is now wrapped in single quotes; this causes the attribute value to be interpreted as an XPath expression which returns a string.
Have you tried this?
<xsl:param name="delimiters" select="';#'"/>
Try the following entity (semi-colon is ASCII character 59)...
;
wallenborn is right. The reason is that a select
attribute in XSL always expects an XPath expression. If you want to put a string literal there, you need to quote it.
精彩评论