This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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
Please see also the related XML Schema bugzilla entry http://www.w3.org/Bugs/Public/show_bug.cgi?id=2632
Action A-288-04 asks me and Norm to propose wording to fix this issue. In fact, I think section 6.2.4 of the Data Model spec is almost there. Under the "children" property, I propose that we add, before the last paragraph: <new> The effect of the above rules is that where a fixed or default value for an element is defined in the schema, and the element takes this default value, a text node will be created to contain the value, even though there are no character information items representing the value in the PSVI. The position of this text node relative to any comment or processing instruction children is implementation-dependent. [XML Schema] also permits an element with mixed content to take a default or fixed value (which will always be a simple value), but at the time of writing it is unclear how such a defaulted value is represented in the PSVI. Implementations therefore [may] represent such a default value by creating a text node, but are not required to do so. </new>
Fixed.
Please note that bug #5319 is effectively a continuation of this issue.