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

RE: XQuery & XSLT was RE: Verboseness - XML Syntax for XQuery1.0(XQueryX

  • From: Dylan Walsh <Dylan.Walsh@K...>
  • To: Michael Rys <mrys@m...>, xml-dev@l...,www-xml-query-comments@w...
  • Date: Tue, 19 Jun 2001 17:48:38 +0100

xquery1.0 download
From:	Michael Rys [SMTP:mrys@m...]
Sent:	Tuesday, June 19, 2001 4:28 PM
>I don't think that the template body format is appropriate for the user
>communities that are most likely to use XQuery.

How does this community differ from the XSLT one? I am an XSLT user and
likely to be an XQuery user when viable implementations become
available. They are both likely to be important parts of the XML
programmers toolkit.

>Most of my XQuery constituency is not really interested in learning
XSLT
>syntax but prefers the XQuery syntax.

This constituency must at this stage consist, in large part, of the
working group. As I've said, I'm not proposing the wholesale adoption of
XSLT, just consistency where they overlap. This may imply changes to
XSLT for 2.0, because as I've mentioned in the past, XQuery does include
some useful improvements which would benefit XSLT.

>Is this really a problem? I find human readability and writeability to
>be more important goals. Having XML-based constructor functions for
>elements and attributes breaks readability and writeability more than
>the current constructors.

If you know how to write XML, the XML-based constructor format is
relatively intuitive. In this case, writing badly formed XML-a-like
syntax (e.g. unquoted attribute value templates) is counter-intuitive.
If you do not know how to write XML, then you are going to have to learn
it in order to create the results part of the query.

Regarding "a concise, easy to read and write declarative language.", I'm
not proposing anything overly fine grained.

For example:
	(This is a rough sample - I'm not familiar with the ins & out of
XQuery grammar)

<q:query xmlns:q="http://www.w3.org/2001/06/xquery">
	<q:for>$p IN distinct(document("bib.xml")//publisher)</q:for>
	<q:let>$a := avg(document("bib.xml")//book[publisher =
$p]/price)</q:let>
	<q:return>
		<publisher>
			<name><q:value-of select="$p/text()" /></name>
			<avgprice><q:value-of select="$a" /></avgprice>
		</publisher>
	</q:return>
</q:query>

...instead of:

	FOR $p IN distinct(document("bib.xml")//publisher)
	LET $a := avg(document("bib.xml")//book[publisher = $p]/price)
	RETURN
		<publisher>
			<name>{ $p/text() }</name>
			<avgprice>{ $a }</avgprice>
		</publisher>

That does not constiture an explosion in the complexity.


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.