I have a JDF XML file that I'm going to be receiving in Switch. The goal of the automation will be to take that JDF file, modify it, and hand it off to a downstream device (in this case, Esko Automation Server). By modifying the JDF, I mean that I need to remove several nodes, and insert several new nodes. The nodes would look something like:
My question is about the best approach to do this. The removing part seems pretty straight-foward., But it seems it could be incredibly tedious to build this whole chunk of XML using the createElement, appendChild, createText, addAttribute methods.
Is this the method that would be used to build each little piece of the XML, or is there a way to pass this whole chunk as a string to some addChild type method?
How to modify JDF XML file
-
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
How to modify JDF XML file
Hello, you have 3 methods to modify the JDF.
1) Treat it as a string and modify directly
2) Use Switch's XML API to parse, modify and write the JDF
3) Write a XSL transform
1) Treat it as a string and modify directly
2) Use Switch's XML API to parse, modify and write the JDF
3) Write a XSL transform