ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Regular Expression Syntax for Date format yyyy-mm-dd

Post new topic  Reply to topic
 Regular Expression Syntax for Date format yyyy-mm-dd « View previous topic :: View next topic » 
Author Message
javaforvivek
PostPosted: Tue Jun 14, 2005 11:01 pm    Post subject: Regular Expression Syntax for Date format yyyy-mm-dd Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

Hi,
I have an input message like this:
<Transaction>
<Date>2005-05-17</Date>
<Amount>200.80</Amount>
</Transaction>
The specific requirement is that, the message should be validated on MQInput Node. So I have set domain as MRM and Validation is 'Content and Value' - 'Complete'.
I have created my msg def as follows:
'Type' section has:
Simple Type = TransDate (xsd:Date)
Simple Type = TransAmount (xsd:Decimal)
Complex Type - Transaction which contents
Local Element = Date (type : TransDate)
Local Element = Amount (type : TransAmount)
'Message' section has:
Transaction (type: Transaction)

Now I want to be absolutely sure that the date from input message is valid date, i.e, format should be yyyy-mm-dd and value should be a valid Date (ie, it should NOT be something like 2005-05-32).

In the Logical Properties of SimpleType TransDate, there is a section of Value Constraints, what should be my settings? More importantly, what should be my regular expression in the Patterns section?
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
kimbert
PostPosted: Wed Jun 15, 2005 1:49 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
n the Logical Properties of SimpleType TransDate, there is a section of Value Constraints, what should be my settings? More importantly, what should be my regular expression in the Patterns section?

You cannot apply a pattern to a value which is based on xsd:date. In WB-IMB (unlike schema) you are only allowed patterns on strings.
Back to top
View user's profile Send private message
javaforvivek
PostPosted: Wed Jun 15, 2005 2:45 am    Post subject: Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

Sorry, my mistake. My TransDate is of type xsd:string.
I have given following expression:
Code:
[1-9][0-9][0-9][0-9][-](([0][1|3|5|7|8])[-]([0][1-9]|[1-2][0-9]|[3][0-1])|([0][4|6|9])[-] ([0][1-9]|[1-2][0-9]|[3][0])|([0][2])[-]([0][1-9]|[1-2][0-9])|([1][0|2])[-]([0][1-9]|[1-2][0-9]|[3][0-1])|([1] [1])[-]([0][1-9]|[1-2][0-9]|[3][0]))

But it doesn't work.
Any ideas? I think that the hyphen(-) mark is posing some problem here.
Can anybody guide me?
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Regular Expression Syntax for Date format yyyy-mm-dd
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.