cancel
Showing results for 
Search instead for 
Did you mean: 

Expression to remove non-valid XML chars

rvazzana
Employee
Employee

Hello all,

I am trying to create a mapper expression to remove any non-valid XML characters. The need behind the request:
The Workday Write snap only can handle valid XML characters. If we have content in a field such as:
“Name”: “Firstname Lastname mbH\u000b (NVG)”

The Workday Write will fail because of the non-valid XML \u000b, with the below error:
Failure: An error occurred while parsing the request document, Reason: An invalid XML character (Unicode: 0xb) was found in the element content of the document., Resolution: Please verify the validity of the XML document

We know from Extensible Markup Language (XML) 1.0 (Fifth Edition) that valid XML characters include:
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF

We could just replace the\u000b in a mapper snap with but my customer would like a way to include all non-valid XML chars, as opposed to just this one, as they cannot anticipate what other non-valid characters could possiblly occur. So I am working on an expression to remove non-valid XML before the workday writer snap, and I thought someone may have already done this before. Thanks for any help!

Rob

0 REPLIES 0