EvalTo functions with JDF
Posted: Thu Nov 13, 2014 8:34 pm
Hello,
I'm trying to parse some data from a JDF ticket using the EvalToNodes() function, but don't seem to be having any luck.
Something like this:
var inputDIR = new Dir(job.getPath());
var jdfFileList = inputDIR.entryList("*.jdf", Dir.Files, Dir.Time);
var baseJDF = new Document(job.getPath() + "" + jdfFileList[0]);
var baseJDFdocElem = baseJDF.getDocumentElement();
var baseResourcePool = baseJDFdocElem.evalToNode("./jdf:ResourcePool", null);
I don't have issues using these functions on standard XML files, only with JDF. I've also tried with and without the "jdf:" prefix and no luck there. Do I need to do something with a prefix map to get this to work?
I can work around this using GetChildNodes() and parse the nodes for the base name that I need, but it would be a lot cleaner if I could use the EvalTo functions.
I'm trying to parse some data from a JDF ticket using the EvalToNodes() function, but don't seem to be having any luck.
Something like this:
var inputDIR = new Dir(job.getPath());
var jdfFileList = inputDIR.entryList("*.jdf", Dir.Files, Dir.Time);
var baseJDF = new Document(job.getPath() + "" + jdfFileList[0]);
var baseJDFdocElem = baseJDF.getDocumentElement();
var baseResourcePool = baseJDFdocElem.evalToNode("./jdf:ResourcePool", null);
I don't have issues using these functions on standard XML files, only with JDF. I've also tried with and without the "jdf:" prefix and no luck there. Do I need to do something with a prefix map to get this to work?
I can work around this using GetChildNodes() and parse the nodes for the base name that I need, but it would be a lot cleaner if I could use the EvalTo functions.