I want to declare next type:
<partCode negation="true|false">\*|[0-9]{1,9}</name>
with boolean attribute, and text-only content, limited by a pattern (* or a number).
I have next XSD so far:
<xs:complexType name="partCode">
<xs:simpleContent>
<xs:restriction base="xs:string">
<xs:pattern value="\*|[0-9]{1,9}" />
</xs:restriction>
<xs:extension base="xs:string"> <-- error
<xs:attribute name="negation" type="xs:boolean" use="optional" default="false" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
But it contains an error:
The ‘extension’ element already exists in the content model
How can I achieve that?
1 Answer