My problem was that the XML that I was pulling from another site output the actual XML data as encoded HTML ... IE:
<status> <eventData> <net id="District 3" name="District 3"> <updateTimestamp>2014-04-16T22:15:42-05:00</updateTimestamp> <category>Current</category> </eventData> </status>
So, I did not control how it is output, and initially I just used basic jQuery via ajax to get the XML, and then with the returned data
$.get(eventDataURL, {}, function (rawXML) { var xml = $(rawXML).text(); }
If I used $(rawxml).text(); , he allowed to go through each, a problem arose when I submitted this data to $(xml).find('event').filter(function(){ ....
As soon as he went through .find and .filter , all the events received were lost and made a lot of problems for things that relied on the camel body.
So, a simple fix was similar to the others mentioned above:
$.get(eventDataURL, {}, function (rawXML) { var xmlText = $(rawXML).text(); xml = $.parseXML(xmlText); }
Just using $.parseXML , it converts this text into a valid XML document that camelCasing has not lost.
sMyles
source share