The GET command is used to read the data from the inbound document object.

The GET command is integral part of loading data from an XML document into your program. It must be preceded by the READ and the BIND commands.




 GET ---------- LIST ---------- value ---------------------------->


            >-- FRAGMENT ------ value ---------------------------->


            >-- SUBSET -------- value ---------------------------->


            >-- INSTRUCTION --- value ----------------------------|




This keyword is used to get a list from the loaded XML document.

Refer to the Lists and Variables section below for further details on how to use this keyword.

This keyword is conditional.


This keyword is used to get a field fragment from the loaded XML document.

Refer to the Lists and Variables section below for further details on how to use this keyword.

This keyword is conditional.


Optional. See SUBSET.


This keyword is used to get the XML processing instructions.

This keyword is optional.

Comments / Warnings

You can only use one keyword at a time.

There are two ways in which you can read a list from an XML document.

1.  You can either define the relevant section of the XML code as a list (using the XML Binding Wizard), and use the LIST keyword in your GET command. This will retrieve the entire list in one go into a working list.

2.  Alternatively, you can define the relevant section as a collection of fragments (using the XML Binding Wizard) and then use the FRAGMENT keyword in your GET command and place this in a loop.

See the Examples for details of how to do this.

Note: Fragments and Lists

The following points are important when using GET FRAGMENT and GET LIST together.

Lists and Variables

If you are using the LIST keyword to return a list from the loaded document into your program, you will need to ensure the following steps are taken in your program.

1.  Define a working list that contains the fields that you are expecting from the XML document.

2.  Use the SERVICE_LIST keyword with the LIST keyword in the GET command. The service list value should include the names of the fields in your working list without the '#'. The order of the fields should be defined here as they appear in the working list.

3.  In the TO_GET portion of the JSM_COMMAND Built-In Function, include the name of the working list that will hold the values returned.

If you are using the FRAGMENT keyword to return a field or group of fields, then you will need to add the SERVICE_EXCHANGE keyword with a value of '*FIELD'.

See the Examples for details on how to do this.




* Define JSM fields





* Define a list to hold the order line details



* Get SalesOrder Details




* Get Lines




INSTRUCTION keyword example

If the XML processing instructions were as per the following example:

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


<Orders xmlns="here" here="yes"> 


Then you could use the following code to retrieve the instructions.



In this example, the instruction would be placed into the #JSMMSG field.



* Define the fields used by the JSM Commands