- From: Michael Rys <mrys@microsoft.com>
- Date: Thu, 5 Jun 2003 12:41:03 -0700
- To: "John Cowan" <jcowan@reutershealth.com>, "Jeni Tennison" <jeni@jenitennison.com>
- Cc: "Norman Walsh" <Norman.Walsh@Sun.COM>, "Jonathan Robie" <jonathan.robie@datadirect-technologies.com>, "Mike Champion" <mc@xegesis.org>, <public-qt-comments@w3.org>
Jeni already brought most of the reasons why I don't think your model would work and actually provide a type safe system that would make the XPath data model independent of the validation process. Jonathan already presented you with a way to get most of what you want using the current framework. Let me address some technical issues below and potentially in some other mails (I have not read all of them yet) that you may have missed. Best regards Michael > -----Original Message----- > From: public-qt-comments-request@w3.org [mailto:public-qt-comments- > request@w3.org] On Behalf Of John Cowan > Sent: Thursday, June 05, 2003 9:53 AM > To: Jeni Tennison > Cc: Norman Walsh; Jonathan Robie; Mike Champion; public-qt-comments@w3.org > Subject: Re: XPath Data Model proposal > > > Jeni Tennison scripsit: > > > Just to fill in the gaps here, presumably you're only suggesting that > > an XPath 2.0 processor be able to do anything with xsi:type attributes > > holding the names of types that it recognises, and that other type > > annotations should be ignored? > > In effect, I think that is achieved by the penultimate paragraph in > 3.6, which says that unknown types are to be promoted to xs:anyType or > xs:anySimpleType, as the case may be. [Michael Rys] Promoting unknown types to xs:anyType and xs:anySimpleType does not work if you want to be able to have different semantics for typed data (strong typing) and untyped data (weak typing) and want to make a distinction between the most specific type being untyped and the most specific statically given type being the most general type. xs:anyType/xs:anySimpleTypes are very general types that serve as the base types of the type hierarchy. Saying that untyped data becomes the most general type is not the right approach (although if you just do dynamic typing you may get away with it). You need to distinguish between something that you know to be untyped and something that you do not quite now what type it is during type inference (mostly if you perform static type analysis and static typing). Since XML Schema unfortunately mixes these two concepts (xs:anyType in the schema definition language indicates the most general type, and on the PSVI instance annotation the untyped case), XQuery/XPath needed to split them. And since it is easier to change the type given in the data model than the type name used in the schema definition language, XQuery introduced xdt:untypedAtomic (and will also need a companion for untyped Complex/Any types). Thus, any XPath/XQuery type system that is using XML Schema based type names should NOT use xs:anySimpleType/xs:anyType to denote untyped data. [Note: there would be a slightly more complex alternative, using the notion of the most strict type that then would have the notion of "strict xs:anySimpleType" being the same as xdt:untypedAtomic] > > Also, I assume that you're suggesting that the XPath 2.0 processor > > validate the content of the annotated element, such that, for example > > <foo xsi:type="xs:integer">rubbish</foo> isn't labelled as being of > > type xs:integer. Or are you suggesting that elements be labelled with > > types without necessarily being valid against those types? > > Hmm, that's a point I hadn't considered. It's formally messy, because > there is no formal definition of type validity in the DM -- it can > delegate to the XML Schema documentation for that. OTOH, asking an XPath > processor to cope with examples like that is more than a bit awkward. > > > (The same answers will apply to xdt:attributeTypes, I imagine.) > > Indeed. [Michael Rys] And this is one of the main reasons why the current system of requiring some form of validation equivalent before populating the data model is important. That the PSVI and data model is preserving xsi:nil/xsi:type as attributes in addition to adding information about their values to the element/attribute nodes is already bad enough. But having to recognize them even if you do not provide a validation step before is bad. And requiring the data model now to perform its own validation flies into the face of composable specs that so many people want from the W3C. Best regards Michael > -- > John Cowan jcowan@reutershealth.com www.reutershealth.com > www.ccil.org/~cowan > I am he that buries his friends alive and drowns them and draws them > alive again from the water. I came from the end of a bag, but no bag > went over me. I am the friend of bears and the guest of eagles. I am > Ringwinner and Luckwearer; and I am Barrel-rider. --Bilbo to Smaug >
Received on Thursday, 5 June 2003 15:41:30 UTC