[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Help creating DTD

  • To: 'Karl Stubsjoen' <karl@e...>, Xml-Dev <xml-dev@l...>
  • Subject: RE: Help creating DTD
  • From: "CHIUSANO, Joseph" <JCHIUSANO@l...>
  • Date: Tue, 9 Jul 2002 18:17:37 -0400
  • Return-receipt-to: "CHIUSANO, Joseph" <JCHIUSANO@l...>

creating a dtd
Title: RE: Help creating DTD

Another possibility In terms of the structure would be to group the items together separately from the Orders, and reference each item to its corresponding order using an IDREF-type attribute.  So instead of the XML document structure being as follows:

  <?xml version="1.0" encoding="UTF-8" ?>
- <ORDER>
        <UID>DSM/RSM USER NAME</UID>
        <DEALER>21</DEALER>
- <ORDERS>
        <ITEM id="0116602800">7</ITEM>
        <ITEM id="1106500706">8</ITEM>
        <ITEM id="1106502706">9</ITEM>
        <ITEM id="1106700706">5</ITEM>
        <ITEM id="1106702706">7</ITEM>
        <ITEM id="0100102883">3</ITEM>
        <ITEM id="0100100805">333</ITEM>
        <ITEM id="0101000725">5</ITEM>
  </ORDERS>

It would be as follows:

  <?xml version="1.0" encoding="UTF-8" ?>
- <ORDERS>
     <ORDER orderID="123">     
        <UID>DSM/RSM USER NAME</UID>
        <DEALER>21</DEALER>
        ...additional order information here...
     </ORDER>  
     <ORDER>   
        ...order information here...
     </ORDER>  
  </ORDERS>
- <ITEMS>
        <ITEM itemID="0116602800" orderID="123">
           ...item information here...
        </ITEM>
        <ITEM itemID="1106500706" orderID="456">
           ...item information here...
        </ITEM>
  </ITEMS>

The "orderID" attributes above would be IDREF-type attributes.  In W3C Schema, the KEY/KEYREF constructs would be used instead of ID/IDREF-type attributes.

Regards,
Joe Chiusano
LMI

> **************************************************************************
>   Joseph M. Chiusano
>   Logistics Management Institute
>   2000 Corporate Ridge
>   McLean, VA 22102
>   Email: jchiusano@l...
>   Tel: 571.633.7722
> **************************************************************************
>


-----Original Message-----
From: Karl Stubsjoen [mailto:karl@e...]
Sent: Tuesday, July 09, 2002 4:44 PM
To: Xml-Dev
Subject: RE: Help creating DTD


Don't know if this makes a difference, but...
It is the value of the <ITEM /> node which must be numeric > 0
The property "id" of <ITEM /> can be anything (numerical or character).

Also - should I be creating a DTD or a Schema?

Karl

-----Original Message-----
From: Karl Stubsjoen [mailto:karl@e...]
Sent: Tuesday, July 09, 2002 1:19 PM
To: Xml-Dev
Subject: Help creating DTD


Hello,

I need help creating a DTD.  Actually, is it a DTD that I mean to create?  I
have an existing XML document, from this I need to create a *template*
(dtd?) which I can then use to validate future XML documents.

My XML document looks like this:

  <?xml version="1.0" encoding="UTF-8" ?>
- <ORDER>
        <UID>DSM/RSM USER NAME</UID>
        <DEALER>21</DEALER>
- <ORDERS>
        <ITEM id="0116602800">7</ITEM>
        <ITEM id="1106500706">8</ITEM>
        <ITEM id="1106502706">9</ITEM>
        <ITEM id="1106700706">5</ITEM>
        <ITEM id="1106702706">7</ITEM>
        <ITEM id="0100102883">3</ITEM>
        <ITEM id="0100100805">333</ITEM>
        <ITEM id="0101000725">5</ITEM>
  </ORDERS>
  </ORDER>

I'll try and describe the above:

<ORDER> can contain any number of child elements
<UID> must be included
<DEALER> must be included
<ORDERS> must be included

<ORDERS> can contain multiple ITEM(s) but restricted to just ITEM nodes
<ITEM> must have unique id property and the value of item must be numeric >
0

Thanks for the help!
*meanwhile I will give this a go myself!*

Karl


-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>



-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.