[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 XQuery 1.0(XQuery

  • From: Jonathan Robie <Jonathan.Robie@S...>
  • To: Murali Mani <mani@C...>
  • Date: Wed, 20 Jun 2001 07:04:42 -0400

translating xquery into xqueryx
At 10:57 AM 6/19/2001 -0700, Murali Mani wrote:

>a) semantics is more important than syntax, but probably they are also
>linked together -- i think we need to think more about the semantics -- do
>we need duplicate nodes returned from a path expression in XQuery?? --
>this has been my *biggest* concern for almost a year now...

This is an important concern. I think you need to be able to do both. 
Consider the following path expression:

  foo/(*[@baz] UNION bing)

I think that duplicates should be eliminated in UNION, INTERSECT, and 
EXCEPT. What if you don't want that? You can use FLWR, which allows 
iterations over sequences:

FOR $i IN foo/*[@baz]
RETURN $i,
FOR $j IN foo/@bing
RETURN $j

So you can get either result.

>b) The data model appears still quite incomplete to me -- do you want to
>use IDREFS to represent ordered list of elements?? --

In general, elements do not have IDs, so this would not work. We use node 
identity, which is an inherent property of the nodes. In an object oriented 
system, you can think of this as the physical address of the node, or you 
can pretend that the system automatically numbers the nodes when it parses 
the document. There are many ways to implement node identity.

>is document order
>the only order in which you want to use???

No, of course not.

>for example, consider types --
>Book, Person, with an IDREFS attribute for Books referring to Person
>representing the list of Authors in one xml document -- so is there a way
>of getting the list of Authors as such without using some additional
>attribute for representing order (as we have to do in the relational
>model)?? -- I think use of IDREFS for representing ordered binary
>relationships without attributes might be useful...???

Since most XML does not have an ID for every element, and no XML has ID 
attributes for other node types, the IDREFS trick simply will not work. We 
use inherent identity instead.

I think you are searching for the unordered() function, which allows the 
system to return, say, a list of authors, in any order it finds efficient. 
We also have sorting, of course, which allows you to get things back in the 
order you prefer.

>c) About syntax -- I look at XQueryX examples being sent in mails in
>xml-dev (or)  xml-query... I see keywords like SLASHSLASH -- hmm, i think
>such keywords eliminate humans totally out of the loop from XQueryX ..???

You may have noticed the following issue in the XQueryX document:

<snip>
Issue 8 : Representing // (xqueryx-slash-slash)

Originator: XMLQuery
Locus: xqueryx
Description:

In this document we use the constant SLASHSLASH as a fictive axis that 
corresponds to the meaning of the "//" operator. In fact, this operator 
does not correspond directly to an axis, but to 
descendant-or-self::node()/. For example, //para is short for 
/descendant-or-self::node()/child::para. Since XQueryX must be able to 
translate back to the original XQuery syntax, we currently use SLASHSLASH 
to preserve the original operator.

Is this the best way to represent the // operator in XQueryX?
</snip>

I didn't find a better way to map this into XQueryX.


>I think there might be humans who like to take short-cuts, and take an
>XQueryX query directly and try to modify it -- they might take the
>trouble to learn XQueryX keywords, rather than use the tool for the
>conversion -- others getting involved in the project might feel totally
>out of place if the previous person was using such short-cuts..???

Possibly. I used to have a boss who would change the binaries of my 
assembly programs by hand if the assembler generated the wrong thing. But 
I'm not sure this is what XQueryX was designed for.

Jonathan


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.