users@jaxb.java.net

Re: Relational Data in XML?

From: Wiedmann, Jochen <jochen.wiedmann_at_softwareag.com>
Date: Sun, 09 Feb 2003 16:26:12 +0100

> Customer makes many orders, each order is for one customer.
> An order may contain many line-orders, each line-order is
> part of one order
> only.
> Each line order is for one part only, each part may be
> included in many
> line-orders.

This is my personal classical example when to normalize
XML data and when to avoid normalization.

The entities "customer" and "order" are interesting
items without any context. For example, you may at some
time create a mail to all of your customers and at that
point you'll like to have a single entry. Likewise, the
order is something that is of importance when to update
availability data. In other words: Make "customer" and
"order" separate XML documents. Let them have a unique
ID and link that together, as you would do in a relational
database.

However, the line-orders are another matter. Most probably
you are happy having them in one place and never use them
separate from any context. In other words, make them part
of the "order" document.


Jochen