1

I want to read xml inside the infopath form. I am saving all infopath forms after submitting into a form library. Now I want to read the xml inside that. I am doing like following,

$(function(){
    $.ajax({
        type:"GET",
        url:"/sites/mysite/DemandRequests/DR_37.xml",
        contentType:'xml',
        success:function(xmlContent){
            console.log(xmlContent);
        },
        error:function(){
            console.log('failed');
        }
    });
});

Content is coming as pure html. I am not finding any xml init. How to read only xml?

4
  • Can you post the value that is coming in object xmlContent Feb 3, 2015 at 12:11
  • It is coming as very big html. Entire page is coming
    – Mihir
    Feb 3, 2015 at 12:33
  • Yes post the relevant.. basically where the xml data is inside the entire html? Feb 3, 2015 at 12:41
  • There is no xml. output is coming as tables, that means xml was converted into the html
    – Mihir
    Feb 4, 2015 at 8:56

1 Answer 1

2

You can try this:

$(function(){
    $.ajax({
        type:'GET',
        url: '/sites/mysite/DemandRequests/DR_37.xml?NoRedirect=true',
        datatype: 'xml',
        cache: false,
        contentType: "text/xml; charset=\"utf-8\"",
        success:function(xmlContent){
            console.log(xmlContent);
        },
        error:function(){
            console.log('failed');
        }
    });
});
1
  • 2
    This worked for me. The key part is the NoRedirect. Thanks.
    – Mario
    Dec 9, 2015 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.