Hello,

The query

xquery:eval(
  'contains(.,"&")',
  map{'':<foo>&lt;&amp;&gt;</foo>}
)

results in:
[XPST0003] Invalid entity: '&")...'.

I can get the expected result if I double-escape the entity:

'contains(.,"&amp;amp;")'

or wrap in a call to serialize:

serialize('contains(.,"&amp;")')

However, both

xquery:eval(
  'contains(.,"&lt;")',
  map{'':<foo>&lt;&amp;&gt;</foo>}
)

and

xquery:eval(
  'contains(.,"&gt;")',
  map{'':<foo>&lt;&amp;&gt;</foo>}
)

return true, as expected.

Is this a bug, or am I missing something?

Thanks,
Andrew

Reply via email to