This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 2555 - error in EBNF XQuery: DirElemConstructor in wrong place?
Summary: error in EBNF XQuery: DirElemConstructor in wrong place?
Status: CLOSED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Working drafts
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Jerome Simeon
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-29 13:24 UTC by wim de vries
Modified: 2006-10-19 19:46 UTC (History)
0 users

See Also:


Attachments

Description wim de vries 2005-11-29 13:24:51 UTC
In the "XQuery 1.0: An XML Query Language W3C Candidate Recommendation 3
November 2005" specs I found the following:
according the EBNF spec (http://www.w3.org/TR/xquery/#nt-bnf) the following
construct is possible for selecting an element "A" using an Xpath expression:
.../<A/>/... or .../<A>content</A>...
wher it should be .../A/...
<A/> or <A>content</A> are a DirElemConstructor [96].
Following the EBNF path upwards I found DirElemConstructor [96]>
DirectConstructor [95]> Constructor [94]> PrimaryExpr [84]> FilterExpr [81]>
StepExpr [69]> RelativePathExpr [68].
The last one contains on or more '/' which creates this strange construct.
regards,
wim de vries
Comment 1 Michael Rys 2005-11-29 14:48:29 UTC
Why is that a problem?

The meaning of 

/a/b/<c/>

is that for every b under an a, a new c is created. E.g., it is the same as

for $i in /a/b return <c/>
Comment 2 wim de vries 2005-11-29 16:24:19 UTC
ok. But that means selection and return control are in one statement.
What would then mean /a/b/<c/>/d/e 
Comment 3 David Carlisle 2005-11-29 16:34:27 UTC
(In reply to comment #2)
> ok. But that means selection and return control are in one statement.
> What would then mean /a/b/<c/>/d/e 
> 

it selects nothing as <c/> has no d children but
/a/b/<c><d><e/></d></c>/d/e 
would select one (newly created) e node for each /a/b node selected from the
original context.
It looks odd, but just think of each step as being a function returning some
sequence of nodes, and think of <c>....</c> as being a function that returns a
sequence of one new node, and it all works out in the end.
Comment 4 Jerome Simeon 2005-11-29 16:40:00 UTC
This does not seem to be comment on Formal Semantics proper, but on XQuery 1.0
semantics in general.

XQuery 1.0 allows arbitrary expressions on the each side of the '/', the
semantics is well defined, although sometimes odd for certain cases.

- Jerome
Comment 5 Michael Rys 2006-01-04 18:51:20 UTC
Dear Wim

The WG took a look at your questions and thinks that Michael's and David's 
answers provide you with the correct explanations. Since it does not lead to a 
change in the specifications, we will mark it as invalid.

If you agree with our resolution, please mark the bug as closed. 
If you disagree, please reopen.

Thanks
Michael (speaking for the WG)