<?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>1614</bug_id>
          
          <creation_ts>2005-07-15 00:15:43 +0000</creation_ts>
          <short_desc>please spell out all defaults explicitly</short_desc>
          <delta_ts>2005-09-27 08:41:15 +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>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 2000</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="Fred Zemke">fred.zemke</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>4690</commentid>
    <comment_count>0</comment_count>
    <who name="Fred Zemke">fred.zemke</who>
    <bug_when>2005-07-15 00:15:43 +0000</bug_when>
    <thetext>2.4 The [XPath/XQuery] type system
Since this is a purely formal language, not exposed to users, there
is no point in defining any defaults.  Instead, making every 
declaration totally explicit is to be preferred as the clearest.
By that principle, optionality should be used only for cases 
where missing syntax corresponds to a missing characteristic of
the defined type, rather than a defaulted characteristic.  
Adopting this principle would eliminate the need for the reader
to chase down the defaults (which is really hard to do in the 
current document, and I am not sure they are always there).  
Instead, the normalization and
type expansion rules should supply all defaults explicitly.
For example, the normalization rule for item() would be

  [item()]sequencetype 
  ==
  ( element of type xs:anyType | attribute | text | 
    document { ( text | element of type xs:anyType | comment 
                 | processing-instruction )* }
    | xdt:anyAtomicType )


In the case of attribute, the normalization rule in 3.5.4 
&quot;SequenceType matching&quot; currently is misleading, precisely
because it does not spell out the default.
One might think that the default type of an attribute node is
xs:anyType (on the strength of the statement in 2.4.4 &quot;Top level 
definitions&quot; that &quot;When the type 
derivation is omitted, the type derives by restriction from 
xs:anyType...&quot;).  However, xs:anySimpleType is more appropriate,
so the normalization rule should be

  [attribute()]sequencetype
  ==
  attribute of type xs:anySimpleType

This example shows that errors in the specification can be 
uncovered by simply attempting to spell out all the defaults
explicitly in the rules.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5053</commentid>
    <comment_count>1</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2005-07-20 23:48:55 +0000</bug_when>
    <thetext>I essentially agree with the intent. We should notably make sure we go over the
document to see if we find other problems than the one you mention.

Having defaults everywhere will make the examples unnecessarily unreadable
though. I would like to propose an intermediate compromise which would be:

 * define default only for use in examples
 * make sure that none the formal rules use any default

Any comment on that approach?
- Jerome</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5146</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Rys">mrys</who>
    <bug_when>2005-07-22 16:48:51 +0000</bug_when>
    <thetext>The WG discussed this issue and asked the editors to improve the understanding 
of defaults in the document while taking your feedback and the discussion 
within the working group into account.

Feel free to close the bug if you agree with the resolution. If you disagree, 
feel free to reopen it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>