xml - cvc-pattern-valid: Value 'A' is not facet-valid with respect to pattern '^[A-Za-z]?$' for type 'whatever' -


here's particular xml tag validation failing:

<middlename>a</middlename> 

the xsd tag:

<xsd:element name="middlename" type="middleinitial" />  <xsd:simpletype name="middleinitial">     <xsd:restriction base="xsd:string">         <xsd:pattern value="^[a-za-z]?$" />     </xsd:restriction> </xsd:simpletype> 

the error i'm getting:

cvc-pattern-valid: value 'a' not facet-valid respect pattern '^[a-za-z]?$' type 'middleinitial'. 

the validator i'm using:

http://tools.decisionsoft.com/schemavalidate/

the regular expression looks good. ^ matches start, $, end, ? 0 or 1 times letters a-z or a-z.

any ideas?

from w3 spec regular expressions (appendix d):

...expressions matched against entire lexical representations rather user-scoped lexical representations such line , paragraph. reason, expression language not contain metacharacters ^ , $, although ^ used express exception, e.g. [^0-9]x

i.e. take out ^ , $.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -