W3C home > Mailing lists > Public > www-forms@w3.org > February 2007

Question about optional element in instance

From: <m9467470@nirai.ne.jp>
Date: Sat, 17 Feb 2007 20:29:07 +0900
To: www-forms@w3.org <www-forms@w3.org>
Message-Id: <20070217202907.cef1a1e4.m9467470@nirai.ne.jp>

How can I code the Instance including "optional" element?
ie. the instance is like this.

<xforms:instance id="register">
  <client>
    <id/>
    <name>
      <first/>
      <last/>
    <sex/>
    <data/>
  </client>
</xforms:instance>

And the "name" and "sex" elements are optional.
The instance data will send to third party server,
then must pass with the following XML Schema.

<xsd:complexType name="client">
  <xsd:sequence>
    <xsd:element name="id">...</xsd:element>
    <xsd:element name="name" minOccurs="0">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="first">...</xsd:element>
          <xsd:element name="last">...</xsd:element>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
    <xsd:element name="sex" minOccurs="0">...</xsd:element>
    <xsd:element name="date">...</xsd:element>
  </xsd:sequence>
</xsd:complexType>

--
Miyagi
 <m9467470@nirai.ne.jp>
Received on Sunday, 18 February 2007 14:55:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:09 GMT