Nutrtionmaps v0.2 XML format - Restaurant Protocol
Jump to:
XML tag definitions
Entity escaping
This document describes the XML schema for the Nutrtionmap protocol.
The Nutritionmap protocol format consists of XML tags. All data values in a Nutritionmap must be entity-escaped. The file itself must be UTF-8 encoded.
The Nutritionmap must:
- Begin with an opening
<nutritionmap>
tag and end with a closing</nutritionmap>
tag. - Specify the name of the restaurant (protocol standard) within the
<restaurant>
tag. - Include at least one
<item>
entry for the menu tag. - Include at least one child entry for each
<nutrition>
parent tag.
All other tags are optional. However, we encourage you to provide as much nutritional information as possible to make your map as useful as it can be.
All URLs inside of a Nutritionmap must be from one domain. I.E. www.examplesite.com or menu.examplesite.com but not both.
Sample XML Nutritionmaps
Click here to see a sample Nutritionmap for a restaurant with one menu item that includes pricing, nutrition information and ingredients.
XML tag definitions
The available XML tags are described below.
Attribute | Description | |
---|---|---|
<nutritionmap>
|
required |
Encapsulates the file and references the current protocol standard. |
<restaurant>
|
required |
Parent tag for the restaurants information |
<menu>
|
required |
Parent tag for the restaurant's menu. |
<menuitem>
|
required |
The parent tag for each menu item and meal. |
<nutrition>
|
required |
The parent tag for the nutrition information |
<ingredients>
|
optional |
The parent tag for ingredients in a menu item. |
<name>
|
optional |
A child tag that when used under the parent When used under the parent |
<nation>
|
optional |
The nation where the restaurant is located. Since many international brands have different nutritional values and ingredients for their products around the world this allows a map to identify which nation it is for. |
<type>
|
required |
A child tag that denotes the type of restaurant. There are only 4 options for this field
Used only under the restaurant parent tag. |
<loc>
|
required* |
A child tag that when used under the restaurant parent tag is the restaurant's main website URL. When used under the menuitem tag is the URL to the specific menuitem. * = only required for the restaurant parent tag |
<price>
|
optional |
The price of a menu item. |
<itemid>
|
required |
The unique i.d. number of a menu item. numeric i.d. only. this must be unique to the food item and never change as databases will use it for reference in applications |
<currency>
|
optional |
The currency code for the menu item's price You can get a list of currency codes here: currency code list |
<itemtype>
|
optional |
The type of menu item. This is an open ended field. Common types include:
|
<calories>
|
optional |
A child tag to the required nutrition tag. This says how many calories are in a menu item. |
<fat>
|
optional |
A child tag to the required nutrition tag. This says how much fat is in a menu item. Measured in grams (g) |
<satfat>
|
optional |
A child tag to the required nutrition tag. This says how much saturated fat is in a menu item. Measured in grams (g) |
<transfat>
|
optional |
A child tag to the required nutrition tag. This says how much trans fat is in a menu item. Measured in grams (g) |
<calfat>
|
optional |
A child tag to the required nutrition tag. This says how many calories come from fat in a menu item. |
<cholesterol>
|
optional |
A child tag to the required nutrition tag. This says how much cholesterol is in a menu item. Measured in milligrams (mg) |
<sodium>
|
optional |
A child tag to the required nutrition tag. This says how much sodium is in a menu item. Measured in milligrams (mg) |
<carbs>
|
optional |
A child tag to the required nutrition tag. This says how many carbohydrates are in a menu item. Measured in grams (g) |
<fiber>
|
optional |
A child tag to the required nutrition tag. This says how much fiber is in a menu item. Measured in grams (g) |
<sugar>
|
optional |
A child tag to the required nutrition tag. This says how much sugar is in a menu item. Measured in grams (g) |
<protein>
|
optional |
A child tag to the required nutrition tag. This says how much protein is in a menu item. Measured in grams (g) |
<meat>
|
optional |
A child tag to the optional ingredients tag. This says what kind of meat(s) is included. Use a new tag for each different type of meat in a menu item. |
<vegetable>
|
optional |
A child tag to the optional ingredients tag. This says what kind of vegetable(s) is included. Use a new tag for each different vegetable in a menu item. |
<bread>
|
optional |
A child tag to the optional ingredients tag. This says what kind of bread(s) is included. Use a new tag for each different bread in a menu item. |
<vegan>
|
optional |
a Yes/No field. states if a menu item is vegan friendly |
<vegetarian>
|
optional |
a Yes/No field. states if a menu item is vegetarian friendly |
<portionsize>
|
optional |
the portion size per serving of the item, in restaurant maps the serving size is always considered to be 1. this field is numerical only |
<portionmeas>
|
optional |
the measurement of the portion. foods are typically measured in length, mass or fluid capacity. this can be imperial, metric, or SI measurements. Use abbreviations only (listed below).
|
Entity escaping
It is required that your Nutritionmap file be UTF-8 encoded.
Just like any other XML file, all of your data values must use entity escape codes for the following characters: Ampersand, Quotes, Double Quotes, Greater Than, Less Than. This includes URLs
Last Updated: 12 May 2012
Nutritionmaps.org is the sole copyright and ownership of creator Joe Youngblood. To reach out about licensing the language for usage in your commercial food manufacturing, fresh food preparation, restaurant food preparation, or other food or nutrition application please CLICK HERE TO GET IN TOUCH