Skip to content

Feed v1 (deprecated)

Availability

As DTD: http://openmensa.org/open-mensa-v1.dtd

As XML Schema (preferred): http://openmensa.org/open-mensa-v1.xsd

Note: the DTD will be abandoned as of Feed v2 so we advice you to switch to the XML schema as early as possible!

Example

<?xml version="1.0" encoding="UTF-8"?>
<cafeteria version="1.0"
           xmlns="http://openmensa.org/open-mensa-v1"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://openmensa.org/open-mensa-v1 http://openmensa.org/open-mensa-v1.xsd">
  <day date="2012-05-29">
    <category name="Essen 1">
      <meal>
        <name>Rührei mit Rahmspinat und Salzkartoffeln</name>
        <note>ovo-lacto-vegetabil</note>
        <price>1.20</price>
      </meal>
    </category>
    <category name="Essen 2">
      <meal>
        <name>Hähnchengeschnetzeltes mit exotischen Früchten, dazu Bio-Reis und Mischsalat</name>
        <note>mit Geflügelfleisch</note>
        <price>2.00</price>
      </meal>
    </category>
    <category name="Alternativ-Angebot">
      <meal>
        <name>Gemüse-Couscouspfanne mit Joghurt-Ingwer-Dip, dazu bunter Blattsalat</name>
        <note>ovo-lacto-vegetabil</note>
        <note>mensaVital</note>
        <price>2.50</price>
      </meal>
    </category>
    <!-- more categories... -->
  </day>
  <!-- more days... -->
</cafeteria>

Validation

If you build your feed’s xml carefully (simply copy the first 5 lines from our example, all the XML and schema foo will be done automatically for you), you may upload it to a XML validator that recognizes XML schemas to check for validity.

Description

This feed format is designed to serve meal data for a single canteen in a single feed. So to serve multiple canteens you need multiple feeds. The cafeteria root element has a version attribute with value 1.0.

The meals are grouped by day (having a date attribute as YYYY-MM-DD) and by categories (having a name attribute).

We introduced categories to allow meal grouping/classification based on e.g. some product line or desk as most canteens do.

Meals

All properties associated with a meal are realized as sub-elements as there are:

  • a name
  • (zero or more) notes
  • (zero or more) prices (in €)

The name of a meal, e.g. “Rinderhacksteak mit Kartoffeln”. Shouldn’t be more than a couple of words or a sentence in maximum.

Additional text may go into several notes: A note often resembles a properties of the associated meal like the ingredients used or some important annotations.

One drawback is that you, in case of multiple prices, cannot specify for which group of people a price is valid. That is fixed in v2.