It's not a secret anymore!
The moose likes XML and Related Technologies and the fly likes XSD - restrctions/enumeration - Only Weekdays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSD - restrctions/enumeration - Only Weekdays" Watch "XSD - restrctions/enumeration - Only Weekdays" New topic
Author

XSD - restrctions/enumeration - Only Weekdays

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1396
How to restrict the week days(MON thru FRI) only using xsd:restriction and xsd:enumeration ? xs:pattterns needed?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10441
    
176

Look at this w3schools example.


[My Blog] [JavaRanch Journal]
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1396
Hi Jaikiran, I already googled this link.
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19728
    
  10

And did it answer your question?
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1396
<xs:element name="Weekdays">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Monday"/>
<xs:enumeration value="Tuesday"/>
<xs:enumeration value="Wednesday"/>
<xs:enumeration value="Thursday"/>
<xs:enumeration value="Friday"/>
</xs:restriction>
</xs:simpleType>
</xs:element>

Is it correct?
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19728
    
  10

kri shan wrote:Is it correct?

You mean, does it match your requirements? Only you can say. Let us know when you try it out on your data.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XSD - restrctions/enumeration - Only Weekdays
 
It's not a secret anymore!