tags:

views:

32

answers:

0

I have an XML file I need to import into an Access table, however, the XML is formatted for reporting and not for data transfer. Does someone has some code samples of how to loop through this sample document I've pasted below and pull the data out of the elements? I also need to be able to skip some SECTIONS as you can see in the example, the Page Header and Page Footer I don't care about just the data in the DETAILS section. I have not done any XML importing except for the automated ones in Access, so any code snippets will help. Thanks for the help.

 <REPORT name="rptMyReport">
  <SECTION name="PageHeader">
    <FIELD name="titleLbl" value="My Report Title" />
    <FIELD name="agencyName" value="Name of Agency" />
    <FIELD name="criteriaString" value="Subtitle" />
    <FIELD name="EmpNameLbl3" value="Column1" />
    <FIELD name="EmpNameLbl16" value="Column2" />
    <FIELD name="EmpNameLbl17" value="Column3" />
  </SECTION>
  <SECTION name="Detail">
    <FIELD name="FirstNameCtl" value="DOE, JANE - 000000" />
    <FIELD name="StartDateCtl" value="02/02/10" />
    <FIELD name="StopDateCtl" value="04/02/10" />
    <FIELD name="HHRGAmountCtl" value="$0.00" />
    <FIELD name="ActualCostCtl" value="$0.00" />
  </SECTION>
  <SECTION name="PageFooter">
    <FIELD name="EmpNameLbl19" value="Footline 1" />
    <FIELD name="EmpNameLbl20" value="Footline 2" />
    <FIELD name="lblLocal" value="6/14/2010 4:06:01 PM" />
    <FIELD name="ftrLeft2" value="Details" />
    <FIELD name="ftrLeft3" value="More Details" />
    <FIELD name="ftrRight1" value="Page 1 of #&#x8;Pages&#x8;#&#x8;#" />
  </SECTION>
</REPORT>