This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5281 - Why allow an element to be valid against a declaration with the wrong name?
Summary: Why allow an element to be valid against a declaration with the wrong name?
Status: RESOLVED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.0/1.1 both
Hardware: Macintosh All
: P1 minor
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard: terminology cluster
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2007-11-23 02:01 UTC by C. M. Sperberg-McQueen
Modified: 2008-03-04 23:24 UTC (History)
0 users

See Also:


Attachments

Description C. M. Sperberg-McQueen 2007-11-23 02:01:57 UTC
The definition of local validity in Validation Rule: Element Locally 
Valid (Element) specifies that the element

  <b/>

is locally valid against the declaration

  <element name="a"/>

This is crazy and should be eliminated.

The text says "The {name} and {target namespace} properties 
are not mentioned above because they are checked during particle 
·validation·, as per Element Sequence Locally Valid (Particle) 
(§3.9.4.2)", but this is not a persuasive reason for defining local
validity against an element declaration without regard to the 
name declared and the name found in the element.  

The note suggests that XSDL 1.0 was written in the belief that 
the question  "is element E locally valid against declaration D?" 
is logically possible only for an element's context-determined 
declaration. That belief is false and should not be allowed to 
influence our spec.  

In addition to making the definition of local validity more
useful, fixing this bug will make it unnecessary to have 
special-case wording to handle element-driven invocation of 
a validator, in section 5.2.
Comment 1 Michael Kay 2007-11-23 09:56:55 UTC
Where do substitution groups fit into this picture? If B is in the substitution group of A, then is a <b/> element to be considered locally valid against the declaration of A?
Comment 2 David Ezell 2008-01-24 19:00:36 UTC
(aside response to comment #1)--
<MSM> I think the answer to MKay's question is that Validation Rule: Element Sequence Accepted (Particle) rule 2.3.3 attributes (binds) the element inforjmation item to the element declaration that bears its name, not the element declaration in the particle.
<MSM> So we don't need to allow the substituting element to be valid against the sulbstituted element declaration.
Comment 3 David Ezell 2008-01-24 19:18:58 UTC
Proposal: change clause 1 of Attribute Locally Valid and Element Locally Valid (Element) to add name check.

N.B. by adding the check to clause 1 we avoid having existing error codes change.

We are aware, as we buy this, that it means code cvc-attribute.1 now has two distinct meanings.

RESOLUTION:  For bug 5281, we will change clause 1 of Attribute Locally Valid and element Locally Valid (Element) to add name check, probably get rid of redunancy e.g. in invocation case, and change status to NEEDS DRAFTING.
Comment 4 C. M. Sperberg-McQueen 2008-02-04 16:17:18 UTC
In an effort to make better use of Bugzilla, we are going to use the
'severity' field to classify issues by perceived difficulty.  This 
bug is getting severity=minor to reflect the existing whiteboard note
'easy'. 
Comment 5 C. M. Sperberg-McQueen 2008-03-04 23:24:36 UTC
A wording proposal addressing this issue (among others) was adopted by the 
XML Schema WG on 15 February.  (This record should have been updated then,
but something went wrong; mea culpa, probably, and my apologies.)

http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.2008omnibus3.html
(member-only list)

Since the originator of this issue is a WG member, he is presumed to assent
to this resolution of the issue.  For formal purposes, however, it would be
convenient if he so indicated in the usual way.