I\'m trying to import an XML file into Access but it creates 3 unrelated tables. That is, the child records are imported into the child table, but there is no way of knowing
What you need to do is transform your XML data into a format that works better with Access. Specifically, you need to insert the parent key value (assuming that it is C_NOT
in this case) into each child node.
The following XSLT file will do that for you
That will transform your XML from this ...
8404180
Abalos Nuevo
Francisco José
23
0888
1984-12-01
1986-09-19
14
0569
1990-09-17
1995-03-15
21
0412
1995-03-30
... into this:
8404180
Abalos Nuevo
Francisco José
8404180
23
0888
1984-12-01
1986-09-19
8404180
14
0569
1990-09-17
1995-03-15
8404180
21
0412
1995-03-30
... in the background while Access is importing it.
Save that XSLT file to your hard drive (I called mine "transformio.xslt"), then start the Access XML import process. Once you've selected your XML file to import, click the "Transform" button ...
... add your newly-created XSLT file to the list and select it ...
When you click "OK" and return to the "Import XML" dialog, you can expand the tree view to see that you now have C_NOT
values in both tables.
When the import is complete you will still have two tables, but now you can JOIN them on C_NOT
to get a "flat" view of the data:
which gives us