Thanks Lisa, thanks Keith,

I guess I should illustrate my problem a bit more detailed. I would like to
have a complex base type with a simple content containing only attributes.
I need the base type to make the derived types exchangeable in the xml
documents. The type of the simple content shall be specified in the derived
type. (i.e. integer, boolean ...) As far as I understood I could achieve
the same with a substitution group and an attribute group, but the
substitution group needs again a common base type for all exchangeable
elements, right?

<complexType name="a">
  <simpleContent>
    <restriction base="anyType">
      <attribute name="isNullable" type="boolean" use="optional"/>
      <attribute name="isUpdatable" type="boolean" use="optional"/>
    </restriction>
  <simpleContent>
</complexType>

<complexType name="b">
  <simpleContent>
    <restriction base="a">
      <simpleType>
        <restriction base="integer"/>
      </simpleType>
    </restriction>
  </simpleContent>
</complexType>

This sample works if I use the following definition for complex type 'a':

<complexType name="a">
  <attribute name="isNullable" type="boolean" use="optional"/>
  <attribute name="isUpdatable" type="boolean" use="optional"/>
</complexType>

But this restricts the content of 'a' to be EMPTY. And that is again not
excatly what I'm trying to do...

If I specifiy the content of a to be a 'string', I can't restrict the
content of the derived type to be an 'integer' or a 'boolean', can I?

But in general my example should be valid, shouldn't it? Or do I have
overlooked something in the xml schema spec?

Thanks again.
Holger


Reply via email to