Altova StyleVision 2025 Enterprise Edition

An Auto-Calculation uses an XPath expression to calculate a value. This value is displayed at the point where the Auto-Calculation is inserted. An Auto-Calculation can be inserted in the SPS as a text value, input field, or multiline input field. Place the cursor at the location where the Auto-Calculation is to be inserted, then either right-click or use the command in the Insert menu. When the cursor is placed over Insert | Auto-Calculation, a menu pops out (screenshot below), enabling you to choose how the Auto-Calculation should be inserted. Alternatively, you can use the Auto-Calculation icon in the Insert Design Elements toolbar.

 

MnuInsertAutocalc

 

The value of the Auto-Calculation will be displayed accordingly in Authentic View and the output document.

 

The XPath expression for the Auto-Calculation

On selecting how the Auto-Calculation should be represented, the Edit XPath Expression dialog (screenshot below) pops up.

 

Click to expand/collapse

 

The context node for the expression being built is highlighted in the schema tree in the pane at extreme left. You can enter the XPath expression directly in the text box, or you can double click an item (in any of the three panes) to insert that item. Nodes inserted from the schema tree in the left-hand pane are inserted relative to the context node (if the Relative XPath check box is checked) or as an absolute expression starting from the document node (if the Relative XPath check box is unchecked).

 

After completing the XPath expression, click OK to finish inserting the Auto-Calculation.

 

Updating an XML node with an Auto-Calculation

A node in an XML document can be updated with the result of an Auto-Calculation. How to do this is described in the section, Updating Nodes with Auto-Calculations.

 

© 2018-2024 Altova GmbH