Hello Xiaofan, This gets a bit esoteric, but hopefully I can explain how default values play with respect to schema validation.
In schema datatypes, there are two fundamental concepts--the lexical space (strings in documents) and the value space (an abstract universe where many aspects of validation are performed, e.g., where most kinds of facet are applied). It is possible for a single value in a value space to have multiple lexical representations; e.g., the lexical values +7 and 7 refer to the same integer. One of these lexical values is identified as the canonical value; e.g., in the above case that's 7. The canonical value plays no part in validation. If a value is admitted in a value space, then all of its lexical representations will be admitted (except in sofaras prohibited by facets like pattern that are applied at the lexical level.) So why do canonical values matter? Because the canonical value is what's used when a value is faulted in. i.e., if an attribute is of type integer, declared to have a value of +7 in the schema, then 7 will be the value that's faulted in for an instance document validated by that schema. Xerces-C should implement all of this correctly. Hope that shines some light on the problem! Cheers, Neil Neil Graham Manager, XML Parser Development IBM Toronto Lab Phone: 905-413-3519, T/L 969-3519 E-mail: [EMAIL PROTECTED] "Xiaofan Zhou" <[EMAIL PROTECTED]> 01/24/2005 07:51 PM Please respond to xerces-c-dev To <xerces-c-dev@xml.apache.org> cc Subject canonical representation Hi, All, I have a question regarding canonical representation handling in xerces-c, specifically, if I define an element of simple type integer in a schema, according to the schema data type specification, the canonical representation for integer is defined by prohibiting certain options from the Lexical representation (§3.3.13.1). Specifically, the preceding optional "+" sign is prohibited and leading zeroes are prohibited, I would expect that if in the instance document, the element value is +1234 or 01234 or +01234, then this would be invalid against the schema definition, it is correct? In short, is canonical representation is enforced when xerces-c does validation? Thanks much. Frank --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]