OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] XQuery and DTD/Schema?

[ Lists Home | Date Index | Thread Index ]

Uche Ogbuji wrote:
> [Jonathan Robie]
> > Let me try to explain why I think named typing is good. Here's a function:
> > define function get-total( element invoice $i )
> >    returns xs:decimal
> > {
> >          sum( $i//item/price )
> > }
> > [...] At run-time, you don't want to
> > have to test every function parameter to see if it corresponds to a schema,
> > you simply want to ensure that the validator has said this corresponds to
> > the appropriate definition.
> You keep saying this sort of thing, and it baffles me.  Its a solution in
> search of a problem if I ever saw one.  If the substrate data is *XML* (this
> is what we're here to discuss, right?) then why do these declaration have to
> be
> a) static
> b) based on a named type system
> c) a and/or b only as provided within a schema
> a) There is no reason it has to be static.  The semantics of sum can be
> "accept or convert to an integer".  This is how XPath 1.0 does things.  And
> I'll make the technical point that you know very well Simon has made enough
> times: this is the way to do it that is more cleanly layered for XML
> processing.  I know you'll respond "but that's inefficient".

I'd even question how relevant the efficiency issue is.

XQuery is designed, principally, to do database queries.
In this context, it doesn't matter if you can take advantage
of type information to add two xs:integers in nanoseconds
instead of microseconds, when it takes milliseconds to retrieve
the data in the first place.

--Joe English



News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS