Retrieving Document Data

The following pseudo code is an example of retrieving data out of a compound element using the GetPropertyByName and GetPropertyByIndex methods:

&COM = &DOC.DocumentElement;
 
&LNG_Code = &COM.GetPropertyByName("Language_Code").Value;
 
&COM_TRID = &COM.GetPropertyByName("TransactionId");
&data = &COM_TRID.GetPropertyByName("issuer").Value;
&data = &COM_TRID.GetPropertyByName("TransactionId").Value;
 
&COM_BILLTO = &COM.GetPropertyByName("BillTo");
&data = &COM_BILLTO.GetPropertyByName("name").Value;
&data = &COM_BILLTO.GetPropertyByName("number").Value;
&data = &COM_BILLTO.GetPropertyByIndex(3).Value;
&data = &COM_BILLTO.GetPropertyByIndex(4).Value;
&data = &COM_BILLTO.GetPropertyByName("city").Value;
&data = &COM_BILLTO.GetPropertyByName("state").Value;
&data = &COM_BILLTO.GetPropertyByName("zipcode").Value;
 
&COM_SHIPTO = &COM.GetPropertyByName("ShipTo");
&PRIM = &COM_SHIPTO.GetPropertyByName("name");
&data = &PRIM.Value;
&data = &COM_SHIPTO.GetPropertyByName("number");
&data = &PRIM.Value;
&data = &COM_SHIPTO.GetPropertyByIndex(3).Value;
&data = &COM_SHIPTO.GetPropertyByIndex(4).Value;
&data = &COM_SHIPTO.GetPropertyByName("city").Value;
&data = &COM_SHIPTO.GetPropertyByName("state").Value;
&data = &COM_SHIPTO.GetPropertyByName("zipcode").Value;
 
&COll_ITEMS = &COM.GetPropertyByName("item_collection");
 
For &i = 1 To &COll_ITEMS.GetCount
   
   &COM_ITEM = &COll_ITEMS.GetItem(&i);
   &data = &COM_ITEM.GetPropertyByName("items").Value;
   &data = &COM_ITEM.GetPropertyByName("sku").Value;
   &data = &COM_ITEM.GetPropertyByName("price").Value;
   &data = &COM_ITEM.GetPropertyByName("quantity").Value;
   
End-For;