[Bug 2630] [DM] Default values of elements

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

           Summary: [DM] Default values of elements
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Data Model
        AssignedTo: Norman.Walsh@Sun.COM
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


In the rules for constructing a Data Model from a PSVI, it appears that some
surprising things happen when an element has a default value defined in the schema:

(a) if the element has a simple type, or a complex type with simple content,
then in the PSVI the default value will become the [schema normalized value] of
the node, which will therefore determine its string value and its typed value.
However, the PSVI does not appear to contain any character information items
representing the default value, so there will be no text node children in the
XDM representation. This means that it is no longer true that the string value
of an element is always the same as the concatenation of its descendant text
nodes. The consequences of breaking this invariant are unclear.

(b) if the element has a complex type (default values are allowed for mixed
content models) then it seems we ignore the default value entirely. 

In fact, the schema spec seems unclear here. In section 3.3.1 it says that the
supplied default value becomes the [schema normalized value], but in the
definition of [schema normalized value] it says that for an element with mixed
content the [schema normalized value] is always absent. But whether the default
value is represented by the [schema normalized value] or not, our mapping from
the PSVI ignores it in the case of mixed content.  

Michael Kay

Received on Monday, 2 January 2006 12:36:04 UTC