Importing/Parsing XML using SQL and/or PL/SQL
443593Oct 19 2007 — edited Oct 23 2007What is the recomended way of importing/parsing XML data using SQL and/or PL/SQL?
I have an XSD that defines the structure of the file, and an XML file that has the content in the appropriate structure. I have parsed (checked) the structure of the XML file using JDOM in my java application, and then passed it to a function in a package on the database as a CLOB.
What I need to do is parse the contents of the XML file that is passed into the function and extract the values of each XML element so that I can then do some appropriate validation before inserting and committing the data to the database (hence completing the import function).
A DBA colleague of mine has been experimenting with various ways of acheiving this, but has encountered a number of problems along the way, one of which being that he thinks that it is not possible to parse XML elements that are nested more than four levels deep - is this the case?
The structure of the XSD/XML that the database function needs to manipulate and import data from is very complex (and recursive by it's nature).
I would appreciate any suggestions as to how I can achieve the above in the most efficient manner.
Thanks in advance for your help
David