OL Learn

Parsing XML within Workflow


I have a job where I have a XML index file as per the below:


I am extracting most of the info and adding to local variables using a SetJobInfos and then passing into a data mapper which is reading in the PDF and adding the info from the XML as metadata. However I’m not sure how to get the values in parameters? So for example I would want to assign the value for DISTRIBUTION to a local variable called Postage.


To obtain the value of the value attribute for a specific name value, you’ll have to use a script similar to this:

var myXML = new ActiveXObject("msxml2.DomDocument");
var myElement = myXML.selectSingleNode('//parameters/parameter[@name="DISTRIBUTION"]');