In Adobe LiveCycle Designer (xfa forms), the summarization function in FormCalc can be as follows:
Sum(Row[*].parts_value)
The above must be converted to JavaScript and must be as follows:
formCalcSum(this, "Row[*].partial_value");
where formCalcSum is new JavaScript function defined as follows:
function formCalcSum(prmNode, prmListStr) {
var theList;
var theSum=0;
theList = prmNode.resolveNodes(prmListStr);
if (theList) {
for (var i=0; i < theList.length; i++) {
theSum += theList.item(i).rawValue;
}
}
return (theSum);
}
Can we write regex to achieve the above conversion using find/replace in Notepad++ for example?
(Note: the question was modified to simplify the required change and regex.)