-1

i get this response form web service in my java script.

< string xmlns="http://tempuri.org/"> $,100559,11:05,22.298953,70.795753,# < string>

how to get this string to simply string as mention below.

I want string like this : $,100559,11:05,22.298953,70.795753,#

Zaheer Ahmed
  • 28,160
  • 11
  • 74
  • 110

1 Answers1

0

Javascript based solution for converting xml to string and vice versa :

function StringToXML(oString) {
//code for IE
if (window.ActiveXObject) {
var oXML = new ActiveXObject("Microsoft.XMLDOM"); oXML.loadXML(oString);
return oXML;
}
// code for Chrome, Safari, Firefox, Opera, etc.
else {
return (new DOMParser()).parseFromString(oString, "text/xml");
}
}

function XMLToString(oXML)
{
//code for IE
if (window.ActiveXObject) {
var oString = oXML.xml; return oString;
}
// code for Chrome, Safari, Firefox, Opera, etc.
else {
return (new XMLSerializer()).serializeToString(oXML);
}
}
Vijay
  • 2,965
  • 1
  • 15
  • 24