Skip to Content

remove & from xml in HCI using filters or groovy or xslt

Nov 29, 2016 at 07:14 AM


avatar image


We are getting & in some of the field in XML from Success Factors in HCI but we are getting parsing error as & is a special character for XML and it has meaning in XML.

Can anyone please let me know if we can replace '&' with 'and' in XML using filters or XSLT or Groovy.

I have tried to parse XML using XSLT and Groovy but i am gettin parsing exception. Can we remove '&' using filters. Can anyone help me with groovy or xslt also if any is there to solve this issue.


Aman Raj

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Sriprasad Shivaram Bhat Nov 29, 2016 at 10:03 AM

Hello Aman,

Below code works.


import java.util.HashMap;

def Message processData(Message message)



def body_xml= message.getBody(java.lang.String);

def input_xml=body_xml.replaceAll("&","and");


return message;



Sriprasad Shivaram Bhat

10 |10000 characters needed characters left characters exceeded