Workday errors in plain English.

Submit an Error

JsonToXML Fails With Character Reference Is an Invalid XML Character on an Emoji in the API Response

✓ Verified Workday Studio 4 lookups
The error Reason: Character reference "&#55357" is an invalid XML character.. Root Cause: org.xml.sax.SAXParseException lineNumber: 255252 columnNumber: 9 Character reference "&#55357" is an invalid XML character

What does "Reason: Character reference "&#55357" is an invalid XML" mean in Workday Studio?

A JSON payload from an external API contained an emoji, and converting it to XML split the character into two halves that are not legal XML on their own. The parser rejects the first half by its numeric reference.

Quick fix

Set the context property use.saxon.transformer to true before any step that manipulates XML carrying the payload, and rerun.

Permanent fix

Raise the project's assembly version to a release that handles surrogate pairs, use the current XSLT step rather than the legacy one, and stay off XSLT 1.0. Any integration consuming free text from an external API should assume emoji will arrive eventually.

Troubleshooting

  1. Look up the number in the message. Values in the 55296 to 57343 range are surrogate halves, which only exist as a pair, so this is an encoding fault rather than a stray control character.
  2. Do not try to strip it in the stylesheet. By the time XSLT sees the document the parse has already failed, so translate and replace never get the chance to run.
  3. Check the assembly version of the project. Older runtimes carry an XML serializer that writes each half of the pair separately, and that is what produces the invalid reference.
  4. Confirm which transform step is in play. A legacy XSLT step and an XSLT 1.0 stylesheet both keep you on the old code path even after the assembly version is raised.
  5. Reproduce with a two record sample containing the offending value so you can verify a fix without waiting on a full run of a quarter million lines.
Was this helpful?

Related errors