Take a look at this example.
Now in the attribute.xsd there is an gender attribute defined. But as I understand I can use this attribute wherever the family.xsd would have anyAttribute.
Is it possible to restrict gender attribute to a certain parent based on parent’s name?
I solved this using
<xs:redefine>which lets you redefine types and groups.