Search code examples
orbeonxforms

Orbeon: getting all input fields to display


I'm trying to use Orbeon 3.9 CE to create an editor for XML documents. I've hit a problem in that the xforms fields I've created for the various attributes don't show up in the web form if the existing input XML document does not have them. I've searched Stack Overflow and the Orbeon doc and wiki but haven't been able to find a setting to fix this.


Solution

  • This is implemented according to the specification: if the ref resolves to an empty sequence (or "empty nodeset" in the XPath 1.0 parlance used by the XForms 1.1 spec), then the control is considered non-relevant. There is no provision for having the node created automatically if missing. So this would need to be done either:

    1. Outside of XForms, in a phase of pre-precessing of the XML to add missing element or attributes.
    2. In XForms, after the instance is loaded, by inserting nodes in the instance as appropriate.

    Unless you need to add just a few nodes, the first option is most likely more appropriate.