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 30261 - inconsistent description of <element> particles
Summary: inconsistent description of <element> particles
Status: NEW
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.1 only
Hardware: PC Windows NT
: P2 critical
Target Milestone: ---
Assignee: David Ezell
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-05 11:56 UTC by Mukul Gandhi
Modified: 2018-06-06 04:48 UTC (History)
2 users (show)

See Also:


Attachments

Description Mukul Gandhi 2018-06-05 11:56:30 UTC
1) The section, "3.9.2 XML Representation of Particle Schema Components" says,

Particles in the schema typically correspond to element information items that can bear minOccurs and maxOccurs attributes in the schema document:
Local <element>, see XML Representation of Element Declaration Schema Components (§3.3.2)
Model groups <all>, <sequence>, and <choice>, see XML Representation of Model Group Schema Components (§3.8.2)
Group references <group>, see XML Representation of Model Group Definition Schema Components (§3.7.2)
Wildcard <any>, see XML Representation of Wildcard Schema Components (§3.10.2)

This seems to say, that only local <element> declarations can be particles, and not global <element> declarations.

2) Whereas, section "J Analysis of the Unique Particle Attribution Constraint (non-normative)" says,

They are both global element declaration particles and their ·substitution groups· contain the same element declaration.

This seems to say, that global element declarations are also particles.

The suggestions at above two places in the spec, are therefore contradictory. The question in this bug report is,
Are only local <element> declarations particles, and not global ones? (as reflected by point 1) above)
Or global <element> declarations are also particles? (as reflected by point 2) above)

My feeling is, that 1) above is correct (only local <element> declarations are particles) and 2) wrong (which implies that, global <element> declarations are also particles).

Also, only local <element> declarations can have minOccurs and maxOccurs attributes (which makes local <element> declarations as particles, as said in point 1) above). But global <element> declarations cannot have these attributes.
Comment 1 C. M. Sperberg-McQueen 2018-06-05 14:13:34 UTC
The list you quote is introduced with the words "element information items that can bear minOccurs and maxOccurs attributes in the schema document".

Top-level element declarations (xsd:element children of xsd:schema) cannot carry those attributes.

Under those circumstances, I think the adjective "Local" in the first bullet item needs to be read as meaning "local to a content model" or "occurring within a content model" and not as meaning "defining an element local to a particular complex type".  It is not the most graceful wording, or the clearest, but I do not believe there is any contradiction.

On a side issue:  The spec's way of describing things is perhaps too convoluted and too hard to follow, but really it is a bad idea to think of any element declarations as being particles -- the spec doesn't say that of any declarations.  It says that typically a particle in the set of schema components "corresponds to" a particular XML element in a schema document. Other components -- the element declaration components themselves -- may also correspond to the same XML element.  I am not very happy with the spec's use of "corresponds to" as a way of avoiding clarity, but substituting "is" is almost certainly not a good idea.

I am speaking only for myself, but my advice to any future group which undertakes to classify and resolve this bug report is:  this issue indicates the need for an editorial change.
Comment 2 Mukul Gandhi 2018-06-06 04:48:58 UTC
Thanks for your comments Michael. Your clarifications are useful to understand the spec better.

To support your point, that element declarations are not particles, the spec says following,
"[Definition:]   An element particle is a Particle whose {term} is an Element Declaration." (section 3.8.6.4 Unique Particle Attribution)

But a particle is a kind of schema component.

If you feel, any further clarification in the spec is required, for the issue I raised, that will be welcome I believe.