W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2002

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

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 12 Jun 2002 19:51:36 +0100
Message-ID: <1042087532713.20020612195136@jenitennison.com>
To: xmlschema-dev@w3.org, Chuck Paussa <cpaussa@myrealbox.com>

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:attribute name="source" type="xs:anyURI" />
    <xs:attribute ref="xml:lang" />

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.


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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:57 UTC