Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

xml dateTime format pattern violation when using DateTime::Format::XSD

by dlinetsk (Initiate)
on May 27, 2015 at 17:03 UTC ( [id://1128040]=perlquestion: print w/replies, xml ) Need Help??

dlinetsk has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

we are using XML::Compile::WSDL11 to compile our schema, and trying to send a message to a webservice. The Message Header has a dateTime parameter (xs:dateTime) that has a pattern .+T.+Z.

We tried setting this parameter to "2006-10-06T00:23:02Z" but got error error: string `2006-10-06T00:23:02Z' does not match pattern `.+T.+Z'

our XSD for this parameter is:
<xs:simpleType name='DateTimeWithTimezoneInfo'> <xs:annotation> <xs:documentation>Designates a date/time stamp in UTC format. Th +e following formats are accepted: YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DDT +hh:mm:ss.xxxZ Where : - YYYY indicates the year - MM indicates the month - DD indicates the day - T is a fixed character, indicating the time section - hh indicates the hour, zero pre-pended - mm indicates the minute, zero pre-pended - ss indicates the second, zero pre-pended - xxx indicates the millisecond, zero pre-pended - Z is a fixed character, indicating UTC time zone</x +s:documentation> </xs:annotation> <xs:restriction base='xs:dateTime'> <xs:pattern value='.+T.+Z'/> </xs:restriction> </xs:simpleType>

using print $wsdl->explain we get the following example for this parameter
# is a xs:dateTime # Pattern: .+T.+Z dateTimeStamp => "2006-10-06T00:23:02Z"
Any tips? Thank you.

Replies are listed 'Best First'.
Re: xml dateTime format pattern violation when using DateTime::Format::XSD
by Corion (Patriarch) on May 27, 2015 at 17:13 UTC

    The regular expression verifies that your timestamp has no timezone offset at the end (Z) while your timestamp has a timezone offset.

    I don't know if timezone offsets are allowed in the xs:dateTime type, but it seems to me that the XSD you have disallows them, or XML::Compile disallows them.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1128040]
Approved by GotToBTru
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-03-28 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found