For each model
element, the XForms Processor maintains
the state in an internal structure called instance data that conforms to
the XPath Data Model [XPath
1.0]. XForms Processors that implement DOM must provide DOM access
to this instance data via the interface defined below.
Note:
Instance data always has a single root element, and thus corresponds to a DOM Document.
instance
element when no parameter is given to getInstanceDocument()The IDL for this interface follows:
#include "dom.idl"
pragma prefix "w3c.org"
module xforms {
interface XFormsModelElement : dom::Element {
dom::Document getInstanceDocument(in dom::DOMString instanceID)
raises(dom::DOMException);
dom::NodeList getInstanceDocuments();
void rebuild();
void recalculate();
void revalidate();
void refresh();
};
};
This method returns a DOM Document that corresponds to the instance
data associated with the instance
element containing an
ID
matching the instance-id
parameter. If null
or the empty string is given,
the DOM Document for the default instance of the model is
returned. If there is no matching instance data, a
DOMException
is thrown.
Note:
This is actually not possible with the current spec.!
If the instance document is lazy-authored it will be the default instance, and can thus be retrieved by using no parameter or the empty string.
This method returns a DOM NodeList containing instance data DOM Documents for all instances in the model.
instance
element. As for the model
element, XForms Processors that
implement DOM must also provide DOM access to the instance data directly
via the instance
element.
The IDL for this interface follows:
#include "dom.idl" pragma prefix "w3c.org" module xforms { interface XFormsInstanceElement : dom::Element { dom::Document getInstanceDocument() raises(dom::DOMException); }; };
This method returns a DOM Document that corresponds to the instance
data associated with the instance
element. If there is
no instance data, a DOMException
is thrown.
instance
element in the form.is it evident that null will be returned if not called on an instance data node?
The XForms Processor must also provide support for the [DOM3 Core]DOMNode
interface getFeature
method
call "org.w3c.xforms.instanceOwner"
with the version string
"1.0"
. This method will return the DOM Element representing
the instance
element an instance data node belongs to.