Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XSD validation clarification for Amazon MWS product feed

I am looking for some clarification regarding how to read the XSD that Amazon uses to validate their XML product feed.

This is the XSD used (and the inner Product one) and these are the docs.

When I submit a basic product feed without a description or BulletPoint feed I get this error:

A value was not provided for "bullet_point1". Please provide a value for "bullet_point1". This information appears on the product detail page and helps customers evaluate products.

A value was not provided for "product_description". Please provide a value for "product_description". This information appears on the product detail page and helps customers evaluate products.

Here are the relevant XSD sections:

<xsd:element name="Description" minOccurs="0">
  <xsd:simpleType>
    <xsd:restriction base="xsd:normalizedString">
      <xsd:maxLength value="2000"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>
<xsd:element name="BulletPoint" type="LongStringNotNull" minOccurs="0" maxOccurs="5"/>

My understanding is that minOccurs="0" means its not required yet it clearly is. I have looked through a few other inner XSD (such as Base) for these fields in case they were overridden but did not see anything.

Is this the wrong XSD? Am I reading this wrong?

like image 297
cyberwombat Avatar asked Jan 23 '26 17:01

cyberwombat


2 Answers

Yes, minOccurs="0" means optional, however...

In general, applications often have additional requirements beyond those specified in the XSD of its XML input. When parameters are required only in certain circumstances, an XSD will list them as optional in the general case but then check them out-of-band wrt the XSD. (XSD 1.1 provides some additional expressiveness via xs:assertion for conditionally requiring elements/attributes, but it's not widely adopted yet.)

Note that bullet_point1 does not appear in any of the XSDs or documentation you've linked to your question. If bullet_point1 is derived from BulletPoint in the XSD, then it clearly is a downstream application that's making the additional requirement and issuing the error when it's unmet.

like image 125
kjhughes Avatar answered Jan 25 '26 09:01

kjhughes


I asked to the amazon developers this question and they answered to me:

xsd of categories are not correctly updated so some elements would be required but not reflected in the .xsd document thaty's the problem.

like image 29
Gerard Luque Avatar answered Jan 25 '26 10:01

Gerard Luque



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!