|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Regular Expression Syntax for Date format yyyy-mm-dd |
« View previous topic :: View next topic » |
Author |
Message
|
javaforvivek |
Posted: Tue Jun 14, 2005 11:01 pm Post subject: Regular Expression Syntax for Date format yyyy-mm-dd |
|
|
 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 |
|
 |
kimbert |
Posted: Wed Jun 15, 2005 1:49 am Post subject: |
|
|
 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 |
|
 |
javaforvivek |
Posted: Wed Jun 15, 2005 2:45 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|