<?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>2630</bug_id>
          
          <creation_ts>2006-01-02 12:35:57 +0000</creation_ts>
          <short_desc>[DM] Default values of elements</short_desc>
          <delta_ts>2007-12-17 19:51:24 +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>Data Model 1.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="Michael Kay">mike</reporter>
          <assigned_to name="Norman Walsh">Norman.Walsh</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>7575</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-01-02 12:35:57 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7896</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-01-20 18:13:18 +0000</bug_when>
    <thetext>Please see also the related XML Schema bugzilla entry

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2632</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8312</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-02-17 19:12:58 +0000</bug_when>
    <thetext>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
&quot;children&quot; property, I propose that we add, before the last paragraph:

&lt;new&gt;
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.
&lt;/new&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8708</commentid>
    <comment_count>3</comment_count>
    <who name="Norman Walsh">Norman.Walsh</who>
    <bug_when>2006-03-14 16:04:30 +0000</bug_when>
    <thetext>Fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18122</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-12-17 19:51:24 +0000</bug_when>
    <thetext>Please note that bug #5319 is effectively a continuation of this issue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>