- From: Mark Birbeck <Mark.Birbeck@x-port.net>
- Date: Thu, 3 Jul 2003 15:15:47 +0100
- To: "'Sasso, John J (Research, Logic Technology Inc.)'" <sasso@research.ge.com>, "'www-forms@w3.org'" <www-forms@w3.org>
Hi John, > PROBLEM: My understanding is that XForms requires an <xforms:model> > section in a doc's <head>, to describe what the forms do. There is no requirement on where any of the XForms elements appear in the host document. After all, the host language may not even have a 'head' element. > If I have to do this in the master doc, this ends up defeating the > intention of modularity I am trying to achieve. I'd prefer to have such > descriptive sections in the sub-docs themselves. I agree, and I don't see why you can't. We use the type of approach you describe quite a lot. For example, we have templates for things like currency or country selection which when expanded give a form like this: . . <head> <xf:model id="myData"> <xf:instance> <myData> <country /> <currency /> </myData> </xf:instance> </xf:model> </head> <body> <!-- expansion begins ---> <xf:model id="countryCodes"> <xf:instance src="countryCodes.xml" /> </xf:model> <xf:select1 model="myData" ref="country"> <xf:itemset model="countryCodes" nodeset="country"> . . . </xf:itemset> </xf:select1> <!-- expansion ends ---> <!-- expansion begins ---> <xf:model id="currencyCodes"> <xf:instance src="currencyCodes.xml" /> </xf:model> <xf:select1 model="myData" ref="currency"> <xf:itemset model="currencyCodes" nodeset="currency"> . . . </xf:itemset> </xf:select1> <!-- expansion ends ---> </body> As you can see the model and instance data sit near the UI control that uses it. Note also that there is no restriction on what order things appear in, or even that all models must be first, followed by all form controls. This way, everything needed for our 'country' UI or 'currency' UI can be bundled up as one template or include file. I would think you could do the same for your modules. Best regards, Mark Mark Birbeck Co-author Professional XML and Professional XML Meta Data, both by Wrox Press Download our XForms processor for IE 6 from http://www.FormsPlayer.com/ Managing Director x-port.net Ltd. 4 Pear Tree Court London EC1R 0DS E: Mark.Birbeck@x-port.net W: www.x-port.net T: +44 (20) 7689 9232
Received on Thursday, 3 July 2003 10:18:10 UTC