I'm trying to allow the following within an XML file:
[tt]<Quantity uom="ea">4</Quantity>[/tt]
I have tried to support this within the XSD schema, as follows:
[tt]<xsd:element name="Quantity" type="xsd:integer">
<xsd:complexType>
<xsd:attribute name="uom" type="xsd:string" />
</xsd:complexType>
</xsd:element>[/tt]
However, my mapping program (Altova MapForce) rejects the XSD, saying that: "The 'type' attribute and an anonymous type definition are mutually exclusive for element declaration 'Quantity'."
I'm sure this must be simple and I must be doing the wrong Google searches, because I can't find the answer, so I do apologise.
What am I doing wrong in the XSD and how should this be defined instead?
[tt]<Quantity uom="ea">4</Quantity>[/tt]
I have tried to support this within the XSD schema, as follows:
[tt]<xsd:element name="Quantity" type="xsd:integer">
<xsd:complexType>
<xsd:attribute name="uom" type="xsd:string" />
</xsd:complexType>
</xsd:element>[/tt]
However, my mapping program (Altova MapForce) rejects the XSD, saying that: "The 'type' attribute and an anonymous type definition are mutually exclusive for element declaration 'Quantity'."
I'm sure this must be simple and I must be doing the wrong Google searches, because I can't find the answer, so I do apologise.
What am I doing wrong in the XSD and how should this be defined instead?