This information is in part taken from the O'Reilly book XForms Essentials. Used with permission.
Model item property is the somewhat unwieldy name XForms gives to XPath nodes that have additional XForms properties. XForms defines a number of such properties that, through the flexibility of XPath, can be applied readily to the instance data.
XForms 1.0 defines the following useful properties:
1, signals that the attached instance data must not be blank, and will prevent submission until that condition is met.
true()in order for the attached instance data to be considered valid. Therefore, all constraints must be met before submission can succeed.
Keep in mind that in XPath expressions, no default namespace applies, and thus prefixes must be used liberally.
All of these properties, other than
p3ptype accept full XPath expressions, which can contain more than the "location path" expressions earlier lessons have used. Some examples:
../price * ../quantity string-length('hello world!') total * instance('taxtable')/taxrate
Some commonly-used XPath features are backing up to a parent node (
..), addition (
+), subtraction (
-), multiplication (
*), division (
div), string length counting (
string-length()), checking one string for another (
contains()), calculating a sum of several nodes (
sum()), and referring to data in an <instance> with a given ID (