Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Date validating regexp in pattern facet yields invalid results?

From: "Biron,Paul V" <Paul.V.Biron@--.--->
To: "'jsijpkes@-------.--'" <--------@-------.-->, xmlschema-dev@--.---
Date: 7/14/2004 6:09:00 AM
> -----Original Message-----
> From: Johann Sijpkes [mailto:jsijpkes@t...] 
> Sent: Wednesday, July 14, 2004 12:56 PM
> To: xmlschema-dev@w...
> Subject: Date validating regexp in pattern facet yields 
> invalid results?
> 
> This is the code:
> 
> <xsd:simpleType name="date_type" >
> <xsd:restriction base="xsd:string">
> <xsd:minLength value="8" />
> <xsd:maxLength value="8" />
> <xsd:pattern value="^\d{2,2}/\d{2,2}/\d{2,2}$" /> <!-- This 
> regexp works, the next does not -->
> 
> <xsd:pattern value= 
> "^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/(\d{2}))|((0[1-9]
> |[12]\d|30)\/(
> 0[13456789]|1[012])\/(\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/(\d{2}
> ))|(29\/02\/((
> 0[48]|[2468][048]|[13579][26])|(00))))$" />
> </xsd:restriction>
> </xsd:simpleType>

Are you sure the shorter one works...because I tried in xerces 2.6 and it didn't work either...and I wouldn't expect it to work.

If you just take out the ^$ anchors in either expression then they work just fine (at least in xerces 2.6.2...the only processor I've checked them against).

For the explanation of why the ^$ anchors are the problem, see errata E2-52 [1], which is also incorpated into the main text of Appendix F in the Proposed 2nd Edition of schema [2].

pvb

[1] http://www.w3.org/2001/05/xmlschema-errata#E2-52
[2] http://www.w3.org/TR/2004/PER-xmlschema-2-20040318/#regexs


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent