Hi,
I have a jdf file which I added to an asset (JDF pickup) and now I would like to access Metadata via a script expression.
I am struggling with the syntax.
Can someone send me an example about how to access the xml(jdf) data?
Thanks
Ariel
Access Metadata within script
-
ArielRauch
- Advanced member
- Posts: 230
- Joined: Thu Aug 07, 2014 10:04 am
Wow, thanks - did not think of that way.
What about the other (probably more complicated way) via the metadata interface (getString())? Do you have any examples for it - (I know I should stop here - but my technical inside shouts for knowing the other possibility:))
What about the other (probably more complicated way) via the metadata interface (getString())? Do you have any examples for it - (I know I should stop here - but my technical inside shouts for knowing the other possibility:))
var dataset = job.getDataset("Name of dataset, probably Jdf");
var metadata = new Document(dataset.getPath());
var namespaceMap = metadata.createDefaultMap();
var jobID = metadata.evalToString("/jdf:JDF/@JobID",namespaceMap);
s.log(1,jobID);
Freddy
var metadata = new Document(dataset.getPath());
var namespaceMap = metadata.createDefaultMap();
var jobID = metadata.evalToString("/jdf:JDF/@JobID",namespaceMap);
s.log(1,jobID);
Freddy
-
ArielRauch
- Advanced member
- Posts: 230
- Joined: Thu Aug 07, 2014 10:04 am
thank you very much, Freddy.
I already implemented your first approach but I will probably change it to this solution.
Again thanks,
Ariel
I already implemented your first approach but I will probably change it to this solution.
Again thanks,
Ariel