Project Index | Documentation | Relax NG | Sample XML File
A <catalog> consists of a
<company> element followed by one
or more <department> elements.
A <company> element contains plain text.
A <department> contains one or more
<item> elements. It must have a
name attribute and a unique code
attribute.
A color specification is either a single
<color> element
(for those items that come in only one color), or
a <color-list>
(for items that come in multiple colors),
or an <sku> element
(for items that have no color). These
are further defined as:
The <color-list>
element contains one or more <color>
elements.
We define a
color specification as either a single
<color> element
(for those items that come in only one color), or
a <color-list>
(for items that come in multiple colors),
or an <sku> element
(for items that have no color).
The reason that we have this strange setup for colors, color-lists, and SKUs is that every item in the catalog must have an SKU (which stands for Stock Keeping Unit, and is an inventory code). Here are the cases that these elements cover:
An item doesn't have a color (e.g., "Diet Soda 12-pack") In that case,
it needs an <sku> element to keep track of inventory.
An item comes in only one color (e.g., a whiteboard). It will have
one <color> element, and that element has a required
sku attribute to keep track of the inventory for that
item. The hex attribute is optional, and is used only if
its color happens to be representable as a color code like you find in
HTML (#ffca03, etc.)
An item comes in many colors (for example,
ballpoint pens). You now need a
<color-list> which has individual
<color> elements. Each of them has a different
sku attribute, so that we can keep track of how many blue
pens we've sold vs. black pens vs. red pens. Each one also has an
optional hex attribute in case its color happens to be
representable as an HTML color code.
The <summary> and
<description> elements may contain a subset
of HTML as follows:
First, we define inline elements as the
<em> and <strong> elements,
which may contain text and other inline elements. Given that
definition, the <summary> and
<description> elements may contain:
Text with inline elements
The <p> (paragraph) element, which may
contain text with inline elements.
The <ul> element, which contains
<li> elements.
Each <li> element may contain text
with inline elements and
<p> (paragraphs).
You may nest <ul> elements
within an <li>.