<?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>2632</bug_id>
          
          <creation_ts>2006-01-03 15:09:26 +0000</creation_ts>
          <short_desc>Default value and [schema normalized value]</short_desc>
          <delta_ts>2009-04-20 21:49:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Schema</product>
          <component>Structures: XSD Part 1</component>
          <version>1.1 only</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>important, easy</status_whiteboard>
          <keywords>resolved</keywords>
          <priority>P4</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sandy Gao">sandygao</reporter>
          <assigned_to name="C. M. Sperberg-McQueen">cmsmcq</assigned_to>
          <cc>cmsmcq</cc>
    
    <cc>mike</cc>
          
          <qa_contact name="XML Schema comments list">www-xml-schema-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>7578</commentid>
    <comment_count>0</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2006-01-03 15:09:26 +0000</bug_when>
    <thetext>Section 3.3.1 of Part 1 says:

If default is specified, and if the element being ·validated· is empty, then
the canonical form of the supplied constraint value becomes the [schema
normalized value] of the ·validated· element in the ·post-schema-validation
infoset·.

But the definition of [schema normalized value] says:

1 If clause 3.2 of Element Locally Valid (Element) (§3.3.4) and Element
Default Value (§3.3.5) above have not applied and either the ·type
definition· is a simple type definition or its {content type} is a simple
type definition, then the ·normalized value· of the item as ·validated·.
2 otherwise ·absent·.

which implies that if the type definition is a complex type with complex
content, then the schema normalized value is always absent.

There seems to be a contradiction here: can an element with mixed content
have a [schema normalized value], or not?

Furthermore, the definition of [schema normalized value] appears to say that
the [schema normalized value] will always be ·absent· if Element Default
Value (§3.3.5) applies, whereas Element Default Value (§3.3.5) says that in
this situation the [schema normalized value] will be the canonical lexical
representation of the {value constraint} value. They can&apos;t both be right...

see: http://lists.w3.org/Archives/Public/xmlschema-dev/2006Jan/0000.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7580</commentid>
    <comment_count>1</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2006-01-03 15:24:15 +0000</bug_when>
    <thetext>&gt; Section 3.3.1 of Part 1 says: ...
&gt; But the definition of [schema normalized value] says: ...
&gt; There seems to be a contradiction here: can an element with mixed content
&gt; have a [schema normalized value], or not?

Agree, there is a contradiction. I think 3.3.1 is too loosely specified. The
intention is that [schema normalized value] is only available for simple
type/contnet values. When a default value of a mixed content is applied, it
should not be reflected in [schema normalized value].

Propose to change in 3.3.1 from

&quot;the canonical form of the supplied constraint value becomes the [schema
normalized value] of the ·validated· element in the ·post-schema-validation
infoset·&quot;

to

&quot;the element is treated as if the canonical form of the supplied constraint
value was used as the content of the element.&quot;

&gt; Furthermore, the definition of [schema normalized value] ...
&gt; They can&apos;t both be right...

Agree again. The intention is that [schema normalized value] does get the
default value in this case.

Propose to change the description of [schema normalized value] to

&quot;The appropriate case among the following:
1 If clause 3.2 of Element Locally Valid (Element) (§3.3.4) above is satisfied,
then absent.
2 Otherwise if clause 5.1 of Element Locally Valid (Element) (§3.3.4) above is
satisfied, then the canonical lexical representation of the {value constraint}
value.
3 Otherwise if either the ·type definition· is a simple type definition or its
{content type} is a simple type definition, then the ·normalized value· of the
item as ·validated·.
4 Otherwise absent.&quot;

And change clause 1 of the description of [schema specified] to

&quot;If the item is ·valid· with respect to an element declaration as per Element
Locally Valid (Element) (§3.3.4) and clause 5.1 of Element Locally Valid
(Element) (§3.3.4) above is satisfied, then schema.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7581</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-01-03 16:11:31 +0000</bug_when>
    <thetext>&gt;&quot;the element is treated as if the canonical form of the supplied constraint
value was used as the content of the element&quot;

-- does this mean that character information items are added to the PSVI -
something that doesn&apos;t seem to happen at the moment?

-- if so, where are they added relative to any existing comment or PI children?

The answers affect QT, which builds a data model from the PSVI.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7589</commentid>
    <comment_count>3</comment_count>
    <who name="Dave Peterson">davep</who>
    <bug_when>2006-01-03 19:14:45 +0000</bug_when>
    <thetext>(In reply to comment #1)

&gt; Propose to change the description of [schema normalized value] to
&gt; 
&gt; &quot;The appropriate case among the following:

&gt; 2 Otherwise if clause 5.1 of Element Locally Valid (Element) (§3.3.4) above is
&gt; satisfied, then the canonical lexical representation of the {value constraint}
&gt; value.

This can&apos;t fly as is if we are to completely eliminate canonical representations from
schema processing, which IIRC is our stated intent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7897</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-01-20 18:14:41 +0000</bug_when>
    <thetext>Please see also the related XDM bugzilla entry

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2630</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24235</commentid>
    <comment_count>5</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2009-03-13 15:53:42 +0000</bug_when>
    <thetext>The WG agreed on its call today to reopen this issue, pending agreement on
(1) an erratum for XSD 1.0 and (2) a clarification for XSD 1.1.

The draft erratum is at 

  http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures-1.0-e1-56.html

The email cover letter is at 

  http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2009Feb/0015.html

We considered the erratum today and concluded that in section 3.3.1 we need to
add a clarification (perhaps in the form of a note) that the element is treated
as if it had content *for purposes of calculating PSVI infoset contributions* like
[schema normalized value], not for other purposes.  That is, the element doesn&apos;t
have character information items in the input, and it won&apos;t in the PSVI, either.

Editors to draft this amendment to the erratum, and also a parallel editorial
proposal for 1.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24787</commentid>
    <comment_count>6</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2009-04-16 21:14:16 +0000</bug_when>
    <thetext>Here is a proposal for the desired clarification.  

(1) In 3.3.1 of Structures, in the paragraph beginning &quot;{value
constraint}&quot;, change the sentence which now reads

    If a {value constraint} with {variety} = default is present,
    and if the element being ·validated· is empty, then the
    element is treated as if {value constraint}.{lexical form}
    was used as the content of the element.

to read

    If a {value constraint} with {variety} = default is present,
    and if the element being ·validated· is empty, then for
    purposes of calculating the [schema normalized value] and
    other contributions to the post-schema-validation information
    set, the element is treated as if {value constraint}.{lexical
    form} was used as the content of the element.

(2) Before the existing Note following that parargraph insert a
second Note:

    Note: when a default value is supplied and used, as described
    in the second sentence of the preceding paragraph, the
    default value is used to calculate the [schema normalized
    value], etc., but the actual content of the element is not
    changed: the element was empty in the input information set,
    and it remains empty in the PSVI.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24875</commentid>
    <comment_count>7</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2009-04-20 21:49:38 +0000</bug_when>
    <thetext>During its 2009-04-17 telecon, the schema WG adopted the proposal in comment #6 to address this issue, with one amendment. The amendment is to change the new note to read:

    Note: When a default value is supplied and used, as described
    in the second sentence of the preceding paragraph, the default
    value is used to calculate the [schema normalized value], etc.,
    but the actual content of the element is not changed: the element
    contained no character information items in the input information
    set, and it contains none in the PSVI.

With these changes, the WG believes that the issue raised in this bug report is addressed. I&apos;m marking this RESOLVED accordingly.

I&apos;m also CLOSING the bug, given that this bug was reopened by the WG.

I&apos;m also marking this bug as &quot;1.1 only&quot;. Bug 6836 was opened to track the erratum for 1.0.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>