Good Afternoon,
I have to parse a number of XML files into an Oracle DB. Although they all have the same structure the Xpath loop may be different for each one as the internal nodes may or may not be iterative.
One solution would be to set up a number of passes on each file. However this would seem to be a costly way to do it.
Is there a way of flattening a XML file from its root?.
Regards.
NobbyHall
Hi,
There is a way flattening a XML file from its root.
Please see my screenshots
For more component reference, please review
tFileInputXML Best regards
Sabrina
Hi Sabrina, You're example works in that it returns a string with all nodes and values in it. What I need to do is flatten the data from the input file into a Oracle DB table. However, if I specify any mapping, then I only get a single line of data. So how would I adjust your example if I have multiple levels where each level can be both iterative and multi level?. Regards. Nobby
Sabrina,
Having further tested based on various posts I've found I am unable to find a solution with this approach as I am unable to set one node as the definitive xpath. In other words I would need to parse from the root.
The other alternative I believe I would have is to perform multiple parses on each XML file or construct multiple schemas going off to separate Oracle functions. Not only is this costly in terms of CPU and time it also forces me to use multiple tables as opposed to the one I need to use.
Regards.
Nobby
Janhess,
I tried using the tXSLT component. I'm not sure if I misunderstood it's use but I found two problems. Firstly that the output was directed into another file and secondly that I am unable to get the xsl template to compile against the XML files. They are 3rd party and the tags are all "AAA:BBB" format.
When I changed these to a more standard "abc" form both the xsl and xml compiled ok but no results appeared although blank rows were created for them. This is probably something wrong with my xsl.
I don't have time to improve my xsl/xml knowledge, I can't introduce another file layer into my project and using the several parses approach ends up with TOS throwing errors all over the place.
Think I'm going to give up and just do this in Java.
But thanks to all for your help.
Regards.
Rick.