aspose 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


Win a copy of Spring in Action this week in the Spring forum!
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: 1378
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: 10202
    
166

Look at this w3schools example.


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

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

Joined: Oct 14, 2005
Posts: 18656
    
    8

And did it answer your question?
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1378
<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: 18656
    
    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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XSD - restrctions/enumeration - Only Weekdays