I am trying to import an XML file into Access 2002. The XML file has sub tags. Here is a sample below:
<?xml version="1.0"?>
<SalesExport StartDate="04/01/2002" EndDate="04/23/2002">
<Invoice>
<StoreNum>4</StoreNum>
<InvoiceNum>598</InvoiceNum>
<InvoiceDate>04-22-2002</InvoiceDate>
<InvoiceType>Normal</InvoiceType>
<InvoiceTotal>10.70</InvoiceTotal>
<InvoiceItem>
<Quantity>8.00</Quantity>
<ALU>DC00000003</ALU>
<Cost>0.00</Cost>
<Price>1.25</Price>
<ExtTotal>10.00</ExtTotal>
</InvoiceItem>
</Invoice>
The problem is that access will import the XML doc into two tables without maintaining any relationship. Ideally I would like the InvoiceItem table to contain the <InvoiceNum> field from the root of the XML doc. I think I need to define an XSD but I am not sure where to start. Can anyone point in the right direction maybe a tutorial link?
Thanks
<?xml version="1.0"?>
<SalesExport StartDate="04/01/2002" EndDate="04/23/2002">
<Invoice>
<StoreNum>4</StoreNum>
<InvoiceNum>598</InvoiceNum>
<InvoiceDate>04-22-2002</InvoiceDate>
<InvoiceType>Normal</InvoiceType>
<InvoiceTotal>10.70</InvoiceTotal>
<InvoiceItem>
<Quantity>8.00</Quantity>
<ALU>DC00000003</ALU>
<Cost>0.00</Cost>
<Price>1.25</Price>
<ExtTotal>10.00</ExtTotal>
</InvoiceItem>
</Invoice>
The problem is that access will import the XML doc into two tables without maintaining any relationship. Ideally I would like the InvoiceItem table to contain the <InvoiceNum> field from the root of the XML doc. I think I need to define an XSD but I am not sure where to start. Can anyone point in the right direction maybe a tutorial link?
Thanks