|
Answer» We can also perform binding b/w the XForms model and XForms user interface With bind ATTRIBUTE like that,
Example: I have given you XForms model instance:
<model> <instance> <PERSON> <name> <FNAME/> <mname/> <lname/> </name> </person> </instance> <bind nodeset="/person/name/fname" ID="firstname"/> <bind nodeset="/person/name/mname" id="middlename"/> <bind nodeset="/person/name/lname" id="LASTNAME"/> </model> Now, Using bind attribute XForms user interface can bind <input> elements like that:
<input bind="firstname"> <label>First Name</label> </input> <input bind="middlename"> <label>Middle Name</label> </input> <input bind="lastname"> <label>Last Name</label> </input> Using binding we can easily deal with multiple instance model and multiple forms. We can also perform binding b/w the XForms model and XForms user interface With bind attribute like that, Example: I have given you XForms model instance: <model> <instance> <person> <name> <fname/> <mname/> <lname/> </name> </person> </instance> <bind nodeset="/person/name/fname" id="firstname"/> <bind nodeset="/person/name/mname" id="middlename"/> <bind nodeset="/person/name/lname" id="lastname"/> </model> Now, Using bind attribute XForms user interface can bind <input> elements like that: <input bind="firstname"> <label>First Name</label> </input> <input bind="middlename"> <label>Middle Name</label> </input> <input bind="lastname"> <label>Last Name</label> </input> Using binding we can easily deal with multiple instance model and multiple forms.
|