Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

How to decode html entities in web services response ?

yassinederkaoui
Contributor III

Hello,

I need to use the web services api to search a record. The problem is in the response. I don't know why but the response has html entites instead of "<" and ">".

I need to decode these html entities because i have to convert the xml to json then use it in my Javascript datafeed.

I tried everything (replace function...)

Could you please help me ?

Thank you,

Regards

html entities.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

DavidPetty
Archer Employee
Archer Employee

@yassinederkaoui  you should be able to use the following:

function xmlStringToXmlDoc(xml){
	var p  = new xmldom.DOMParser;
	return p.parseFromString(xml);
}

 

 Advisory Consultant

View solution in original post

2 REPLIES 2

DavidPetty
Archer Employee
Archer Employee

@yassinederkaoui  you should be able to use the following:

function xmlStringToXmlDoc(xml){
	var p  = new xmldom.DOMParser;
	return p.parseFromString(xml);
}

 

 Advisory Consultant

Thank you so much, it works !