Link to home
Start Free TrialLog in
Avatar of tesmc
tesmcFlag for United States of America

asked on

XJS: How to remove special characters in email in xml string

I'm making a call to a web service where it returns the email with special characters ‡
It does not always return ‡, sometimes it's others and I won't know.

I have the following xml string where I want to clean up the email

var  strResponse = '<Body><PaxRS><ItineraryRef ID="XBHGGE"/><TravelRS><Travel><CustomerInfo><PersonName><Email>‡JOHNDOE@AOL.COM‡1.1</Email></PersonName></CustomerInfo></Travel></TravelRS></PaxRS></Body>';


I want to be able to clean up the email of any special characters that exist, how can I do this in xjs if i don't know the exact special characters that the web service would be returning?

I tried doing this with xslt and though it would strip out the special characters, within the actual platform I'm using it would not remove it, so I want to remove it via javascript instead.

Please advise.
ASKER CERTIFIED SOLUTION
Avatar of zephyr_hex (Megan)
zephyr_hex (Megan)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tesmc

ASKER

thank you. that worked.