W3C home > Mailing lists > Public > www-forms@w3.org > January 2001

A question about an example at http://www.w3.org/TR/xforms/model.html 6.3.6

From: Simon <chi@intumit.com>
Date: Sat, 27 Jan 2001 15:31:43 +0800
Message-ID: <001b01c08833$32bc6150$d11c0d3d@SIMON>
To: <www-forms@w3.org>
There is an example in the page http://www.w3.org/TR/xforms/model.html 6.3.6, like below
Example Simple Syntax:

<xfm:switch name="address">
  <xfm:case name="us" condition="property::locale is 'US'" >
    <xfm:string name="street"/>
    <xfm:string name="city"/>
    <xfm:string name="state"/>
    <xfm:string name="zip"/>
  </xfm:case>
  <xfm:case name="uk" condition="property::locale is 'UK'" >
    <xfm:string name="street"/>
    <xfm:string name="town"/>
    <xfm:string name="county"/>
    <xfm:string name="postcode"/>
  </xfm:case>
  <xfm:case name="default">
    <xfm:string name="street"/>
    <xfm:string name="town"/>
    <xfm:string name="county"/>
    <xfm:string name="postcode"/>
  </xfm:case>
</xfm:switch>

       

Example Equivalent Schema Syntax:

<xsd:element name="address">
  <xsd:complexType>
    <xsd:choice>
      <xsd:sequence">
        <xsd:element name="street"   type="xfm:string"/>
        <xsd:element name="city"     type="xfm:string"/>
        <xsd:element name="state"    type="xfm:string"/>
        <xsd:element name="zip"      type="xfm:string"/>
      </xsd:sequence>
      <xsd:sequence>
        <xsd:element name="street"   type="xfm:string"/>
        <xsd:element name="town"     type="xfm:string"/>
        <xsd:element name="county"   type="xfm:string"/>
        <xsd:element name="postcode" type="xfm:string"/>
      </xsd:sequence>
      <xsd:sequence>
        <xsd:element name="street"   type="xfm:string"/>
        <xsd:element name="town"     type="xfm:string"/>
        <xsd:element name="county"   type="xfm:string"/>
        <xsd:element name="postcode" type="xfm:string"/>
      </xsd:sequence>
    </xsd:choice>
  </xsd:complexType>
</xsd:element>

       


I think maybe the Schema Syntax is wrong. Due to the XSLT in Appendix B, it should be

<xsd:element name="address">
  <xsd:complexType>
    <xsd:choice>
      <xsd:sequence xfm:name="us" xfm:condition="property::locale is 'US'" >
        <xsd:element name="street"   type="xfm:string"/>
        <xsd:element name="city"     type="xfm:string"/>
        <xsd:element name="state"    type="xfm:string"/>
        <xsd:element name="zip"      type="xfm:string"/>
      </xsd:sequence>
      <xsd:sequence xfm:name="uk" xfm:condition="property::locale is 'UK'" >
        <xsd:element name="street"   type="xfm:string"/>
        <xsd:element name="town"     type="xfm:string"/>
        <xsd:element name="county"   type="xfm:string"/>
        <xsd:element name="postcode" type="xfm:string"/>
      </xsd:sequence>
      <xsd:sequence xfm:name="default" >
        <xsd:element name="street"   type="xfm:string"/>
        <xsd:element name="town"     type="xfm:string"/>
        <xsd:element name="county"   type="xfm:string"/>
        <xsd:element name="postcode" type="xfm:string"/>
      </xsd:sequence>
    </xsd:choice>
  </xsd:complexType>
</xsd:element>

       

But I'm not sure, could anybody teach me?

 - Chi-Yang Chang
Received on Saturday, 27 January 2001 02:32:18 GMT

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