[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XQuery and DTD/Schema?
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 jenglish@f...
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|