A Real-World Example

Despite the differences, comparisons between XForms and InfoPath are inevitable. Back in Chapter 2, we examined a UBL purchase order application. It is possible to recreate that application in InfoPath, and thus compare the results. Doing so is largely a hand-to-mouse experience with the InfoPath application. The result is shown in Figure A-1.

InfoPath design-time

Figure A-1. InfoPath design-time

Limitations in InfoPath made a few changes necessary—for example, there is no match for the range control—but overall the solution ended up quite similar to that of XForms.

One notable difference, however, is that tables, which can be seen in Figure A-1 as dotted lines, are required for any kind of layout, which might make things more challenging for non-visual users.

The other major difference was the lack of declarative elements. In XForms, the bind element establishes a relationship that the XForms Processor sticks to at all times. In InfoPath, script attached to a number of different entry points is required. The purchase order application had four assertions to maintain:

  1. A single currency code is copied into each repeating line item.

  2. Since the currency code appears in two places in each line item, it is copied to the second location.

  3. For each line item, the extended price is calculated as price times quantity.

  4. The total of the extended price across all line items is summed up.

In XForms, these ...

Get XForms Essentials now with the O’Reilly learning platform.

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