0

我正在调用我的扩展对象的方法。

这是我的方法的签名:

public string GetValue(string xPath) { }

这是我在Xslt文件中调用它的地方:

<xsl:value-of select ="crn:GetValue('courier:_application/base:_entity/loan:_applicant/base:_entity/person:_phones/base:SmartRefOfPhoneeJDvviUx[base:_entity/contact:_isMobile/base:_underlyingValue='true']/base:_entity/contact:_secondaryPrefix/base:_underlyingValue')"/>

由于部分

[base:_entity/contact:_isMobile/base:_underlyingValue='true']

包含'字符,我收到一个错误

"预期的令牌 ')',找到 'true'。...isMobile/base:_underlyingValue=' -->true<-- ']/base:_entity/contact:_extensi... "

我找不到 X-path 的转义字符。你有什么建议吗?

4

1 回答 1

2

您可以使用 XSLT/XML 转义机制,即

<xsl:value-of select ="crn:GetValue(&quot;courier:_application/base:_entity/loan:_applicant/base:_entity/person:_phones/base:SmartRefOfPhoneeJDvviUx[base:_entity/contact:_isMobile/base:_underlyingValue='true']/base:_entity/contact:_secondaryPrefix/base:_underlyingValue&quot;)"/>
于 2012-11-16T15:33:09.480 回答