Search code examples
orbeon

Why is the generated schema for form data in a different order than the form?


I noticed that in the generated schema for form data, the order of the schema does not match the order of the fields in the form. The order of the schema seems to exactly match the order of the bind elements. Those appear to be in no particular order. I probably wouldn't have noticed but it has led to a side effect in one case.

Aside from the top level sections, the elements of the schema are contained in a <xs:all> as opposed to <xs:sequence> which would enforce the sequence.

This leads me to believe that you have simply decided not to specify/enforce order in the schema.

So, I may be answering my own question here. Am I right about this?

Ideally, the schema would be in the same order as the form.


Solution

  • Element order in the schema follows the xf:bind order in the form definition. So far so good. However, the xf:bind order does not necessarily follow the control order. The latter, even if shouldn't result in any user-facing bug, isn't ideal, and is covered by issue 1361.