We have some data that is being exposed via a JSON web service that is being consumed in a custom XUI app. The content provided in the JSON data already has a variety of entity references in it (ex: &). When we pass this data to the createTextNode(...) method of the Document class, it translates the "&" character in the & entity to a "&", resulting in the value & being stored in the SGML document. Clearly, we could modify the JSON service to no longer output entity references, but is there another way to skin this cat? Is there a way to cause the createTextNode(...) Document class method not translate characters to entities as described above?
There's an ACL function for that: entity_expand(str, 1, doc), where 'str' is the string with the entities, '1' means "expand character entities" (2 is text entities, 3 is both), and doc is the ACL ID of the document to use to look up the entity references. So assuming you're in Java: