I need to imply a restriction and an attribute on a type. I know it can be done this way
<xs:simpleType name="Name">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="15"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="MyCustomeName">
<xs:simpleContent>
<xs:extension base="mc:Name">
<xs:attribute name="MyTypeOfName" fixed="MCN"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Is there a way to do all in one line "inline"
I can add the restriction inline but then I cannot add the attribute as in
<xs:simpleType name="MyCustomName">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="15"/>
<xs:attribute name="MyTypeOfName" fixed="MCN"/> --> This gives an error
</xs:restriction>
</xs:simpleType>
The reason why I want to do this... is we expose the XSD to a 3rd party and they have issues with the inheritance of the types hence I want to do all inline.