BeerXML
Description
BeerXML is a free, fully defined XML data description standard designed for the exchange of beer brewing recipes and other brewing data. Tables of recipes as well as other records such as hop schedules and malt bills can be represented using BeerXML for use by brewing software.
Optional tags
The optional 'Appendix A' adds tags for use in the display of brewing data using XML stylesheets or XML compatible report generators. As the tags in the appendix are for display only and may include rounded values and varying units. These appendix tags are intended for display and not for data import.
Special Characters
The exporting and importing applications should recognise and translate the XML special character codes if they appear in any of the data strings. Common examples include:
Character | XML |
---|---|
& | & |
< | < |
> | > |
“ | " |
‘ | ' |
XML Header
As per the XML standard, all files should begin with the following header line as the first line. After the XML header a record set should start (for example <RECIPES>…</RECIPES> or <HOPS> … </HOPS>).
Required XML Header Example with Recipes tag:
<?xml version="1.0" encoding="ISO-8859-1"?> <RECIPES>
…
</RECIPES>
Tag Names
Tag names are always uppercase. For example "HOP" is acceptable, but "hop" and Hop" are not.
Version
All records have a required <VERSION> tag that denotes the version of the XML standard. At present, all are set to the integer 1 for this version of the standard. It is intended that future versions of the standard will be backward compatible with older versions, but the VERSION tag allows newer programmes to check for a higher version of the standard or do conversions if required to be backward compatible.
Non-Standard Tags
As per the XML standard, all non-standard tags should be ignored by the importing programme. This allows programmes to store additional information if desired using their own tags. Any tags not defined as part of this standard may safely be ignored by the importing programme.
Data Formats
- Record Set – A special tag that starts a particular set of data. For example an XML table that consists of a set of hops records might start with a <HOPS> tag to denote that this is the start of hops records. After the last record, a </HOPS> tag would be used.
- Record - Denotes a tag that starts or ends a particular record -- for example "HOP" might start a hops record or "FERMENTABLE" might start a fermentable record.
- Percentage - Denotes a percentage - all percentages are expressed as percent out of 100- for example 10.4% is written as "10.4" and not "0.104"
- List - The data has only a fixed number of values that are selected from the list in the description table for the tag. These items are case sensitive, and no other values are allowed.
- Text - The data is free format text. For multiline entries, line breaks will be preserved where possible and the text may be truncated on import if the text is too long for the importing program to store. Multiline entries may be split with either a newline (Unix format) or a carriage return – newline combination (DOS format). Importing programs should accept either.
- Boolean - May be either TRUE or FALSE, with TRUE and FALSE in capitals. A default value should be specified for optional fields - the default is used if the value is not present.
- Integer - An integer number with no decimal point. May include negative values - examples include ...-3, -2, -1, 0, 1, 2, 3,...
- Floating Point - A floating point number, usually expressed in its simplest form with a decimal point as in "1.2", "0.004", etc... Programs shall endeavor to store as many significant digits as possible to avoid truncating or losing small values.
Units
For this portion of the standard all units are fixed. It is the responsibility of the importing or exporting programme to convert to and from the units below if needed.
- Weight Units
All weights are measured in Kilograms (kg). For small values the exporting programme will make an effort to preserve as many significant digits as possible.
- Volume Units
All volumes will be measured in Litres (l). For small values the exporting programme will make an effort to preserve as many significant digits as possible.
- Temperature Units
All temperatures will be measured in degrees Celsius.
- Time Units
All times will be in minutes or fractions thereof – unless otherwise specified in the tag description.
- Specific Gravity Units
Specific Gravity will be measured relative to the weight of the same size sample of water. For example “1.035”, “1.060”, and so on.
- Pressure Units
Pressures will be measured in kilopascals (kPa)