RE: Critical Questions

Dear all,

I think the answer to Sherine's first question is that it is quite
straightforward to build forms from schemas, although you would probably
need to have a set of external rules that help the process determine
when (for example) a value can be entered via an xf:select1, and when it
might just be an xf:input. You could put these into the schema as
extensions.

We will be releasing some custom control features in the new year, for
formsPlayer, which will allow you to drive the process of selecting a
control based on data type more easily.

On the second question; Susan explained how you can validate with a
schema, but just to add to that, another interepretation of your
question might be 'how do I get rid of <instanceData>'! If that is what
you are asking, then you may be reading a very old tutorial, or looking
at a sample where someone has used <instanceData> just as a convenient
name for the root element (we do that in the formsPlayer samples). Your
instance data does not have to contain <instanceData> though, so you
don't need to do any translation on a server.

Regards,

Mark


Mark Birbeck
CEO and CTO
x-port.net Ltd.

100% conformant XForms processor
http://www.formsPlayer.com


-----Original Message-----
From: www-forms-request@w3.org [mailto:www-forms-request@w3.org] On
Behalf Of Borgrink, Susan
Sent: 09 December 2003 13:26
To: KHOURY Shérine (Dr&T); www-forms@w3.org
Subject: RE: Critical Questions



Sherine, 

	Your first question was a little confusing, but I think you are
asking if there is a way to auto-generate an XForms document from the
XML Schema.  I don't know of any tool or application that will
auto-generate XForms from the XML Schema.  It would be very difficult if
not impossible to be able to create controls without know what kind to
create, or to create the data and binding without knowing what the data
is or what to bind to.

	In regards to your second question, if by conform you mean being
valid within the constraints of the XML Schema, then with the proper
setup, the XForms processor your using should be able to check for that.

<?xml version="1.0" encoding="ISO-8859-1"?>
<form xmlns:xfm="http://www.w3.org/2002/xforms/cr" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
  <xfm:model schema="#mySchema" xsd:id="InputTest">
    <xfm:submission action="somewhere.do" indent="false" method="post"
    omit-xml-declaration="false" xsd:id="controlsSubmission"/>
    <xfm:instance>
        <example>
          <field>
          An Example String
          </field>
        </example>
    </xfm:instance>
  </xfm:model>
...
  <schema id="mySchema">
    <xsd:element name="example">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="field" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
  </schema>
</form>

In this example, the schema element has an id of "mySchema"  this is
referenced in the model element above by the attribute schema
(schema="#mySchema").  This reference will tell the XForms processor to
check that they data conforms to the XML Schema written.


I hope this helps,

Susan Borgrink

FormFaces Developer
      

-----Original Message-----
From: KHOURY Shérine (Dr&T) [mailto:sherine.khoury@sncf.fr]
Sent: Tuesday, December 09, 2003 3:12 AM
To: 'www-forms@w3.org'
Subject: Critical Questions



Hello guys, 

I'm very new to XForms, and need your help to understand what XForms can
and cannot do: Suppose we need to collect data conformly to an XML
Schema:
1- Is there a way to generate the form for collecting that data
automatically from the XML Schema?
2- I know that the instance data collected in the form is returned to
the server between  <instanceData>...</instanceData>. Is there a way to
get the data in the instanceData element to be conform to the XML schema
without any processing? Or is using some XSLT to do so a must?

Please, if you have any information to give me, I will appreciate it
very much. Thank you Shérine

Received on Tuesday, 9 December 2003 13:53:54 UTC