xpathEncode

text xpathEncode(text)

Returns the text encoded for safe use as a string in an XPath expression.

This encoding wraps the text in either single or double quote characters, or an concat(…) thereof, so it’s safely interpreted as a string literal or evaluate to a string.

Parameters

  1. text — text to encode.

Returns