格式
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本部分介绍了 Feed 文件所用的数据格式。
NonEmptyString
类型为 NonEmptyString 的元素或属性包含 xs:string 类型的字符数据,但附加限制是字符数据必须包含至少一个非空白字符。
ID
类型为 Id 的元素或属性包含 xs:string 类型的字符数据,但还需满足以下限制:字符数据长度必须小于 256 个字符,且不得包含任何空格字符。
注意:我们允许使用 CharMatcher.javaLetterOrDigit() 和 "-._",因此任何其他字符都会导致 Feed 失败。
CollectionMethodType
CollectionMethodType 类型的元素必须是 xs:string 类型,并且还必须满足以下限制:只能是以下值之一:“unsolicited”“point_of_sale”或“after_fulfillment”。
CountryCode
CountryCode 类型的元素必须是 xs:string 类型,并且还必须符合以下限制:必须是采用 ISO 3166-1 alpha-2 格式的有效国家/地区代码。
DateTimeWithTimeZone
该值必须为 xs:dateTime 类型,格式由 ISO 8601 的 W3C 配置文件指定。时间后必须添加时区指示符。时区指示符可以是“Z”(表示 UTC),也可以采用“+hh:mm”或“-hh:mm”格式(表示与 UTC 的偏移量)。
示例
2016-04-03T18:37:32Z
2016-05-30T09:30:10-06:00
RatingRange
说明
RatingRange 类型的元素必须包含单个评分。此评分不应汇总自多个评分。请勿使用“0”或任何其他值来指定“无评分”。如果没有评分,则不应在 Feed 中显示相应的评分元素。
评分应采用 xs:decimal 格式,并且是必需字段。
属性
RatingRange 类型的元素具有以下两个属性。
示例
<overall min="1" max="10">9</overall>
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThis document outlines the various data formats required for the feed file, including strings, IDs, enumerations, country codes, date/time, and ratings.\u003c/p\u003e\n"],["\u003cp\u003eNonEmptyString, Id, CollectionMethodType, CountryCode, and DateTimeWithTimeZone elements have specific format and content restrictions detailed in this section.\u003c/p\u003e\n"],["\u003cp\u003eDateTimeWithTimeZone values must follow the W3C profile of ISO 8601, requiring a time zone designator.\u003c/p\u003e\n"],["\u003cp\u003eRatingRange elements should represent a single rating within a specified range, using decimal format and avoiding "0" for "no rating".\u003c/p\u003e\n"],["\u003cp\u003eRatingRange elements include 'min' and 'max' attributes to indicate the rating scale's boundaries.\u003c/p\u003e\n"]]],["The feed file utilizes specific data formats: `NonEmptyString` requires at least one non-whitespace character. `Id` must be under 256 characters and contain no whitespace, allowing letters, digits, and \"-._\". `CollectionMethodType` accepts \"unsolicited,\" \"point_of_sale,\" or \"after_fulfillment\". `CountryCode` must follow ISO 3166-1 alpha-2. `DateTimeWithTimeZone` adheres to the W3C ISO 8601 profile, needing a time zone designator. `RatingRange` requires an `xs:decimal` rating, with `min` and `max` attributes defining the scale.\n"],null,["# Formats\n\nThis section describes the data formats used for the feed file.\n\nNonEmptyString\n--------------\n\nAn element or attribute of type NonEmptyString contains character data of type\n[xs:string](https://www.w3.org/TR/xmlschema-2/#string) with the additional restriction\nthat the character data must have at least one non-whitespace character.\n\nId\n---\n\nAn element or attribute of type Id contains character data of type [xs:string](https://www.w3.org/TR/xmlschema-2/#string)\nwith the additional restrictions that the character data must be shorter than 256 characters and must not contain any whitespace characters.\n\nNOTE: We allow [CharMatcher.javaLetterOrDigit()](https://guava.dev/releases/21.0/api/docs/com/google/common/base/CharMatcher.html#javaLetterOrDigit--) and \"-._\" so anything other that that will fail the feed.\n\nCollectionMethodType\n--------------------\n\nAn element of type CollectionMethodType must be of type\n[xs:string](https://www.w3.org/TR/xmlschema-2/#string) with the additional restriction\nthat it can only be one of following values: \"unsolicited\", \"point_of_sale\" or \"after_fulfillment\".\n\nCountryCode\n-----------\n\nAn element of type CountryCode must be of type\n[xs:string](https://www.w3.org/TR/xmlschema-2/#string) with the additional restriction\nthat it must be a valid country code in [ISO 3166-1 alpha-2](https://www.iso.org/obp/ui/#search/code/) format.\n\nDateTimeWithTimeZone\n--------------------\n\nThe value must be of type [xs:dateTime](https://www.w3.org/TR/xmlschema-2/#dateTime) in the format specified by the\n[W3C profile of ISO 8601](https://www.w3.org/TR/NOTE-datetime). A time zone designator\nis required after the time. The time zone designator may be \"Z\" to indicate UTC or it may have\nthe format \"+hh:mm\" or \"-hh:mm\" to indicate an offset from UTC.\n\n### Examples\n\n```cbm-basic-v2\n2016-04-03T18:37:32Z\n2016-05-30T09:30:10-06:00\n```\n\nRatingRange\n-----------\n\n### Description\n\nElements of type RatingRange must contain a single rating. This rating should not be aggregated\nfrom multiple ratings. Do not use \"0\" or any other value to specify \"no rating\". If no rating is\navailable, then the particular rating element should not appear in the feed.\n\nThe rating should be in [xs:decimal](https://www.w3.org/TR/xmlschema-2/#decimal) format\nand is a required field.\n\n### Attributes\n\nElements of type RatingRange have the following two attributes.\n\n| Name | Format | Occurrences | Description |\n|-------|-------------------------------------------------------------------------------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `min` | [xs:nonNegativeInteger](http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger) | Required (1) | The minimum possible number for the rating. This should be the worst possible rating and should not be a value for \"no rating\". If your ratings scale starts from 1, please do not enter 0 for this attribute. |\n| `max` | [xs:nonNegativeInteger](http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger) | Required (1) | The maximum possible number for the rating. This should be the best possible rating. |\n\n### Example\n\n```text\n\u003coverall min=\"1\" max=\"10\"\u003e9\u003c/overall\u003e\n```"]]