Reputation: 1133
I am not sure what I am doing wrong. But the error is coming as follows:
s4s-elt-invalid-content.1:Element 'simpleType' is invalid, misplaced, or occurs too often.
<xsd:element name="amtNew" minOccurs="0">
<xsd:complexType>
<xsd:simpleType>
<xsd:restriction base="xsd:decimal">
<xsd:totalDigits value="13" />
<xsd:fractionDigits value="3" />
</xsd:restriction>
</xsd:simpleType>
<xsd:attribute name="code" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:length value="3" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
Upvotes: 0
Views: 583
Reputation: 25054
The xsd:complexType element cannot take xsd:simpleType as a child, so the document you are using is not valid against the XSD schema for schema documents. If you do not have the schema for schema documents clear in your head (there may be some people who do), you will save yourself a lot of grief if you use an XML editor which has knowledge of the schema and can check your schema documents at least for schema-validity; you will save even more time if your editor can check your schema documents for conformance to the spec (which involves some constraints that go beyond validity of the individual schema documents).
In this case, you appear to be wanting to define an element whose content is a decimal number of at most 13 digits and which is required to carry an attribute named code
. The complex type you want has 'simple content' and is an extension of the simple type for the content; you should look in the schema (or in a tutorial) for information about the xsd:simpleContent and xsd:extension elements.
Upvotes: 1