Nesting elements

by Mark Stradling <mark.stradling(at)blueberry.net>

 Date:  Fri, 4 Aug 2000 16:55:32 +0100
 To:  "HWG XML List (E-mail)" <hwg-xml(at)mail.hwg.org>
  todo: View Thread, Original
Hi all,
First post to the list, I just hope it's not too obvious a question...

I'm trying to build a DTD for passing order information to a web site
partner and have some questions about their proposed XML format.

They have a top level order element which can contain one or more product
elements, along with invoice and delivery addresses.

The product if a photograph and so could (optionally) have a frame, etc.

Now the other developer I'm dealing with has proposed that all 'items' are
products (so a photo is a product, a frame is a product, the nail to hang it
on is a product, etc).

Can I define an element called product which can include other instances of
itself?

<!ELEMENT product (description, quantity, price, product)>

So I end up with XML like...
<order>
    <product type="photo">
        <description>A photograph</description>
        <product type="frame">
            <description>A metal frame</description>
        </product>
    </product>
</order>

Can I do this and do I need to do anything special when defining the product
element?

With thanks,

____________________________
Mark Stradling
Cold Fusion Developer

Blueberry.Net
Creating Fruitful eBusiness
www.blueberry.net
____________________________

This message and its contents are strictly confidential.
It is intended for the named recipient(s) only and should
not be copied, distributed or relied upon by those for whom it
is not intended. Blueberry.Net holds no responsibility for the
information contained in this message as the opinion stated is
that of the sender unless clearly stated otherwise.
 
Blueberry and the Blueberry logo are registered
trade marks of Blueberry.Net Limited.

HWG hwg-xml mailing list archives, maintained by Webmasters