Querying data from XML using node names
Posted: Tue Jun 14, 2011 9:42 pm
Hi All,
I'm struggling with a problem for awhile. It's clear how to fetch specific data from an external dataset in PowerSwitch, but what if the data is a 'moving target'? Example:
var theDataset = job.getDataset("pi4"); // external dataset added by Callas pdfToolbox
var theOutputIntent = theDataset.evalToString( "/*/*[1]/*[4]/*[4]/*/*[4]" );
That's working fine, until the needed data is at the very same place. But in certain files the XPath should be something else, like "/*/*[1]/*[4]/*[5]/*/*[4]".
How can I query the needed info using the node names of the XML? Of course I know the node names, which are:
/report
/document
/resources
/output_intents
/output_profilename
Thanks in advance, kind regards,
Peter
I'm struggling with a problem for awhile. It's clear how to fetch specific data from an external dataset in PowerSwitch, but what if the data is a 'moving target'? Example:
var theDataset = job.getDataset("pi4"); // external dataset added by Callas pdfToolbox
var theOutputIntent = theDataset.evalToString( "/*/*[1]/*[4]/*[4]/*/*[4]" );
That's working fine, until the needed data is at the very same place. But in certain files the XPath should be something else, like "/*/*[1]/*[4]/*[5]/*/*[4]".
How can I query the needed info using the node names of the XML? Of course I know the node names, which are:
/report
/document
/resources
/output_intents
/output_profilename
Thanks in advance, kind regards,
Peter