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 5906 - Problem in definition of <restriction> in <complexType>::<simpleContent>
Summary: Problem in definition of <restriction> in <complexType>::<simpleContent>
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.1 only
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2008-07-29 14:58 UTC by Sandy Gao
Modified: 2009-04-21 19:21 UTC (History)
1 user (show)

See Also:


Attachments

Description Sandy Gao 2008-07-29 14:58:24 UTC
The content of the <restriction> element in <complexType>::<simpleContent> is defined as follows:
Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | maxScale | minScale | length | minLength | maxLength | enumeration | whiteSpace | pattern | assert | {any with namespace: ##other})*)?, ((attribute | attributeGroup)*, anyAttribute?), assert*)

There are 2 assert elements (one belongs in the facets and the other belongs to the complex type). However, the way the grammar is defined, there is no way to differentiate between the 2 asserts.

I would propose we either remove the assert in the facets or change its name to something like assertFacet.
Comment 1 Mukul Gandhi 2008-07-29 17:36:44 UTC
I agree with Sandy.

Apart from his comments, I have following observation ...

In the grammar fragment, which Sandy posted, there is following fragment:

(minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | maxScale |
minScale | length | minLength | maxLength | enumeration | whiteSpace | pattern
| assert | {any with namespace: ##other})*

This is of form, (a | b | c ... | x)* , where a, b, etc. are facets. This grammar format gives me a feeling, that *only 1 facet* (because of the pipe sign) can be present in <xs:restriction element. And the facet which is present, can appear 0-n times.

But in reality, I think we can have multiple facet definitions on a single xs:restriction definition, like following:

<restriction base=".."
 <facet1 value="" />
 <facet2 value="" />
 ... more facets
</restriction>

Is the grammar format, (a | b | c ... | x)* correct regarding facets? My doubt comes from the fact, that the | symbol is used to select alternatives.

Regards,
Mukul
Comment 2 Sandy Gao 2008-10-10 17:05:38 UTC
On 2008-10-10, the working group adopted a proposal to address this issue by changing the facet element name from "assert" to "assertion". (This is mostly a datatypes change.)

The proposal adopted can be found here (member-only):
http://www.w3.org/XML/Group/2004/06/xmlschema-2/datatypes.b5906.html

There were a couple amendments to the above proposal:
- An additional <assert> is replaced with <assertion>
- Added "assert" to the Schema and DTD for schemas where it was missing