Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Comparison of values of anySimpleType [Thread Next] "Re: Comparison of values of anySimpleType"To: <xmlschema-dev@--.---> Date: 10/28/2004 1:46:00 PM Hi, after updating to Xerces-J 2.6.2, I realized that Xerces does follow XSV and MSXML, regarding the comparison of 'anySimpleType' with other simple types. Even if IDC fields resolved to attributes with no type information, i.e. if the attributes were processed by 'skip' wildcards, or 'lax' wildcards with no declarations, Xerces seemed to assume the 'anySimpleType' for the values of those attributes and compared the values the with other values of atomic simple type. Xerces does not work this way anymore; and I now seem to realize why: The simple type definition for 'anySimpleType' states that the type has a variety of _absent_, so even the following dictum for comparison does not apply, since it wants the ancestor type to be _atomic_. "if a datatype T' is =B7derived=B7 by =B7restriction=B7 from an atomic datat= ype T then the =B7value space=B7 of T' is a subset of the =B7value space=B7 of T. Values in the =B7value space=B7s of T and T' can be compared according to the above rules " This makes comparison a lot easier :-) Regards, Kasimier Kasimier Buchcik wrote: > Hi, > > I have trouble understanding how 'anySimpleType' is handled if comparing > values. Xerces and XSV seem to differ here. > > Identity-constraint example: > (using Xerces-J 2.5.1, XSV 2.5-2, MSXML 4.0) > > <sequence> > <element name="b" type="anySimpleType"/> > <element name="c" type="float"/> > </sequence> > > <b>1.0</b> > <c>1.0</c> > > with the value of 'c' being a keyref to the key value of 'b'. > > Results: XSV and MSXML do not find the referenced key, Xerces does. > > if both types are 'float': > > Results: All tree validators find the referenced key. > > I cannot find a hint for 'anySimpleType' being not comparable with the > primitive types. The PER for datatypes says: > > "anySimpleType is considered to have an unconstrained lexical space and > a =B7value space=B7 consisting of the union of the =B7value space=B7s of a= ll the > =B7primitive=B7 datatypes and the set of all lists of all members of the > =B7value space=B7s of all the =B7primitive=B7 datatypes." > > Further "4.2.1 equal" says: > > "if a datatype T' is =B7derived=B7 by =B7restriction=B7 from an atomic dat= atype > T then the =B7value space=B7 of T' is a subset of the =B7value space=B7 of= T. > Values in the =B7value space=B7s of T and T' can be compared according to > the above rules " > > Can someone explain? > > Greetings, > > Kasimier > From Simon.Cox@c... Thu Oct 28 11:12:52 2004 Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
