473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Create simpleType for date format

Hi,

I want to create a simpleType that will constrain an element to be a date of
the form dd/mm/yyyy.

I have this at the moment,

<xs:simpleType name="newDate">
<xs:restriction base="xs:string">
<xs:pattern
value="((0[1-9]|1\d|2[0-9])/([0][1-9]|1[0-2])|30/(0[13-9]|1[0-2])|31/(0[13578]|1[02]))/\d\d\d\d" />
</xs:restriction>
</xs:simpleType>

but that doesn't work for leap years. Is it possible to use the date base
type. Something like:
<xs:simpleType name="newDate">
<xs:restriction base="xs:date">
??? what goes here ???
</xs:restriction>
</xs:simpleType>

Thanks!
Mar 6 '06 #1
2 1423


ZagrebMike wrote:
I want to create a simpleType that will constrain an element to be a date of
the form dd/mm/yyyy.


Consider using the predefined xs:date data type. If you need a different
format when representing dates later you can always transform from
yyyy-mm-dd to your format while using the predefined type in your XML
means any schema aware software will understand values to be of the type
date.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 6 '06 #2
Good thought, but I should have mentioned that this is part of a schema
defining the input in a BizTalk receive pipeline. The format is required to
check that the application generates the date in the correct format.

"Martin Honnen" wrote:


ZagrebMike wrote:
I want to create a simpleType that will constrain an element to be a date of
the form dd/mm/yyyy.


Consider using the predefined xs:date data type. If you need a different
format when representing dates later you can always transform from
yyyy-mm-dd to your format while using the predefined type in your XML
means any schema aware software will understand values to be of the type
date.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Mar 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ian Griffiths | last post by:
I have been given a schema, instances of which I'm required to be able to consume and generate. I'd like to be able to manipulate these instances as DataSets internally in my application. The...
2
by: Josh Armstrong | last post by:
I have a form with 4 text boxes; the data that is entered into them are as follows. Text1= Start Time Text2= End Time Text3= Date Text4= Interval I need the form to populate a table with...
1
by: mahnovetsky | last post by:
Does anybody know of a way to set the format property for a date field in VBA?? I need to set the property to medium so I can display display aussie dates on a graph.. Here is what Im doing: ...
2
by: Alicia | last post by:
Does anyone know why I am getting a "Syntax error in Create Table statement". I am using Microsoft Access SQL View to enter it. Any other problems I may run into? CREATE TABLE weeks (...
5
by: Apple | last post by:
May anyone can teach me how to assign a autonumber, I want to create a number that is starting with year(auto change to year 2006) + autonumber (eg. 2005-0001, 2005-0002)
2
by: aevans1108 | last post by:
Greetings Please give me a push in the right direction if this the wrong place to ask this question. Why is it that I can get the count of facets for an element restriction if the...
0
by: beyonddc.storage | last post by:
Below is my current schema <xs:simpleType name="LongType"> <xs:restriction base="xs:long"> </xs:restriction> </xs:simpleType> <xs:simpleType name="MaxLong"> <xs:restriction base="LongType">...
0
by: DotDidIt | last post by:
Hi Everybody! I developed a Web service with IBM RAD v 6.0.1. After creating the WSDL file i have tried to develop a .Net client. But by using wsdl.exe (1.1.4322) to create a .net c# proxy i...
2
by: Greg McLennan | last post by:
I am writing some Visual basic code that needs to create a M$ Access DB with a table that has a DATE ROW with dd/mm/yyyy in the Format as you would see in the general tab of the table-view. e.g...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.