W3C home > Mailing lists > Public > public-qt-comments@w3.org > July 2005

[Bug 1614] New: please spell out all defaults explicitly

From: <bugzilla@wiggum.w3.org>
Date: Fri, 15 Jul 2005 00:15:43 +0000
To: public-qt-comments@w3.org
Cc:
Message-Id: <E1DtDrj-0004gN-EZ@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1614

           Summary: please spell out all defaults explicitly
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Formal Semantics
        AssignedTo: simeon@us.ibm.com
        ReportedBy: fred.zemke@oracle.com
         QAContact: public-qt-comments@w3.org


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 
"SequenceType matching" 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 "Top level 
definitions" that "When the type 
derivation is omitted, the type derives by restriction from 
xs:anyType...").  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.
Received on Friday, 15 July 2005 00:15:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:25 UTC