File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 1372
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: 9963
    
163

Look at this w3schools example.


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

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

Joined: Oct 14, 2005
Posts: 18541
    
    8

And did it answer your question?
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1372
<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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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.
 
Don't get me started about those stupid light bulbs.
 
subject: XSD - restrctions/enumeration - Only Weekdays
 
Similar Threads
What exactly is a data-tier
EL vs. JSP implicit objects
BBC to show World Cup LIVE online
88% on Part II/III (SCEA Beta)
retakes part 1,2,3