XML Schema problem

S

sk

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>
 
M

Martin Honnen

sk said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top