xdmp.encodeForNCName( $name as String ) as String
Invertible function that escapes characters required to be part of an NCName.
This is useful when translating names from other representations such as
JSON to XML.
Given any string, the result is always a valid NCName.
Providing all names are passed through this function the result is
distinct NCNames so the results can be used for searching as well as
The inverse function is
|$name||A string which is used as an NCName (such as the localname for an element or attribute).|
xdmp.encodeForNCName("A name"); => "A_20_Name"