Is is possible to pass values retrieved using xpath() into the div([value]) or divide([value]) Math formatters?
I want to do something like this in an XML Map connector
mxpath(ConsignmentNode/DefinitionOfGoods/TotalKilos) | div(xpath(ConsignmentNode/DefinitionOfGoods/TotalFull)| add(xpath(ConsignmentNode/DefinitionOfGoods/TotalHalf)) | add(xpath(ConsignmentNode/DefinitionOfGoods/TotalOversize))))]!--endfragment>!--startfragment>
which in pseudo code is
Weight = Total Kilos / (Full + Half + Oversize)
Things like “….| div(2)” work, but I can’t seem to get it to work with values from other parts of the message.
Even simplifying to
nxpath(ConsignmentNode/DefinitionOfGoods/TotalKilos) | divide(xpath(ConsignmentNode/DefinitionOfGoods/TotalHalf))]
gets the same error:
Formatter divide failed in the evaluation of <weight> xpath(ConsignmentNode/DefinitionOfGoods/TotalKilos) | divide(xpath(ConsignmentNode/DefinitionOfGoods/TotalHalf))]</weight>. The error was: Error parsing BigDecimal value xpath(ConsignmentNode/DefinitionOfGoods/TotalHalf)]. Value: 2000