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?

  • Can you post the value that is coming in object xmlContent – Amal Hashim Feb 3 '15 at 12:11
  • It is coming as very big html. Entire page is coming – Mihir Feb 3 '15 at 12:33
  • Yes post the relevant.. basically where the xml data is inside the entire html? – Amal Hashim Feb 3 '15 at 12:41
  • There is no xml. output is coming as tables, that means xml was converted into the html – Mihir Feb 4 '15 at 8:56
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');
        }
    });
});
| improve this answer | |
  • 2
    This worked for me. The key part is the NoRedirect. Thanks. – Mario Dec 9 '15 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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