4.5 Complex Types

In XML Schema, a complex type is a datatype definition that can include element structure and attributes, which makes possible a number of additional (and, yes, complex) features including substitution groups, redefinition, and complex derivation. XForms includes the whole of XML Schema, though an easier-to-process profile that will leave out the complicated parts is still under development.

In many cases, the XML that will be processed by XForms already has a pre-existing XML Schema. In such cases it makes good sense to re-use the Schema by referencing it from the XForms Model. By doing so, additional datatype information will be made available to XForms.

If a Schema doesn't already exist, however, it's generally better to define only the minimum needed datatypes and leave it at that. The main reason for this recommendation is that many devices those that adhere to a simpler XForms profile will ignore all these more complicated features, and that any form that relies on them will produce different answers, depending on whether an XForms Full or XForms Basic device is accessing them.

For example, a Schema might define a coarse complexType that gets redefined into one with stricter validations. These stricter validations won't be seen by XForms Basic, and thus the unsuspecting person filling out the form might enter wrong values and have no idea they're even making a mistake.



XForms Essentials
Xforms Essentials
ISBN: 0596003692
EAN: 2147483647
Year: 2005
Pages: 117
Authors: Micah Dubinko

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net