In Microsoft Office InfoPath 2007 or in Microsoft Office InfoPath 2003, when you use an InfoPath form that contains calculations, values from the OriginalData nodes may be included with values from the selected nodes that are used in the calculations. This behavior is unexpected.
Therefore, the results of the calculations in the InfoPath form are incorrect.
This problem occurs when the calculations in the InfoPath form contain an XPath expression that starts with two slash marks (//). The OriginalData nodes are in the same namespace as the nodes in the DataSet object.
For example, the following calculation returns the correct results.
To work around this problem, use one of the following methods:
Use the selectSingleNode method, and specify the exact XPath expression that you want to use.
If you have to use the selectNodes method to create a multiple-selection XPath expression, select all nodes that you want to use under the first DataSet construct. For example, if you have a DataSet object that is named DataSet, use an XPath expression that follows the following format:
Note For more information about how to create an XML Web service by using Microsoft Visual Basic or Microsoft Visual C#, visit the following Microsoft Developer Network (MSDN) Web site:
In InfoPath 2003, click Design a Formon the File menu.
In InfoPath 2007, click Web Service, and then click OK.
In InfoPath 2003, click New from Data Connection, click Web service, and then click Next.
Click Receive data, and then click Next.
In the Enter the location of the Web service you want to use as your data connection box, type the location of the Web service that you created in the "Create an XML Web service" section, and then click Next.
In InfoPath 2007, select the UntypedDataSetQuery method, and then click Next two times.
In InfoPath 2003, select the UntypedDataSetQuery method, and then click Next.
Type a name for this data connection, and then click Finish.
Test the form with XPath expressions
On the Insert menu, click More Controls.
Click the Expression Box control.
In the Insert Expression Box dialog box, click fx.
In the Insert Formula dialog box, click Insert Function. The Insert Function dialog box appears.
Select All for Categories, select sum for Functions, and then click OK.
Double-click double click to insert field. The Select a Field or Group dialog box appears.
Expand dataFields, select the id field, and then click OK.
In the Insert Formula dialog box, click to select the Edit XPath (advanced) check box. Notice the following XPath expression in the Formula box.