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 6311 - [XQX11] wndowVars is optional in the XQueryX 1.1 schema
Summary: [XQX11] wndowVars is optional in the XQueryX 1.1 schema
Status: CLOSED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQueryX 3.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-15 01:47 UTC by Andrew Eisenberg
Modified: 2009-03-12 20:11 UTC (History)
0 users

See Also:


Attachments

Description Andrew Eisenberg 2008-12-15 01:47:46 UTC
windowVars is optional in the two definitions that reference it:

  <xsd:complexType name="windowStartCondition">
    <xsd:sequence>
      <xsd:element ref="windowVars" minOccurs="0"/>
      <xsd:element name="winStartExpr" type="exprWrapper"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="windowStartCondition" type="windowStartCondition"/>

  <xsd:complexType name="windowEndCondition">
    <xsd:sequence>
      <xsd:element ref="windowVars" minOccurs="0"/>
      <xsd:element name="winEndExpr" type="exprWrapper"/>
    </xsd:sequence>
    <xsd:attribute name="onlyEnd" type="xsd:boolean" default="false"/>
  </xsd:complexType>

  <xsd:element name="windowEndCondition" type="windowEndCondition"/>

The elements in windowVars should all be optional themselves (Bug #6310).

This means that an empty list of window variables can be written two ways:

<windowStartCondition>
   <winStartExpr>
      .
      .
      .
   </winStartExpr>
</windowStartCondition>

and

<windowStartCondition>
   <windowVars/>
   <winStartExpr>
      .
      .
      .
   </winStartExpr>
</windowStartCondition>


Perhaps the windowVars element should be required.
Comment 1 Jim Melton 2009-01-13 01:20:35 UTC
I, provisionally, disagree.  In fact, it was just this consideration that caused the situation you reported in Bug 6310.  I don't believe that a <windowVars> element should appear in a <windowStartCondition> or <windowEndCondition> element unless it has some content. Based on that philosophy, my initial design of the <windowVars> element required the "least optional" child, the <positionalVariableBinding> element. 

However, by accepting your proposed change for Bug 6310, we have introduced the situation in which an empty list of window variables has two representations, one with an empty <windowVars> element and one with no <windowVars> element. 

Instead of my immediately accepting the recommendation in this bug, I'd like more discussion of whether my original design was appropriate (meaning that a <windowVars> element should have a required child <positionalVariableBinding> element), or whether it's better to make the child <positionalVariableBinding> element optional in the <windowVars> element and then require the (possibly empty) <windowVars> child element in the <windowStartCondition> or <windowEndCondition> elements. 
Comment 2 Jim Melton 2009-03-06 19:30:08 UTC
The XML Query WG discussed this at its recent face-to-face meeting and concluded that there was no harm in providing two ways of representing an empty list of "windowVar"s, provided the XQueryX stylesheet generates the proper XQuery code. That generation has been confirmed, so we are marking this bug RESOLVED/INVALID.  If this is satisfactory to you, please mark it CLOSED.