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] XPath 1.5? (was RE: [xml-dev] typing and markup)

[ Lists Home | Date Index | Thread Index ]

At 12:35 PM 5/7/2002 -0400, Simon St.Laurent wrote:
> > Please, can we see some queries that cause problems, or things that are
> > hard to say or do in XQuery?
>
>No.  I'm not looking for additional features - I'm looking for fewer
>features.  This isn't a question of particular queries needing
>additional features.

Then could you take some examples out of our specification or use case 
document and argue that people really don't need to do these things, and it 
is a mistake to define a language with this power?

You say you don't like types. Suppose that the user has a document that 
validates according to some schema. In that document, salary is a decimal:

         <person>
                 <name>Jonathan Robie</name>
                 <salary> 3.14 </salary>
         </person>

         <person>
                 <name>Uche Ogbuji</name>
                 <salary>  2341235.34 </salary>
         <person>

The schema tells me that name is a string and salary is a decimal. The user 
created data using this schema, and the user knows full well that salary is 
a number and name is not.

I would like the following query to succeed:

         avg( input()//person/salary )

I would also like indexes to be able to make such queries fast, to enable 
appropriate sorting based on an index. I would like the following to be 
efficient:

         //person sortby (salary)

That means that I want persistent systems to use the type information for 
indexing.

I would like the following query to fail:

         avg( input()//person/name )

I would like it to fail without forcing me to execute the query. That's 
what we call static typing. This query is simply wrong, and a query 
processor can know that.

So far, when we have said things like this, you have responded with 
position statements - XML is a representation, and is not about philosophy. 
Don't you think that users have notions of types, and that users believe 
that salaries can be averaged but names can not? Why is it wrong for XML 
processing to act in accordance with what most users will expect?

Jonathan





 

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

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