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.
Figure A-1. InfoPath design-time
Limitations in InfoPath made a few changes necessary—for
example, there is no match for the
control—but overall the solution ended up quite similar to that
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
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:
A single currency code is copied into each repeating line item.
Since the currency code appears in two places in each line item, it is copied to the second location.
For each line item, the extended price is calculated as price times quantity.
The total of the extended price across all line items is summed up.
In XForms, these ...