Sign in

Google Base Help



Custom attributes in XML data feeds

Print

The XML Namespace is a module that Google Base providers can use to define their own elements (custom attributes) for the purposes of describing their items in extended detail in an XML data feed. For tab-delimited formats, please see the Custom Attributes topic for more information on creating custom attributes for that format.

Namespace Declaration

xmlns:[prefix]="http://base.google.com/cns/1.0"

Google Base providers have the option of creating their own prefixes, but we recommend using "c:". The "g:" prefix is reserved for the Google Base XML module and shouldn't be used. Also, prefixes beginning with the three-letter sequence x m l, in any case combination, aren't acceptable.

Format

The format of a custom element is as follows:

<[prefix]:[attribute_name] type="[content_type]">[value]</[prefix]:[attribute_name]>

Where:

  • [prefix] = name of the prefix you're using for your namespace
  • [attribute_name] = name of the custom attribute
  • [content_type] = content type of the custom attribute
  • [value] = value of the custom attribute

The following content types are supported.

Type Description Example XML Tag Example Value
string Any text string. <c:favorite_movie type="string"> Total Recall
int Whole number value. <c:revenue type="int"> 32000000
float Number with a decimal point. <c:engine_displacement type="float"> 3.5
intUnit Whole number value and a string. <c:revenue type="intUnit"> 32000000 dollars
floatUnit Number with a decimal point and a string. <c:engine_displacement type="floatUnit"> 3.5 Liters
dateTime Date and time, in ISO 8601 format: YYYY-MM-DDThh:mm:ss. (Times are based on the 24-hour clock.) Note: all dates and times are in PDT (GMT -7).
<c:birth_date type="dateTime"> 1979-10-12T03:44:26
dateTimeRange Start and end dates, in ISO 8601 format: YYYY-MM-DDThh:mm:ss. (Times are based on the 24-hour clock.) An attribute of this type will contain two sub-attributes, <g:start> and <g:end>. Note: all dates and times are in PDT (GMT -7). <c:dates_employed type="dateTimeRange"> <g:start>2004-03-20T09:00:00</g:start>
<g:end>2006-03-10T17:00:00</g:end>
location Location value. Addresses should be formatted as: street, city, state, postal code, country. Each location element should be separated by a comma. <c:interview_location type="location"> 1600 Amphitheatre Parkway, Mountain View, CA, 94043, USA
url HTTP URL. <c:favorite_search_engine type="url"> http://www.google.com
boolean Value may be either true or false. <c:promo_offer type="boolean"> true
Was this information helpful?

Tell us how we're doing: Please answer a few questions about your experience to help us improve our Help Center.