1 Reply Latest reply on Jan 17, 2018 3:00 PM by bkirchner-2 RSS
    bkirchner-2 Explorer

    XML LoadXML

    Hi All,

    I have a Site that I am reading xml data from. The problem that I have is using the loadXML script.

    if I run postman I get the following.


    <?xml version="1.0" encoding="UTF-8"?>


        <Rate Symbol="EURUSD">










    I have created a service that I want to use that will pull that information. as shown below.


    var params = {
    proxyScheme: undefined /* STRING */,
    headers: undefined /*'Rates' /* JSON */,
    url: http://thisisthewebsiteurl /* STRING */,
    timeout: '60' /* NUMBER */,


    // result: XML
    var xml_file = Resources["ContentLoaderFunctions"].LoadXML(params);

    var params = {
    fieldMap: undefined /* INFOTABLE */,
    xml: xml_file /* XML */,
    rowPath: 'Rate'  /* STRING */,
    dataShape: 'forex_xml' /* DATASHAPENAME */

    // result: INFOTABLE
    var result= Resources["UniversalConverterFunctions"].ConvertXML(params);


    this gives me the following.




    where symbol is missing.

    If I take rowPath: 'Rate'  out I get nothing.

    The issue I believe is that the <rate Symbol=xxxx> is embedded.

    Any idea how I can handle that seeing as I cant do anything with the xml file I'm reading.

      • Re: XML LoadXML
        chadha Apprentice

        Try adding this after the line 'var xml_file = ...'


        for(var index = 0; index < xml_file.Rate.length(); index++)

            xml_file.Rate[index].Symbol = xml_file.Rate[index].@Symbol.toString();