- From: Christopher Clark <christophomos@yahoo.com>
- Date: Sun, 16 Oct 2005 21:12:16 -0700 (PDT)
- To: www-forms@w3.org
Right now I'm trying to write some Java code that parses an XML schema and produces XForms. (Chiba has a tool called Schema2XForms Builder, but it doesn't implement all of the xsd elements that my company's application requires). I have a solution to implementing xsd:choice, but it's memory requirements can explode exponentially when choices are nested. The solution I'm currently implementing involves an instance structure that is basically as follows: <myFavoriteLetter> <CHOICE> <a> <b> <c> <CHOICE> <CHOICE_RELEVANT>3</CHOICE_RELEVANT> </myFavoriteLetter> The choices are inside the <CHOICE> tag, and then I used a binding element to indicate which choice is relevant. In turn, only the controls pertaining the that choice are displayed on the form. The index number inside of the <CHOICE_RELEVANT> tag is changed by binding it to an XForms select1 control - each choice is labeled by the element name of the choice. Later I will flatten the instance data by removing the the CHOICE and CHOICE_RELEVANT tags (as well as other tags that I use for similar purposes) to wind up with something like the following: <myFavoriteLetter> <c> </myFavoriteLetter> Is there a better way to do this, or am I stuck with exponential space requirements? Chris --------------------------------- Yahoo! Music Unlimited - Access over 1 million songs. Try it free. --0-1861306899-1129522336=:89808 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit <DIV>Right now I'm trying to write some Java code that parses an XML schema and produces XForms. (Chiba has a tool called Schema2XForms Builder, but it doesn't implement all of the xsd elements that my company's application requires). I have a solution to implementing xsd:choice, but it's memory requirements can explode exponentially when choices are nested.</DIV> <DIV> </DIV> <DIV>The solution I'm currently implementing involves an instance structure that is basically as follows:</DIV> <DIV><myFavoriteLetter></DIV> <DIV> <CHOICE></DIV> <DIV> <a></DIV> <DIV> <b></DIV> <DIV> <c></DIV> <DIV> <CHOICE></DIV> <DIV> <CHOICE_RELEVANT>3</CHOICE_RELEVANT></DIV> <DIV></myFavoriteLetter></DIV> <DIV> </DIV> <DIV>The choices are inside the <CHOICE> tag, and then I used a binding element to indicate which choice is relevant. In turn, only the controls pertaining the that choice are displayed on the form. The index number inside of the <CHOICE_RELEVANT> tag is changed by binding it to an XForms select1 control - each choice is labeled by the element name of the choice. Later I will flatten the instance data by removing the the CHOICE and CHOICE_RELEVANT tags (as well as other tags that I use for similar purposes) to wind up with something like the following:</DIV> <DIV> <DIV><myFavoriteLetter></DIV> <DIV> <c></DIV> <DIV></myFavoriteLetter></DIV></DIV> <DIV> </DIV> <DIV>Is there a better way to do this, or am I stuck with exponential space requirements?</DIV> <DIV> </DIV> <DIV>Chris</DIV><p> <hr size=1> <a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/">Yahoo! Music Unlimited - Access over 1 million songs. Try it free.</a> --0-1861306899-1129522336=:89808--
Received on Monday, 17 October 2005 04:22:28 UTC