<?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>2258</bug_id>
          
          <creation_ts>2005-09-16 11:30:03 +0000</creation_ts>
          <short_desc>[xqueryx]  XQueryX fragments</short_desc>
          <delta_ts>2005-09-29 09:23:02 +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>XQueryX 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</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="David Carlisle">davidc</reporter>
          <assigned_to name="Jim Melton">jim.melton</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>6319</commentid>
    <comment_count>0</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-09-16 11:30:03 +0000</bug_when>
    <thetext>Should XQueryX allow documents that have top level element something
other than xqx:Module?

In Xquery it is clear that 1 is a valid expression and [1] is not, even
though it matches the production Predicate, as the Xquery EBNF has a
specified start production, and it is not possible to parse [1] starting
from Module. Unfortunately XSD schema can not specify a starting (top
level) element.

It would be possible to restrict the top level elements by making all
other element declarations local, but that would badly disrupt the
current mechanisms of using substitution groups which can only refer to
globally defined eleemnts.

However an alternative would be to make this restriction in the
stylesheet:

&lt;xsl:template match=&quot;/*&quot;&gt;
 &lt;xsl:message terminate=&quot;yes&quot;&gt;don&apos;t do that&lt;/xsl:message&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;/xqx:module&quot; priority=&quot;2&quot;&gt;
  ....


Without such a restriction there are several examples of documents that
are valid against the xqueryx schema, and generate valid xquery
expressions when processed with the stylesheet, but which have rather
unfortunate meanings.

1
======================
&lt;xqx:atomicType
xmlns:xqx=&quot;http://www.w3.org/2005/XQueryX&quot;&gt;a&lt;/xqx:atomicType&gt;

This is
a
and selects an element of that name, despite using xqx:atomicType
======================


2
======================
&lt;xqx:resultExpr xmlns:xqx=&quot;http://www.w3.org/2005/XQueryX&quot;&gt;
&lt;xqx:contextItemExpr/&gt;
&lt;/xqx:resultExpr&gt;

this is 
.
so the resultExpr element isn&apos;t restricted to typeswitch (it&apos;s intended
usage)


======================

3
======================
&lt;xqx:attributeList xmlns:xqx=&quot;http://www.w3.org/2005/XQueryX&quot;&gt;
&lt;xqx:attributeConstructor&gt;
&lt;xqx:attributeName&gt;x&lt;/xqx:attributeName&gt;
&lt;xqx:attributeValue&gt;y&lt;/xqx:attributeValue&gt;
&lt;/xqx:attributeConstructor&gt;
&lt;/xqx:attributeList&gt;

this doesn&apos;t construct attributes, but is instead
 x=&quot;y&quot;
which tests if the child element x is equal to the string &quot;y&quot;
======================


there are other examples, but these are all of the same basic type and
would all be fixed if XqueryX documents were not allowed to start at
arbitrary elements.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6354</commentid>
    <comment_count>1</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2005-09-20 10:01:29 +0000</bug_when>
    <thetext>Thank you for your report and suggestion.  This question has been considered in
the past and it was felt at that time that (a)there are philosophical
differences in opinion about whether XQueryX documents should be required to
start at a specific level in the grammar or if complete flexibility is better,
and (b)it was acceptable that not all syntactically valid (that is, validatable)
XQueryX documents have defined semantics (in the sense that they might be
translated to XQuery expressions that are either invalid syntactically or that
have unexpected syntax). 

Your discussion indicates that this issue needs some more consideration, which
will be started immediately. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6574</commentid>
    <comment_count>2</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2005-09-29 09:08:33 +0000</bug_when>
    <thetext>The Working Group has discussed this comment and the proposed solution.  We
found your arguments persuasive and have adopted the proposed solution with the
addition of text in the specification itself to highlight the new restriction. 

Please let us know if you agree with this resolution of your issue, by adding a
comment to the issue record and changing the Status of the issue to Closed. Or,
if you do not agree with this resolution, please add a comment explaining why.
If you wish to appeal the WG&apos;s decision to the Director, then also change the
Status of the record to Reopened. If you wish to record your dissent, but do not
wish to appeal the decision to the Director, then change the Status of the
record to Closed. If we do not hear from you in the next two weeks, we will
assume you agree with the WG decision.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6579</commentid>
    <comment_count>3</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-09-29 09:23:02 +0000</bug_when>
    <thetext>thanks, closing this.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>