Topic
  • No replies
victorqedu
victorqedu
1 Post

Pinned topic Select data for insert

‏2012-07-16T17:44:36Z |
I want to use xpath to extract data from a XML file and insert in a database to records.
This is the XML:
<?xml version="1.0" encoding="UTF-8"?>
<Catalogues>
<Error vF="drq"/>
<Error vF="cft" vT="emd"/>
</Catalogues>

If I select by the expresion Error/@* the result is {drq,cft,emd} and I will not know where a record has ended.
So when I will try to insert in the database I will not know if the inserts are
INSERT INTO test(vF, vT) VALUES('drq', '');
INSERT INTO test(vF, vT) VALUES('cft', 'emd');
OR
INSERT INTO test(vF, vT) VALUES('drq', 'cft');
INSERT INTO tes(vF, vT) VALUES('emd', '');

Can I solve this with Xpath?
Thank you.