Since the Remote command have such a huge number of parameters, we have to split the documentation into several documents. This document describes the XML part of remote lookup. 

What XML is supported

Remote do only (for now) have XML read support and only by setting the XML document manually from a string. When this is done using the remote("@setxml",xmlstring) command the remote session will be set in xml handling mode. You no longer have access to the default json structure and you can not update any data in the xml structures, only read.

Remote("@setxml",xmlstring) Set xml mode and parses the xml for use
Remote("elementname") Return the text inside the element Ex. <elm>This text is returned</elm>
Remote("elementname/subelementname") Return the text inside the subelement Ex.<elm><subelm>This text is returned</subelm></elm>
Remote("elm/sub.attrname") Return the value of the attribute in the sub element.
Ex. <elm><subelm attrname="This text is returned">Some other text</subelm></elm>
Remote("elm/sub[idx]") Return the text in the sub element number idx in an array starting at 0. Idx 1 is then the second element in the array and idx 0 the first.
Ex. Remote("elm/sub[1]") <elm><sub>First</sub><sub>This text is returned</sub></elm>
Remote("elm/sub[idx].attrname") Retrun the value of the attribute at index idx in the array. Array starts at 0.
Ex. Remote("elm/sub[0].atxt") <elm><sub atxt="This text is returned"></sub><sub atxt="This is the second"></sub></elm>

Example reading a XML

For the example we use a DQLs form holding 3 memo fields named DQL, Layout and Result and 4 text 255 named Field1-4. To run the dql in DQL memo field. we have a button that do a Execute Function/Derivation with ExecDQL(DQL,Field1,Field2,Field3,Field4)

<?xml version="1.0" encoding="UTF-8"?>
<response timestamp="20180111105314">
    <orderid>102220005</orderid>
    <authcode>12345</authcode>
    <result>00</result>
    <cardissuer>
        <bank>AIB BANK</bank>
        <country>IRELAND</country>
        <countrycode>IE</countrycode>
        <region>EUR</region>
    </cardissuer>
    <orderlines>
        <orderline price="600" count="5" total="3000">DataEase 8.6 Pro</orderline>
        <orderline price="1500" count="1" total="1500">Support</orderline>
    </orderlines>
    <payment>4500</payment>
</response>

The XML in Layout field

raw:
define temp "Dummy" text 255 .
Dummy := Remote("@setxml",GetValue("Layout")).
Dummy := SetValue("Result",stringescape(
    concat("Reading from the XML gives:/CR",
        "authcode: ", Remote("response/authcode"),
        "/CRtimestamp: ",  Remote("response.timestamp"),
        "/CRresult: ",  Remote("response/result"),
        "/CRbank: ",  Remote("response/cardissuer/bank") ,
        "/CRcountry: ",  Remote("response/cardissuer/country") ,
        "/CRcountrycode: ",  Remote("response/cardissuer/countrycode"),
        "/CROrderline 1:", Remote("response/orderlines/orderline[0]"),
        " -> ",Remote("response/orderlines/orderline[0].count"),
        "  ", Remote("response/orderlines/orderline[0].price"),
        "/CROrderline 2:", Remote("response/orderlines/orderline[1]"),
        " -> ",Remote("response/orderlines/orderline[1].count"),
        "  ", Remote("response/orderlines/orderline[1].price"),
        "/CRTotal: " , Remote("response/payment")
    )
)) .

The DQL in the DQL field

Reading from the XML gives:
authcode: 12345
timestamp: 20180111105314
result: 00
bank: AIB BANK
country: IRELAND
countrycode: IE
Orderline 1:DataEase 8.6 Pro -> 5  600
Orderline 2:Support -> 1  1500
Total: 4500

What is produced when pushing the button