Using XPath in Expression Boxes

You saw the basics of how XPath can be used with expression boxes in the previous section. In this section, we will put XPath to work in fairly straightforward ways, which can be used in practical production form templates.

Creating a Row Counter in a Repeating Table

In this example, we will create a repeating table to hold data derived from a W3C XML Schema. The W3C XML Schema document is shown in Listing 5.1.

Listing 5.1. A Source W3C XML Schema Document (SalesItems.xsd)
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="SalesItems" > <xsd:complexType> <xsd:sequence> <xsd:element name="SalesRow" minOccurs="1" maxOccurs="unbounded" > <xsd:complexType> <xsd:sequence> <xsd:element name="Item" ...

Get Microsoft® Office InfoPath™ 2003 Kick Start now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.