parsing xml using jquery (malformed xml)

parsing xml using jquery (malformed xml)

I have an XML that looks like this:


<?xml version="1.0" encoding="utf-8"?> <export> <Article URL="test"> <DisplayName>test</DisplayName> <Summary>test</Summary> <ThumbNail ID="test" URL="test" /> </Article> </export>


Which I'm looking to parse using jQuery. This works using the following code:


$.ajax({ url: 'https://[fqdn]/[filename].xml' }) .done(function(xml) { $(xml).find('Article').each(function() { console.log($(this).attr('URL')); console.log($(this).find('DisplayName').text()); console.log($(this).find('Summary').text()); console.log($(this).find('ThumbNail').attr('URL')); }); }) .fail(function(jqXHR, textStatus) { console.log(textStatus); })


All output is logged to the console, but at the end I'm getting an error saying the XML is malformed at line 1 column 78 which is causing my entire script to halt.

Is this the right way to go about this?

Adding dataType: "xml", and/or type: "GET", does not help.