Re: choice for attributes?

Eddie Robertson wrote:
> Scot Nielsen wrote:
>> Can we then assume that many schema rules and constraints are
>> validated solely by the parser and not the schema.xsd? For example an
>> <element> declaration must have either a type or ref attribute but not
>> both. I can find no constraint in schema.xsd to enforce this so it
>> must be the parser right?
>
> That's correct. Most schema processors won't actually use the
> XMLSchema.xsd schema to validate the schema you pass to it. Instead it
> will have a built in schema structure that gets used for validation.

Just to expand a bit on this... it's also true that the schema for
schemas can't represent all the constraints that are actually present
on XML representations of schemas. In the XML Schema Structures Rec
there are a whole series of "Schema Representation Constraints" which
are all about those constraints that can't be articulated in XML
Schema.

For example, "Schema Representation Constraint: Element Declaration
Representation OK" includes things like:

  "default and fixed must not both be present."
  "One of ref or name must be present, but not both."

which are essentially choices between attributes.

Cheers,

Jeni

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

Received on Thursday, 24 January 2002 05:54:49 UTC