<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>2555</bug_id>
          
          <creation_ts>2005-11-29 13:24:49 +0000</creation_ts>
          <short_desc>error in EBNF XQuery: DirElemConstructor in wrong place?</short_desc>
          <delta_ts>2006-10-19 19:46:32 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Formal Semantics 1.0</component>
          <version>Working drafts</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="wim de vries">w.vries</reporter>
          <assigned_to name="Jerome Simeon">simeon</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>7278</commentid>
    <comment_count>0</comment_count>
    <who name="wim de vries">w.vries</who>
    <bug_when>2005-11-29 13:24:51 +0000</bug_when>
    <thetext>In the &quot;XQuery 1.0: An XML Query Language W3C Candidate Recommendation 3
November 2005&quot; 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 &quot;A&quot; using an Xpath expression:
.../&lt;A/&gt;/... or .../&lt;A&gt;content&lt;/A&gt;...
wher it should be .../A/...
&lt;A/&gt; or &lt;A&gt;content&lt;/A&gt; are a DirElemConstructor [96].
Following the EBNF path upwards I found DirElemConstructor [96]&gt;
DirectConstructor [95]&gt; Constructor [94]&gt; PrimaryExpr [84]&gt; FilterExpr [81]&gt;
StepExpr [69]&gt; RelativePathExpr [68].
The last one contains on or more &apos;/&apos; which creates this strange construct.
regards,
wim de vries</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7280</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Rys">mrys</who>
    <bug_when>2005-11-29 14:48:29 +0000</bug_when>
    <thetext>Why is that a problem?

The meaning of 

/a/b/&lt;c/&gt;

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 &lt;c/&gt;
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7281</commentid>
    <comment_count>2</comment_count>
    <who name="wim de vries">w.vries</who>
    <bug_when>2005-11-29 16:24:19 +0000</bug_when>
    <thetext>ok. But that means selection and return control are in one statement.
What would then mean /a/b/&lt;c/&gt;/d/e 
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7282</commentid>
    <comment_count>3</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-11-29 16:34:27 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; ok. But that means selection and return control are in one statement.
&gt; What would then mean /a/b/&lt;c/&gt;/d/e 
&gt; 

it selects nothing as &lt;c/&gt; has no d children but
/a/b/&lt;c&gt;&lt;d&gt;&lt;e/&gt;&lt;/d&gt;&lt;/c&gt;/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 &lt;c&gt;....&lt;/c&gt; as being a function that returns a
sequence of one new node, and it all works out in the end.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7283</commentid>
    <comment_count>4</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2005-11-29 16:40:00 +0000</bug_when>
    <thetext>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 &apos;/&apos;, the
semantics is well defined, although sometimes odd for certain cases.

- Jerome</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7605</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Rys">mrys</who>
    <bug_when>2006-01-04 18:51:20 +0000</bug_when>
    <thetext>Dear Wim

The WG took a look at your questions and thinks that Michael&apos;s and David&apos;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)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>