Re: another restriction question

Hi Calvin,

> With the occurrence range of the wildcard now set to 0 - unbounded
> and the namespace constraint set to ##any, it seems that it
> satisfies all the requirements, but it still fails.

I've played around with this a bit and I can't find any way of making
Xerces-J validate an "allow anything" content model. I'm not sure
whether this is a bug or whether Xerces-J is following the letter of
XML Schema Rec. MSXML seems to object to the same kind of things
(which would indicate that it wasn't a bug), but then again they both
object to the schema for XML Schema, which we have to assume is
valid...

Anyway, what about building your hierarchy based on extension rather
than restriction. Make your PayloadType allow *nothing* and then
extend it to allow extra things:

<xsd:complexType name="PayloadType" abstract="true" />

<xsd:complexType name="LabelType">
  <xsd:complexContent>
    <xsd:extension base="PayloadType">
      <xsd:sequence maxOccurs="unbounded">
        <xsd:element name="LabelGraphic" type="cct:GraphicType"
                     minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="LabelURI" type="xsd:anyURI" minOccurs="0"
                     maxOccurs="unbounded"/>
        <xsd:element name="LabelHTML" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:extension>
  </xsd:complexContent>
</xsd:complexType>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Wednesday, 24 July 2002 18:42:04 UTC