|
Without hacking around with the schemas, it's hard for me to say for sure, but I believe the problem is in how you decided to do inheritance. You're using a restriction with base any, which means rather than allowing anything, you're taking "any" and reducing it to no content, plus the attribute you named. You want an <xs:extension/> element instead. See my follow-on article; it includes an example of inheritance-by-extension. But I think there's an easier way to do this which doesn't require any inheritance:
<complexType>
<any maxOccurs="unbounded"/>
<attribute name="ContentHeight" type="string"/>
</complexType>
Note that if your intent was to allow any element but wanted to require the ContentHeight attribute on the children rather than the <Content> element, your example would be the way to go, assuming you use <xs:extension/>.
As one more note, unless mixed="true", the default content type is "elementOnly." To be explict you could do this:
<complexType content="elementOnly">
...
</complexType>
but it should be unnecessary.
|