简体   繁体   English

亚马逊MWS产品Feed的XSD验证说明

[英]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. 我正在寻找有关如何读取Amazon用来验证其XML产品Feed的XSD的说明。

This is the XSD used (and the inner Product one) and these are the docs . 这是使用的XSD (和内部Product之一),这些是docs

When I submit a basic product feed without a description or BulletPoint feed I get this error: 当我提交没有描述或BulletPoint feed的基本产品feed时,出现此错误:

A value was not provided for "bullet_point1". 没有为“ bullet_point1”提供值。 Please provide a value for "bullet_point1". 请提供“ bullet_point1”的值。 This information appears on the product detail page and helps customers evaluate products. 此信息显示在产品详细信息页面上,可帮助客户评估产品。

A value was not provided for "product_description". 没有为“ product_description”提供值。 Please provide a value for "product_description". 请提供“ product_description”的值。 This information appears on the product detail page and helps customers evaluate products. 此信息显示在产品详细信息页面上,可帮助客户评估产品。

Here are the relevant XSD sections: 这是相关的XSD部分:

<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. 我的理解是minOccurs="0"表示它不是必需的,但显然是必需的。 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. 我仔细检查了其他一些内部XSD(例如Base ),以防这些字段被覆盖但什么都看不到。

Is this the wrong XSD? 这是错误的XSD吗? Am I reading this wrong? 我读错了吗?

Yes, minOccurs="0" means optional, however... 是的, minOccurs="0"表示可选,但是...

In general, applications often have additional requirements beyond those specified in the XSD of its XML input. 通常,除了XML输入的XSD中指定的要求外,应用程序通常还有其他要求。 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会将其列出为可选参数,然后在XSD的带外进行检查。 (XSD 1.1 provides some additional expressiveness via xs:assertion for conditionally requiring elements/attributes, but it's not widely adopted yet.) (XSD 1.1通过xs:assertion提供了一些附加的表现力,用于有条件地要求元素/属性,但尚未得到广泛采用。)

Note that bullet_point1 does not appear in any of the XSDs or documentation you've linked to your question. 请注意,您链接到问题的任何XSD或文档中均未显示bullet_point1 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. 如果bullet_point1来源于BulletPoint的XSD,那么它显然是多数民众赞成作出额外的要求并发出错误时,它的未满足的下游应用。

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. 类别的xsd没有正确更新,因此某些元素是必需的,但未反映在问题所在的.xsd文档中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM