Alternative to string.split

Well, you should really just return the string back that you need, not the XML. If this is beyond your control however, then use the following:

Parse the XML in jquery (using $.parseXML), then query it:

var xml="<?xml version="1.0" encoding="utf-8"?> <string xmlns="http://myUrl.com">you said:This is a test --&gt;SHA1:7d9d2886509cfd1dfd3c693fff43b82561ec00a18621ce784d65b912e2013df6</string>";

var parsed = $($.parseXML(xml));

var test = parsed.find("string");

alert(test.text());

DEMO

Leave a Comment