Latest News

the latest news from our team

Add or Count Values of XML Elements

Complete these steps to add the values of an element in an XML file. Counting the number of elements is very similar. The distinction is in Step 7.

  1. Start the eFORMz Composer, open the project file, and load an XML data file.
  2. Determine which element in the XML you want to add.
  3. This example adds all the values of the <quantity> element. In the Viewer, right click quantity > Add Variable. 
  4. In the Name field, add Sum to the end of the variable name so it is clear that this number is a sum. The following image shows the original values:
  5. In the Data Node field, move the last two nodes, order/quantity to the Node Filter field.
  6. Change the Transfer method field from Normal to Sum of child elements’ data, and then click OK. The following image shows the final values:
  7. The value of quantitySum is the sum of the <quantity> elements. To count the number of elements, change the transfer method from Sum of child elements’ data to Count of child elements.

Leave a Reply

Your email address will not be published. Required fields are marked *