Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML Schema problem

Reply
Thread Tools

XML Schema problem

 
 
sk
Guest
Posts: n/a
 
      06-07-2006
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>


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      06-07-2006


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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
web.xml / XML schema issue, why do some XML schema attributes disappear asciz@starmail.com Java 3 02-20-2007 09:56 AM
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema huntingseasonson@gmail.com Perl Misc 5 11-29-2006 12:37 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
XML Schema to XML Schema Conversion Hari Om XML 1 03-02-2004 09:04 PM
XML schema regular expressions question and recommended XML Schema book Fred Smith XML 1 02-05-2004 11:12 AM



Advertisments