Hello,
I am wondering if someone could help me please with regards getting a value from an XML file whilst I am looping through the nodes
Basically I need to find the parent node name (Hopefully that's the correct term) of the XMLNode I have in context.
I have attached an example of the XML file I am reading data below.
If I am on the node on line 10 of the file I read the value 'Active' Successfully - I also need to somehow get the parent node name of PurchaseOrder (Line 1)
If I am on the node on line 23 of the file I read the value 'Material' Successfully - I also need to somehow get the parent node name of PurchaseOrderLine (Line 18)
I have tried various things including:
ParentNode := CurrentNode.Parentnode
Nodename := Parentnode.nodename
and
ParentNode := CurrentNode.selectSingleNode('..');
Nodename := Parentnode.nodename
but i either get the automation has not been instantiated errors, the value i get is 'IN USE' or the value 'Property' which Isnt what i need
Im ](*,) and any help would be greatly appreciated.
Lee
<PurchaseOrder>
<Properties>
<Property name="Po">4</Property>
<Property name="Code">PO00001</Property>
<Property name="Name">Vendor 1</Property>
<Property name="ShName">VENDOR1</Property>
<Property name="ExtCode">UNSPECIFIED</Property>
<Property name="Created">09/15/2015 15:30:26</Property>
<Property name="Modified">09/15/2015 15:30:26</Property>
<Property name="Active">True</Property>
<Property name="Supplier">475</Property>
<Property name="AcceptType">1</Property>
<Property name="DeliveryTime">07/22/2015 00:00:00</Property>
<Property name="DeliveryStatus">6</Property>
<Property name="AllowAdd">False</Property>
</Properties>
<PurchaseOrderLines>
<PurchaseOrderLine>
<Properties>
<Property name="Id">44</Property>
<Property name="Po">PO00001</Property>
<Property name="Sequence">10000</Property>
<Property name="Material">902</Property>
<Property name="ExtCode">Message 1</Property>
<Property name="OlStatus">3</Property>
<Property name="Expect">3</Property>
<Property name="MaxExpect">30</Property>
<Property name="Received">88</Property>
<Property name="AmountUm">200</Property>
<Property name="AllowChange">True</Property>
</Properties>
</PurchaseOrderLine>
<PurchaseOrderLine>
<Properties>
<Property name="Id">45</Property>
<Property name="Po">PO00001</Property>
<Property name="Sequence">20000</Property>
<Property name="Material">922</Property>
<Property name="ExtCode">Message 2</Property>
<Property name="OlStatus">3</Property>
<Property name="Expect">3</Property>
<Property name="MaxExpect">30</Property>
<Property name="Received">88</Property>
<Property name="AmountUm">200</Property>
<Property name="AllowChange">True</Property>
</Properties>
</PurchaseOrderLine>
<PurchaseOrderLine>
<Properties>
<Property name="Id">46</Property>
<Property name="Po">PO00001</Property>
<Property name="Sequence">30000</Property>
<Property name="Material">GAM023</Property>
<Property name="ExtCode">Message 3</Property>
<Property name="OlStatus">2</Property>
<Property name="Expect">0</Property>
<Property name="MaxExpect">300</Property>
<Property name="Received">125</Property>
<Property name="AmountUm">1801</Property>
<Property name="AllowChange">True</Property>
</Properties>
</PurchaseOrderLine>
<PurchaseOrderLine>
<Properties>
<Property name="Id">47</Property>
<Property name="Po">PO00001</Property>
<Property name="Sequence">40000</Property>
<Property name="Material">GAM024</Property>
<Property name="ExtCode">Message 4</Property>
<Property name="OlStatus">2</Property>
<Property name="Expect">0</Property>
<Property name="MaxExpect">3000</Property>
<Property name="AmountUm">1801</Property>
<Property name="AllowChange">True</Property>
</Properties>
</PurchaseOrderLine>
</PurchaseOrderLines>
<Pallets>
<Pallet>
<Properties>
<Property name="Id">55</Property>
<Property name="UnitType">3</Property>
<Property name="Site">bssi0001</Property>
<Property name="Number">16</Property>
<Property name="SSCC">000000</Property>
<Property name="Po">PO00001</Property>
<Property name="Prunit">prpr0001</Property>
<Property name="InvStatus">5</Property>
<Property name="ShipmentType">1</Property>
<Property name="Material">922</Property>
<Property name="Weight">88</Property>
<Property name="Nominal">88</Property>
<Property name="Gross">88</Property>
<Property name="Pieces">10</Property>
<Property name="Units">2</Property>
<Property name="CurAmount">2</Property>
<Property name="AmountUm">1800</Property>
<Property name="SubunitType">1</Property>
<Property name="Status">3</Property>
<Property name="HasCancels">False</Property>
<Property name="BegTime">09/15/2015 15:31:36</Property>
<Property name="EndTime">09/15/2015 15:31:36</Property>
<Property name="XactTime">09/15/2015 15:31:36</Property>
<Property name="RType">1</Property>
<Property name="RecordedBy">15</Property>
</Properties>
</Pallet>
<Pallet>
<Properties>
<Property name="Id">57</Property>
<Property name="UnitType">3</Property>
<Property name="Site">bssi0001</Property>
<Property name="Number">17</Property>
<Property name="SSCC">000000</Property>
<Property name="InvNum">14</Property>
<Property name="ExtNum">44</Property>
<Property name="Po">PO00001</Property>
<Property name="Prunit">prpr0001</Property>
<Property name="Inventory">2</Property>
<Property name="InvTime">09/15/2015 15:34:28</Property>
<Property name="InvStatus">0</Property>
<Property name="ShipmentType">1</Property>
<Property name="Material">902</Property>
<Property name="Weight">88</Property>
<Property name="Nominal">88</Property>
<Property name="Gross">88</Property>
<Property name="Pieces">0</Property>
<Property name="Units">1</Property>
<Property name="CurAmount">1</Property>
<Property name="AmountUm">1800</Property>
<Property name="SubunitType">1</Property>
<Property name="Status">3</Property>
<Property name="HasCancels">False</Property>
<Property name="BegTime">09/15/2015 15:34:26</Property>
<Property name="EndTime">09/15/2015 15:34:26</Property>
<Property name="XactTime">09/15/2015 15:34:28</Property>
<Property name="RType">1</Property>
<Property name="RecordedBy">15</Property>
</Properties>
</Pallet>
<Pallet>
<Properties>
<Property name="Id">58</Property>
<Property name="UnitType">3</Property>
<Property name="Site">bssi0001</Property>
<Property name="Number">18</Property>
<Property name="SSCC">000000</Property>
<Property name="InvNum">15</Property>
<Property name="ExtNum">46</Property>
<Property name="Po">PO00001</Property>
<Property name="Prunit">prpr0001</Property>
<Property name="Inventory">2</Property>
<Property name="InvTime">09/15/2015 15:35:01</Property>
<Property name="InvStatus">0</Property>
<Property name="ShipmentType">1</Property>
<Property name="Material">GAM023</Property>
<Property name="Weight">34</Property>
<Property name="Nominal">34</Property>
<Property name="Gross">34</Property>
<Property name="Pieces">100</Property>
<Property name="Units">1</Property>
<Property name="CurAmount">1</Property>
<Property name="AmountUm">1800</Property>
<Property name="SubunitType">1</Property>
<Property name="Status">3</Property>
<Property name="HasCancels">False</Property>
<Property name="BegTime">09/15/2015 15:35:01</Property>
<Property name="EndTime">09/15/2015 15:35:01</Property>
<Property name="XactTime">09/15/2015 15:35:01</Property>
<Property name="RType">1</Property>
<Property name="RecordedBy">15</Property>
</Properties>
</Pallet>
<Pallet>
<Properties>
<Property name="Id">66</Property>
<Property name="UnitType">3</Property>
<Property name="Site">bssi0001</Property>
<Property name="Number">19</Property>
<Property name="SSCC">000000</Property>
<Property name="InvNum">16</Property>
<Property name="Po">PO00001</Property>
<Property name="Prunit">prpr0001</Property>
<Property name="Inventory">2</Property>
<Property name="InvTime">09/15/2015 16:04:42</Property>
<Property name="InvStatus">0</Property>
<Property name="ShipmentType">1</Property>
<Property name="Material">GAM023</Property>
<Property name="Weight">34</Property>
<Property name="Nominal">34</Property>
<Property name="Gross">34</Property>
<Property name="Pieces">5</Property>
<Property name="Units">1</Property>
<Property name="CurAmount">1</Property>
<Property name="AmountUm">1800</Property>
<Property name="SubunitType">1</Property>
<Property name="Status">3</Property>
<Property name="HasCancels">False</Property>
<Property name="BegTime">09/15/2015 16:04:41</Property>
<Property name="EndTime">09/15/2015 16:04:41</Property>
<Property name="XactTime">09/15/2015 16:04:42</Property>
<Property name="RType">1</Property>
<Property name="RecordedBy">15</Property>
</Properties>
</Pallet>
<Pallet>
<Properties>
<Property name="Id">67</Property>
<Property name="UnitType">3</Property>
<Property name="Site">bssi0001</Property>
<Property name="Number">20</Property>
<Property name="SSCC">000000</Property>
<Property name="InvNum">17</Property>
<Property name="Po">PO00001</Property>
<Property name="Prunit">prpr0001</Property>
<Property name="Inventory">2</Property>
<Property name="InvTime">09/15/2015 16:23:24</Property>
<Property name="InvStatus">0</Property>
<Property name="ShipmentType">1</Property>
<Property name="Material">GAM023</Property>
<Property name="Weight">40</Property>
<Property name="Nominal">40</Property>
<Property name="Gross">40</Property>
<Property name="Pieces">0</Property>
<Property name="Units">1</Property>
<Property name="CurAmount">1</Property>
<Property name="AmountUm">1800</Property>
<Property name="SubunitType">1</Property>
<Property name="Status">3</Property>
<Property name="HasCancels">False</Property>
<Property name="BegTime">09/15/2015 16:23:24</Property>
<Property name="EndTime">09/15/2015 16:23:24</Property>
<Property name="XactTime">09/15/2015 16:23:24</Property>
<Property name="RType">1</Property>
<Property name="RecordedBy">15</Property>
</Properties>
</Pallet>
<Pallet>
<Properties>
<Property name="Id">68</Property>
<Property name="UnitType">3</Property>
<Property name="Site">bssi0001</Property>
<Property name="Number">21</Property>
<Property name="SSCC">000000</Property>
<Property name="InvNum">18</Property>
<Property name="ExtNum">46</Property>
<Property name="Po">PO00001</Property>
<Property name="Prunit">prpr0001</Property>
<Property name="Inventory">2</Property>
<Property name="InvTime">09/15/2015 16:49:30</Property>
<Property name="InvStatus">0</Property>
<Property name="ShipmentType">1</Property>
<Property name="Material">GAM023</Property>
<Property name="Weight">32</Property>
<Property name="Nominal">32</Property>
<Property name="Gross">32</Property>
<Property name="Pieces">0</Property>
<Property name="Units">1</Property>
<Property name="CurAmount">1</Property>
<Property name="AmountUm">1800</Property>
<Property name="SubunitType">1</Property>
<Property name="Status">3</Property>
<Property name="HasCancels">False</Property>
<Property name="BegTime">09/15/2015 16:49:30</Property>
<Property name="EndTime">09/15/2015 16:49:30</Property>
<Property name="XactTime">09/15/2015 16:49:30</Property>
<Property name="RType">1</Property>
<Property name="RecordedBy">15</Property>
</Properties>
</Pallet>
<Pallet>
<Properties>
<Property name="Id">69</Property>
<Property name="UnitType">3</Property>
<Property name="Site">bssi0001</Property>
<Property name="Number">22</Property>
<Property name="SSCC">000000</Property>
<Property name="InvNum">19</Property>
<Property name="ExtNum">46</Property>
<Property name="Po">PO00001</Property>
<Property name="Prunit">prpr0001</Property>
<Property name="Inventory">2</Property>
<Property name="InvTime">09/15/2015 16:53:21</Property>
<Property name="InvStatus">0</Property>
<Property name="ShipmentType">1</Property>
<Property name="Material">GAM023</Property>
<Property name="Weight">37</Property>
<Property name="Nominal">37</Property>
<Property name="Gross">37</Property>
<Property name="Pieces">10</Property>
<Property name="Units">1</Property>
<Property name="CurAmount">1</Property>
<Property name="AmountUm">1800</Property>
<Property name="SubunitType">1</Property>
<Property name="Status">3</Property>
<Property name="HasCancels">False</Property>
<Property name="BegTime">09/15/2015 16:53:21</Property>
<Property name="EndTime">09/15/2015 16:53:21</Property>
<Property name="XactTime">09/15/2015 16:53:21</Property>
<Property name="RType">1</Property>
<Property name="RecordedBy">15</Property>
</Properties>
</Pallet>
<Pallet>
<Properties>
<Property name="Id">70</Property>
<Property name="UnitType">3</Property>
<Property name="Site">bssi0001</Property>
<Property name="Number">23</Property>
<Property name="SSCC">000000</Property>
<Property name="InvNum">20</Property>
<Property name="ExtNum">46</Property>
<Property name="Po">PO00001</Property>
<Property name="Prunit">prpr0001</Property>
<Property name="Inventory">2</Property>
<Property name="InvTime">09/15/2015 17:01:53</Property>
<Property name="InvStatus">0</Property>
<Property name="ShipmentType">1</Property>
<Property name="Material">GAM023</Property>
<Property name="Weight">46</Property>
<Property name="Nominal">46</Property>
<Property name="Gross">46</Property>
<Property name="Pieces">5</Property>
<Property name="Units">1</Property>
<Property name="CurAmount">1</Property>
<Property name="AmountUm">1800</Property>
<Property name="SubunitType">1</Property>
<Property name="Status">3</Property>
<Property name="HasCancels">False</Property>
<Property name="BegTime">09/15/2015 17:01:53</Property>
<Property name="EndTime">09/15/2015 17:01:53</Property>
<Property name="XactTime">09/15/2015 17:01:53</Property>
<Property name="RType">1</Property>
<Property name="RecordedBy">15</Property>
</Properties>
</Pallet>
<Pallet>
<Properties>
<Property name="Id">71</Property>
<Property name="UnitType">3</Property>
<Property name="Site">bssi0001</Property>
<Property name="Number">24</Property>
<Property name="SSCC">000000</Property>
<Property name="ExtNum">46</Property>
<Property name="Po">PO00001</Property>
<Property name="Prunit">prpr0001</Property>
<Property name="InvStatus">5</Property>
<Property name="ShipmentType">1</Property>
<Property name="Material">GAM023</Property>
<Property name="Weight">56</Property>
<Property name="Nominal">56</Property>
<Property name="Gross">56</Property>
<Property name="Pieces">5</Property>
<Property name="Units">1</Property>
<Property name="CurAmount">1</Property>
<Property name="AmountUm">1800</Property>
<Property name="SubunitType">1</Property>
<Property name="Status">3</Property>
<Property name="HasCancels">False</Property>
<Property name="BegTime">09/15/2015 17:04:41</Property>
<Property name="EndTime">09/15/2015 17:04:41</Property>
<Property name="XactTime">09/15/2015 17:04:41</Property>
<Property name="RType">1</Property>
<Property name="RecordedBy">15</Property>
</Properties>
</Pallet>
</Pallets>
</PurchaseOrder>
0