W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2002

re-using the same element at different levels?

From: Ron Alexander <Ralexander@musiciansfriend.com>
Date: Tue, 19 Nov 2002 12:42:50 -0800
Message-ID: <3DDAA24A.5050106@musiciansfriend.com>
To: xmlschema-dev@w3.org

Does xsd allow me to reuse an element? I need ShipInfo for an order and 
also for an individual item. Say we have an item that is on backorder, 
when it comes into stock we may ship it at a higher priority than the 
rest of the order was shipped at.

DTD:
<?xml version='1.0' encoding='UTF-8' ?>
<!ELEMENT OrderInfo (ItemList?, ShipInfo?)>
<!ATTLIST OrderInfo CustIdent CDATA #REQUIRED>
<!ELEMENT ItemList (Item+)>
<!ELEMENT Item (Product, ShipInfo?)>
<!ELEMENT Product CDATA #REQUIRED>
<!ELEMENT ShipInfo EMPTY>
<!ATTLIST ShipInfo Shipper CDATA #REQUIRED
                                            ShipMethod CDATA #REQUIRED
                                            ShipStatus (TO_BE_SHIPPED
                                                                | SHIPPED
                                                                | 
DELIVERED) #REQUIRED>


Thanks,
Ron Alexander
ralexander@musiciansfriend.com
Received on Tuesday, 19 November 2002 15:47:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:35 GMT