I want to create a file from an xml. My file have CODEITEM that contains the part #. I have many CODEITEM lines. How can I get all lines in my new file ?
Hard to say without additional information. You could use the XML splitter, which would allow you to iterate on all CODEITEM elements. Or you could use a script. Or you could use an XSLT transform task.
Do you want to create another XML file or just a plain text file? Does the CODEITEM element contain a single value or does it contain sub-elements?
// Open XML data file and read the ORDER_ITEMS element
var xmlDoc = new ActiveXObject("msxml2.DOMDocument.6.0");
xmlDoc.load(Watch.GetJobFileName());
var xmlRecs = xmlDoc.getElementsByTagName("ORDER_ITEMS");
// Create nex XML and append all elements previously read
var newDoc = new ActiveXObject("msxml2.DOMDocument.6.0");
for (var i=0; i<xmlRecs.length; i++) {
newDoc.appendChild(xmlRecs.item(i));
}
// Save new XML to the current job file
newDoc.save(Watch.GetJobFileName());