Hi Group,
I have an xsd where i want to extend an element type but also control
the parent types data. Let us take a simple library example,

We have types Book and Writer (A book has many "authors" and a writer
has "books"). Now there are subclasses for Book like FunBook, TechBook
and Author has subclasses like FreelanceWriter, SeriousWriter etc. (OO
purists please excuse the usage of inheritance paradigm here :)

Now, i want to impose some restrictions on SeriousWriter. For example,
although he can write many types of books, i want to enforce that "He
cannot write FunBooks". Similarly a Techbook not being able to authored
by a "FunWriter" etc.

Can someone tell me if this can be possible in XSD? I am not able to get
the <xsd:restriction> element to work here. The constraint here being
that i want the "authors" and "books" relation *only* in the base class?
I have also attached the sample xsd.

You can't write a constraint that disallows only certain subclasses that
would otherwise be valid. In fact, you should note that XML Schema
itself doesn't even allow you to constrain which type of object may be
referenced by an IDREF or an anyURI.

You can't write a constraint that disallows only certain subclasses that
would otherwise be valid. In fact, you should note that XML Schema
itself doesn't even allow you to constrain which type of object may be
referenced by an IDREF or an anyURI.