Stanimir Stamenkov <[EMAIL PROTECTED]> wrote on 01/04/2006 10:26:07 AM:
> > Seems it is the combination of the pattern facet and the default value. > > FWIW, the same thing but using 'string' base doesn't cause problem: I've looked into the issue, and I don't believe this is a bug; this behaviour is required by the schema spec. Looking at the Element Declaration Properties Correct section of the Schema Spec [1], point 2 states that the "canonical lexical representation" of the default value must match the pattern, not just the supplied lexical representation. The canonical lexical representation of the xs:decimal type requires the decimal point and at least one digit after the decimal point [2]. In the given example, the canonical lexical representation of "0" is "0.0", which of course does not match the required pattern for MyInteger in the schema, and thus the schema is invalid. My suggestion would be to change the base type to xs:integer or xs:string. If you're stuck using xs:decimal, you need to change your pattern to allow "integers" with a zero after the decimal point, i.e. "[\-+]?[0-9]+(\.0)?" [1] http://www.w3.org/TR/xmlschema-1/#e-props-correct [2] http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#decimal -- Peter McCracken XML Parser Development IBM Toronto Lab Phone: 905-413-5201 T/L 969-5201 Email: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
