Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   XML Schema problem (http://www.velocityreviews.com/forums/t297659-xml-schema-problem.html)

sk 06-07-2006 07:57 AM

XML Schema problem
 
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>



Martin Honnen 06-07-2006 12:05 PM

Re: XML Schema problem
 


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/


All times are GMT. The time now is 09:34 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.