[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: XQuery & XSLT was RE: Verboseness - XML Syntax for XQuery 1.0(XQueryX)
- From: Jonathan Robie <Jonathan.Robie@SoftwareAG-USA.com>
- To: Murali Mani <mani@CS.UCLA.EDU>
- Date: Wed, 20 Jun 2001 07:04:42 -0400
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]
FOR $j IN foo/@bing
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:
Issue 8 : Representing // (xqueryx-slash-slash)
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?
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.