Code: Select all
<xx.yy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xx.se/schemas/xx.yy/3.0/integration IntegrationDocumentSchema.xsd" xmlns="http://xx.se/schemas/xx.yy/3.0/integration">
<Envelope>
<Client>Cusomer</Client>
</Envelope>
<Data>
<Item>
<Number>11111</Number>
<Balance>2</Balance>
</Item>
<Item>
<Number>2222</Number>
<Balance>4</Balance>
</Item>
</Data>
</xx.yy>
Code: Select all
function jobArrived( s : Switch, job : Job )
{
var path = s.getSpecialFolderPath("PluginResources");
var companyXML = File.toNativeSeparators(path + "/myXML.xml");
var selectedNode;
var company = new Document(companyXML);
//var companyns = company.createDefaultMap();
var companyItems = company.evalToNodes("/xx.yy/Data/Item", null);
//var companyItems = company.evalToNodes("/xx.yy/Data/Item", companyns);
for (var i = 0; i < companyItems.length; i++) {
s.log(1, "Loop working");
}
}
Code: Select all
<xx>
<Envelope>
<Client>Cusomer</Client>
</Envelope>
<Data>
<Item>
<Number>11111</Number>
<Balance>2</Balance>
</Item>
<Item>
<Number>2222</Number>
<Balance>4</Balance>
</Item>
</Data>
</xx>