如何在 xsl:param 中转义分号? [英] How to escape a semicolon in xsl:param?

查看:29
本文介绍了如何在 xsl:param 中转义分号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Visual Studio 中编写 XSL 转换.据报告,以下分号是意外标记":

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.

推荐答案

您大概希望参数 delimiters 具有 string ;#因为它的价值,因为它不是一个有效的 XPath 表达式?如果是,则需要引用属性值:

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="';#'" />

请注意,该值现在用单引号括起来;这会导致属性值被解释为返回字符串的 XPath 表达式.

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.

这篇关于如何在 xsl:param 中转义分号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆