What would be the best way to import a very large XML-file into a production, modifying it depending on certain conditions, and creating a new XML file?
Hello everyone!
Sorry for the vague title! But I wonder what would be the best way to easily import a large XML-file into a production, modifying it by deleting elements and nodes depending on what values are in those nodes/elements and later creating whole new XML-file from that?
I have gone through this: Using Caché XML Tools | Caché & Ensemble 2018.1.4 – 2018.1.8 (intersystems.com)
But I get the sense that there are a lot of ways of approaching this, but I do not know what is the most effective for my certain needs.
I appreciate the help! Thanks beforehand! :)
Comments
Hi Emil,
I can think of 3 possible approaches.
1) Use XPATH
2) Modify the XML Document as a DOM
3) Use XSLT transformations
All 3 can be used/implemented in IRIS.
Enrico
P.S.: I suggest using the latest version of the documentation
Hello Enrico!
I will try your suggenstions!
Thank you very much once again! :)
Sounds like a perfect case for XSLT that is a special purpose language for transforming XML documents. See Performing XSLT Transformations to get started with XSLT In IRIS.
Thanks alot for the help! :)
XSLT unless we are talking about a very large files to be processed very quickly in which case SAX parser might be worth a consideration.