- Local time
- Today, 10:59
- Joined
- Sep 12, 2006
- Messages
- 15,980
What am I missing?
what is the purpose of import xml?
if I have an xml file of invoices structured like this (and in practice its much more complex, but this gives you the idea)
batch
invoice
header
line
ticketnumber
date
qty
line
ticketnumber
date
qty
invoice
header
line
ticketnumber
date
qty
line
ticketnumber
date
qty
trailer
-------------
if i just import this table by importing the xml, each of these attributes end up in a table of there own - with no relation between them.
instead what i want is
a) a table of invoice numbers
b) a table of invoicelines LINKED to the invoice numbers
etc
-----------------
is this what style sheets, and transforms are for? - because otherwise it just seems a waste of time!
----------------
what I have ended up doing is recursively walking all the nodes of the xml tree, and manually extracting the information I need - which is very quick, but is a bit of a brute force approach (akin to importing a csv file by manually reading in and parsing each row) but I am sure I am missing a simpler solution.
and the other thing thats the devils own job is extracting attributes from a node! (or even realising that they are there to extract - becuase if you open an xml in notepad, you can see them - but with an xml viewer you cant (without knowing you are looking for something)
what is the purpose of import xml?
if I have an xml file of invoices structured like this (and in practice its much more complex, but this gives you the idea)
batch
invoice
header
line
ticketnumber
date
qty
line
ticketnumber
date
qty
invoice
header
line
ticketnumber
date
qty
line
ticketnumber
date
qty
trailer
-------------
if i just import this table by importing the xml, each of these attributes end up in a table of there own - with no relation between them.
instead what i want is
a) a table of invoice numbers
b) a table of invoicelines LINKED to the invoice numbers
etc
-----------------
is this what style sheets, and transforms are for? - because otherwise it just seems a waste of time!
----------------
what I have ended up doing is recursively walking all the nodes of the xml tree, and manually extracting the information I need - which is very quick, but is a bit of a brute force approach (akin to importing a csv file by manually reading in and parsing each row) but I am sure I am missing a simpler solution.
and the other thing thats the devils own job is extracting attributes from a node! (or even realising that they are there to extract - becuase if you open an xml in notepad, you can see them - but with an xml viewer you cant (without knowing you are looking for something)