parse responseText or change responseText in responseXML

Space

New Member
ok so my responseText contains an '&' character which seems to cause problems when parsing. so I want to grab my responseText and change the '\[code\]&\[/code\]' for '\[code\]&\[/code\]'I'm aware responseText is a String and ideally I want to feed this back into the responseXML to parse with the new xml with &any help much appreciated\[code\] responseXML = xmlhttp.responseXML; var myResponseText = "<document-metadata><item><name>ccms_customer_key</name><value>0100000931012004110</value></item><item><name>ccms_customer_name</name><value>Mr Joe Bloggs</value></item><item><name>ccms_customer_salutation_name</name><value>Mr</value></item><item><name>ccms_rm_name</name><value></value></item><item><name>ccms_dms_key</name><value>2432559OEKM</value></item><item><name>ccms_customer_address</name><value>Main & Street Dublin </value></item></document-metadata>"; /* if(myResponseText.indexOf('&') >= 0) { var str = myResponseText.replace(/&/g,"&"); return str; } */ //old line getSession().setAttribute('LH_METADATA_XML',xmlhttp.responseText); getSession().setAttribute('LH_METADATA_XML',myResponseText); // extract COMP_DMS_KEY from metadata var root = responseXML.getElementsByTagName('document-metadata').item(0);\[/code\]
 
Back
Top