Subject: Re: [xsl] James Clark on Schema From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 5 Jun 2002 22:00:40 +0100 |
> * It is unreasonable to expect a W3C specification (such as XQuery) to > adopt as its basis a data model not under control of the W3C, when there is > a W3C data model that is acceptable. > ... > To hope that the various Working Groups will "see > the light" and choose to use a schema-like facility defined outside the W3C > is highly unlikely. I have never argued that XPath2 should be based on Relax NG, what I have argued is that it shouldn't be based so closely on W3C Schema. In particular, concentrating for now on the simple types rather than complex types (element structure) it should not have accumulated the mass of numeric, date and string types. They make no sense to be hardwired into a query language aimed at generic XML documents. No fixed set of random types will ever be of any real use in an XML context as most of the documents are generated for reasons unconnected with XQuery/XPath. An XML Query language has to be able to cope with whatever's out there it can't just invent a world view and pretend that all documents will conform. Having a float and an integer type (already an extension to XPath 1) makes sense; having byte and friends is just slavish devotion to the schema spec. Dropping them does not mean abandoning W3C and following James into the uncharted waters of ISO. It just means making XPath usable again. A small section of a revised XPath2 document mapping the primitive W3C schema types into XPath would be all that's required. If you want an integer less than 0 and 2^8 you should be able to express that in the same way as an integer between 0 and 12, why have a special "byte type". At first sight it doesn't appear too bad, as if you don't need it don't use it and if you do need it it might save a keystroke or two, but the net effect of having dozens of pointless primitive types in the language is that the language has an exponential explosion in the complexity of its casting rules and functions, and is impossible to learn: I challenge anyone to list the full set of primitive XPath2 types off the top of their head, without reference to the spec (F&O or schema). Support for complex types also massively complicates the specification for little to no benefit. If you want to find all children elements that have a parent parent, it is far more natural to use XPath parent/child I see no occasions when it would be more natural (In an Xpath context) to define a schema type for that construct and and then query on the type. This comment is not particularly against W3C Schema it is a comment on Schema in general with respect to XPath. (Schema are fine for their main use of constraining authoring and checking that a document is correctly authored. But querying is something different) A schema type is basically just a named content model in a DTD (if you view DTDs as a schema language with non-XML syntax) As far as I can tell no one ever asked in an XPath or XSLT context to be able to query by a particular content model without having to specify the element name When is this supposed to be useful? (None of the XQuery use cases show any use for this facility) David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] James Clark on Schema, Jim Melton | Thread | RE: [xsl] James Clark on Schema, bryan |
Re: [xsl] Repeating a string, Steve Ball | Date | Re: [xsl] new to XML/XSL - having p, Joerg Heinicke |
Month |