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

RE: XQuery Updates in XSLT

Subject: RE: XQuery Updates in XSLT
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 30 Oct 2008 12:21:25 -0000
RE:  XQuery Updates in XSLT
> No, not at all. XQuery Update is 100% functional in the 
> strict computer science sense of the work. It returns two 
> types of values, an XDM and a list of updates that need to be 
> applied (called a pending update list, PUL). All actual 
> updates happen after the finish of the query, meaning that 
> the query still behaves functionally.

A problem with that definition is that the things in the Pending Update List
are not values that can be manipulated by functions within the language;
indeed, an updating operation is not a function, because it cannot be
composed with other functions, because the results are not accessible until
the end. I think that function composition is an essential ingredient of a
functional language.

If you confine yourself to the copy-modify expression (called a "transform"
expression for historic reasons), which creates a copy and then returns the
result of updating the copy, then you do have something which is
functionally well-behaved, and which indeed allows certain kinds of changes
to a document to be expressed using syntax which is fairly succinct and
intuitive. 

(I don't accept Dimitre's criticisms about the complexity of the
specification; specifying the exact behaviour of "rename a as b" in terms of
the namespaces that are present in the result document is always going to
involve a horrendous amount of specification text to cover all corner cases,
but most users will never need to care.)

As for allowing updates in saxon:query(), I may well do so, with the
semantics of the "copy-modify" expression - you get back a modified copy of
the original, with the original unchanged. That seems cleanly functional to
me. Anything else (in-situ modification) would break the XSLT execution
model entirely. 

Michael Kay
http://www.saxonica.com/

Current Thread

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
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.