Skip to Content

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


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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    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

    Add comment
    10|10000 characters needed characters exceeded