Dears
here is my xml sample
8
4
i am trying to use the below scripts expression to get data
var jobDataset = job.getDataset( "Xml" );
var ups =jobDataset.getPath("/data/upsnumber");
var copies=jobDataset.getPath("/data/copynumber");
but always show me error message
No matching slot found, available overloads are: QString DatasetXML::getPath()
Real appreciate anyone can help me to solve this problem.
Thanks
Nick
why i can't get the value from XML
why i can't get the value from XML
Hi Nick,
here is a script expression that will give you the value from your XML sample:
var theCopynumber = job.getVariableAsString('[Metadata.Text:Path="/data/copynumber",Dataset="Xml",Model=XML]')
In this example you'll get the valua as string, you can also use getVariableAsNumber, getVariableAsBoolean or getVariableAsDate, depending on your needs.
Hope this helps?
Carine
here is a script expression that will give you the value from your XML sample:
var theCopynumber = job.getVariableAsString('[Metadata.Text:Path="/data/copynumber",Dataset="Xml",Model=XML]')
In this example you'll get the valua as string, you can also use getVariableAsNumber, getVariableAsBoolean or getVariableAsDate, depending on your needs.
Hope this helps?
Carine
why i can't get the value from XML
Thanks much! it works.
but i found i get a wrong value perhaps. i am trying to check it with 'alert' function. but it seems it is not supported. how can i check the procedure variables like debug.print?
Thanks again
Nick
carineb wrote: Hi Nick,
here is a script expression that will give you the value from your XML sample:
var theCopynumber = job.getVariableAsString('[Metadata.Text:Path="/data/copynumber",Dataset="Xml",Model=XML]')
In this example you'll get the valua as string, you can also use getVariableAsNumber, getVariableAsBoolean or getVariableAsDate, depending on your needs.
Hope this helps?
Carine
but i found i get a wrong value perhaps. i am trying to check it with 'alert' function. but it seems it is not supported. how can i check the procedure variables like debug.print?
Thanks again
Nick
carineb wrote: Hi Nick,
here is a script expression that will give you the value from your XML sample:
var theCopynumber = job.getVariableAsString('[Metadata.Text:Path="/data/copynumber",Dataset="Xml",Model=XML]')
In this example you'll get the valua as string, you can also use getVariableAsNumber, getVariableAsBoolean or getVariableAsDate, depending on your needs.
Hope this helps?
Carine
why i can't get the value from XML
You can ceck the variable value:
job.log(1, 'value=' + myvariable)
job.log(1, 'value=' + myvariable)
why i can't get the value from XML
Real appreciate! works!
Thanks much
Nick
caio wrote: You can ceck the variable value:
job.log(1, 'value=' + myvariable)
Thanks much
Nick
caio wrote: You can ceck the variable value:
job.log(1, 'value=' + myvariable)