[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XPath 2.0 - how much of XQuery should it include?


xpath lisp
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/


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.