Re: Is it legal to embed xml within an <annotation><documentation>

Hi Chuck,

> My question is "Is my schema wrong? or, is the schema quality
> checker wrong?"

I think that your schema is wrong. You have:

>         <documentation>
>             A compound datatype, with components: minimum, optimum, 
> maximum. Each component is a <length/>. If "minimum" is greater than 
> optimum, it will be treated as if it had been set to "optimum". If 
> "maximum" is less than optimum, it will be treated as if it had been set 
> to "optimum". A property may define additional constraints on the values.
>         </documentation>

Here, your default namespace is the XML Schema namespace so the length
element is the length element in the XML Schema namespace. In the
Schema for Schemas, the xs:documentation element is defined as follows:

<xs:element name="documentation" id="documentation">
  <xs:complexType mixed="true">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:any processContents="lax" namespace="##any" />
    </xs:sequence>
    <xs:attribute name="source" type="xs:anyURI" />
    <xs:attribute ref="xml:lang" />
  </xs:complexType>
</xs:element>

As you can see, the content of xs:documentation is mixed and can
include any element in any namespace. But the wildcard (xs:any)
specifies *lax* validation, which means that if an element is declared
in the Schema for Schemas, then the element should be valid against
that declaration.

The xs:length element that you've included in your documentation *is*
declared in the Schema for Schemas, of course. The reason that SQC is
complaining is that the xs:length element in the documentation doesn't
have a value attribute, which is required for xs:length.

I suspect that you didn't mean for the length element to be in the XML
Schema namespace, since you're not talking about length as a facet of
a data type. So you should do:

  ...Each component is a <length xmlns="" />...

or use another namespace as desired.
  
Cheers,

Jeni

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

Received on Wednesday, 12 June 2002 14:51:39 UTC