0

I'm calling a method of my extension object.

Here is my method's signature:

public string GetValue(string xPath) { }

And here is the place I call it in my Xslt file:

<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')"/>

Because of the part

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

contains ' chars, I'm getting an error

"Expected token ')', found 'true'. ...isMobile/base:_underlyingValue=' -->true<-- ']/base:_entity/contact:_extensi..."

I couldn't find an escape char for X-path. Do you have any suggestions?

avirk
  • 3,050
  • 7
  • 38
  • 57
xkcd
  • 2,538
  • 11
  • 59
  • 96

1 Answers1

2

You can use XSLT/XML escape mechanisms i.e.

<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;)"/>
Martin Honnen
  • 160,499
  • 6
  • 90
  • 110