Hi all,
I have an XML document that my app will accept and the document may have
more than one 'record' in the document (bear with me, I'm fairly new to XML
lingo).
Incoming document:
-----------Beginning of XML-----------
<?xml version="1.0" encoding="us-ascii"?>
<!--Product data from JDEdwards-->
<Root>
<Data PollDate="2003-10-21" PollTime="00.00.00">
<Product>
<File>F4450</File>
<Library>CODATA73</Library>
<ActionCode>C</ActionCode>
<TransDate>2003-10-21</TransDate>
<TransTime>05.28.56.612330</TransTime>
<Details Name="JDMCUS" Value=" 4014160000" />
<Details Name="JDALOT" Value="0110" />
<Details Name="JDSLKF" Value="C" />
<Details Name="JDCPJ" Value="103289" />
<Details Name="JDUSD5" Value="103112" />
<Details Name="JDUSD6" Value="103276" />
<Details Name="JDHSTY" Value="B" />
<Details Name="JDBYR" Value="187362" />
<OptionText Name="" Value="" />
</Product>
<Product>
<File>F4450</File>
<Library>CODATA73</Library>
<ActionCode>C</ActionCode>
<TransDate>2003-10-21</TransDate>
<TransTime>05.28.57.309718</TransTime>
<Details Name="JDMCUS" Value=" 4014200000" />
<Details Name="JDALOT" Value="4116" />
<Details Name="JDSLKF" Value="C" />
<Details Name="JDCPJ" Value="103289" />
<Details Name="JDUSD5" Value="103097" />
<Details Name="JDUSD6" Value="103261" />
<Details Name="JDHSTY" Value="B" />
<Details Name="JDBYR" Value="160291" />
<OptionText Name="" Value="" />
</Product>
</Data>
</Root>
-----------End of XML-----------
What I need to do is extract the data from the XML and process as
accordingly. Values I need to extract:
Record 1 -
sFile = "F4450"
sLibrary = "CODATA73"
sAction = "C"
sTranDate = "2003-10-21"
sTranTime = "05.28.56.612330"
sCenter = " 4014160000"
sNumber = "0110"
sArea = "C"
sDate1 = "103289"
sDate2 = "103112"
sDate3 = "103276"
sStatus = "B"
sResident = "187362"
I need to process the information from Record 1, once the processing is
complete, I need to loop and grab the next record values and process that
information.
Record 2 -
sFile = "F4450"
sLibrary = "CODATA73"
sAction = "C"
sTranDate = "2003-10-21"
sTranTime = "05.28.57.309718"
sCenter = " 4014200000"
sNumber = "4116"
sArea = "C"
sDate1 = "103289"
sDate2 = "103097"
sDate3 = "103261"
sStatus = "B"
sResident = "160291"
I've thought about bring the XML into a dataset and managing the extractions
that way but if there are any faster/more efficient ways to read XML, please
let me know.
TIA
-Rich