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 6982 - Open content allows (but ignores) minOccurs and maxOccurs
Summary: Open content allows (but ignores) minOccurs and maxOccurs
Status: CLOSED INVALID
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.1 only
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: David Ezell
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-29 15:42 UTC by Michael Kay
Modified: 2009-10-26 16:44 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael Kay 2009-05-29 15:42:21 UTC
It seems that the XML representation allows minOccurs and maxOccurs on the <xs:any> element that is a child of <xs:openContent>, but these attributes are not mapped to anything in the schema component model. Since the attribute have no meaning (and especially since it may not be obvious to users that they have no meaning) they should be disallowed in the XML representation.
Comment 1 Sandy Gao 2009-06-13 20:19:02 UTC
They are already disallowed.

In Appendix A "Schema for Schema Documents (Structures) (normative)":

  <xs:element name="openContent" id="openContent">
    ...
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xs:annotated">
          <xs:sequence>
            <xs:element name="any" minOccurs="0" type="xs:wildcard"/>
          </xs:sequence>

Here type "wildcard" doesn't allow min/maxOccurs. To allow them on normal wildcards:

  <xs:element name="any" id="any">
    ...
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xs:wildcard">
          <xs:attribute name="notQName" type="xs:qnameList"
                        use="optional"/>
          <xs:attributeGroup ref="xs:occurs"/>

P.S. this also means that "notQName" is not allowed on <any> in open content. I do not recall why that's the case.
Comment 2 Michael Kay 2009-06-26 16:18:14 UTC
Thanks for pointing this out.

Closing as invalid.
Comment 3 Kevin Braun 2009-10-26 16:44:07 UTC
IMHO, this seems like something that should be noted in the main body of the recommendation.  At least for minOccurs/maxOccurs, you can see on a careful reading that they would be ignored (if they were allowed).  The notQName attribute is more subtle.

There is an analogous situation at the end of 3.7.2, where the XML representation presented is not precise and attention is called to the implications of the S4S.  That seems like the right approach, as readers will have the expectation that the XML Representation sections are complete - at least, that's been my expectation.

Please consider reopening this one.