364,112 Members | 2345 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

XSD explaination

talk2jyotish
P: 3
Following is a piece of XSD code

<xsd:simpleType name="TimestampType">
<xsd:annotation>
<xsd:documentation>Base type for a date and time stamp</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:dateTime">
<xsd:pattern value="[1-9][0-9]{3}\-.+T[^\.]+(Z|[\+\-].+)"/>
</xsd:restriction>
</xsd:simpleType>



can anyone give a value which satisfies the above xsd or plz explain it???
Mar 10 '08 #1
Share this Question
Share on Google+
2 Replies


jkmyoung
Expert Mod 100+
P: 1,823
xs:DateTime

2006-02-15T17:00:00-03:00

The first part is selecting the year:
[1-9][0-9]{3}

Then you have the hyphen
-

Then as many characters as you want until T. Note that since this is a date time, you need it to be in the format MM-DD
where MM is the month and DD is the day.

Next is the T:
T

[^\.]+ match any except periods.

And an optional timezone component, preceded by Z. My example does not have this.

http://www.w3.org/TR/xmlschema-2/#dateTime
Mar 10 '08 #2

talk2jyotish
P: 3
Thanks a lot for the reply.

It really worked
Mar 11 '08 #3

Post your reply

Help answer this question



Didn't find the answer to your XML question?

You can also browse similar questions: XML