Package org.rumbledb.compiler.utils
Class XmlCharRefUtils
java.lang.Object
org.rumbledb.compiler.utils.XmlCharRefUtils
Utility for unescaping and validating XML character references and predefined entity references.
Enforces W3C XML 1.0 / 1.1 Char production and raises err:XQST0090 (CharacterReferenceException)
if a character reference does not expand to a legal XML character or overflows integer range.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringunescapeXml(String text, String xmlVersion, ExceptionMetadata metadata) Unescapes XML character references and predefined entity references in the given text using the specified XML version.
-
Method Details
-
unescapeXml
Unescapes XML character references and predefined entity references in the given text using the specified XML version.- Parameters:
text- the input string to unescapexmlVersion- the XML version ("1.0" or "1.1")metadata- metadata for error reporting- Returns:
- the unescaped string
- Throws:
CharacterReferenceException- [err:XQST0090] if any character reference does not expand to a legal XML character
-