XML Schema problem

Discussion in 'XML' started by sk, Jun 7, 2006.

  1. sk

    sk Guest

    I have a question about the xml schema.

    If I assigned the restriction to a element like the following
    you have to choose from among three countries.

    Can I change this schema so that I can select from one of three countries
    or I put what every I want.

    I use "any" somewhere?

    <xs:element name="CountryName" >
    <xs:simpleType>
    <xs:restriction base="xs:string" >
    <xs:maxLength value="50" />
    <xs:enumeration value="France" />
    <xs:enumeration value="Mexico" />
    <xs:enumeration value="China" />
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
     
    sk, Jun 7, 2006
    #1
    1. Advertising

  2. sk wrote:

    > If I assigned the restriction to a element like the following
    > you have to choose from among three countries.
    >
    > Can I change this schema so that I can select from one of three countries
    > or I put what every I want.
    >
    > I use "any" somewhere?
    >
    > <xs:element name="CountryName" >
    > <xs:simpleType>
    > <xs:restriction base="xs:string" >
    > <xs:maxLength value="50" />
    > <xs:enumeration value="France" />
    > <xs:enumeration value="Mexico" />
    > <xs:enumeration value="China" />
    > </xs:restriction>
    > </xs:simpleType>
    > </xs:element>


    For simple types you can build a union of types. On the other hand I am
    not sure why you would want to enumerate certain values but then allow
    all possible values.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jun 7, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,546
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    949
    Martin Honnen
    Feb 5, 2004
  3. Hari Om
    Replies:
    1
    Views:
    463
    Martin SChukrazy
    Mar 2, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,267
    Stanimir Stamenkov
    Apr 25, 2005
  5. Replies:
    3
    Views:
    2,874
Loading...

Share This Page