Structural Constraints in XForms XForms! XForms defines relationships called “invariants.” When one member of an invariant relationship changes, the other member(s) are updated automatically (similar to the way spreadsheets work). Currently XForms only allows invariants to be expressed between simple values (values that can be calculated with a simple expression), while structural changes can only be detected using XForms events. Could the invariant mechanisms of XForms be extended to handle invariants that express structure, without resorting to events? Yes, by considering structural invariants to be just a higher-level form of invariant, where the work of the structural invariant is to rebuild networks of lower-level simple invariants. Structural invariants can then be merged into the general XForms invariant recalculation, by treating the rebuild phase of the XForms update mechanism as a higher-level version of the current recalculate. == XForms is a declarative programming language for writing applications for the web and elsewhere. One of the central aspects of XForms is invariants that describe relationships between values, such that if a value changes or is changed, its related values specified in the invariant get updated automatically. This is much like how spreadsheets work, though is more general. A major advantage of this approach is that much administrative detail is taken out of the hands of the programmer, and done automatically: the programmer specifies the relationships, and the computer does the work. However, XForms in its current incarnation only allows invariants to be placed between simple content values, even though there are important relationships that could be specified over data structures as a whole. This paper explores what the possibilities are for extending the XForms invariant mechanism to more general cases.