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 2.0 - how much of XQuery should it include?

[ Lists Home | Date Index | Thread Index ]

Hi Bill,

> You want this (in scheme):
>
> (define (map func seq)
>  (if(null? seq) 
>    nil
>    (cons (func (car seq)) (map func (cdr seq)))))
>
> (I though XSLT had this. (Oops, it doesn't.))

Yes, that's what I want. No, XSLT doesn't have it.

>> Yeah, innit great. But as far as I know, Lisp is a language 
>> in its own right. 
>
> <irked>
> Yes it is great; you'd do well to take a look at it. It subsumes
> XML, Xpath and XSLT, and in a saner industry, it should have been
> the language you're using for your job; people have been using Lisp
> for the kind of work XSLT+XPATH makes a pita for a long time. Still,
> them's the breaks. On the other hand pretty much everything you want
> to do can be found in CLisp functions, as Jeff is pointing out, so
> you can spec much of your requirements from it.
> </irked>

Actually I did study Lisp as part of my AI studies (though a while ago
now), so I do understand how elegant it is. I wasn't making a dig at
Lisp at all, and I'm sorry if it came across that way and made you
feel irked. I was trying to make the point that XPath isn't used in
the same way as Lisp, because it works inside another language, so it
shouldn't have all of the same functionality as Lisp. On the other
hand, XSLT+XPath *should* have the same functionality as Lisp
(eventually including the nice functional programming features such as
being able to pass round a function as an argument to another
function).

Whether or not we should be using XSLT and XPath to do transformations
is a completely different argument, and one I feel a lot less strongly
about. What I do feel strongly is that given we're using XPath in
XSLT, XPath should be a small expression language rather than a whole
language in its own right.

>> I can see that, and that's why in many ways XQuery is the more
>> elegant language -- it has a beautiful unified syntax because it's
>> taken the step away from XML-based syntax.
>> 
>> XSLT doesn't have that luxury. When we add statements to XPath,
>> instead of getting a nice unified language, we get a mess where we
>> have two ways of doing the same things, one in XPath and one in
>> XSLT.
>
> "It's better to have 100 functions operate on 1 data structure than
> to have 10 functions operate on 10 data structures"- Alan Perlis.

I'm arguing that it's better to have 10 functions operating on 1 data
structure than to have 20 functions operating on 1 data structure.
Indeed, I'm arguing that the data structure handled by XSLT should be
unified with the data structure handled by XPath -- they should both
be handling sequences rather than having XSLT handle nodes and XPath
handle atomic values, so actually I'm arguing that it's better to have
10 functions operating on 1 data structure than to have 20 functions
operating on 2 data structures.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/





 

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

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