eWebProgrammer
Distributednetworks GofPatterns
prev prev
Course navigation
A checklist for creating DTDs
The mechanics of creating a DTD
  1. create DTD Mechanism
  2. In this Simulation, we will go through the steps needed to create an internal DTD for XML document shown here.
    The inventory item "XML document" should describe at least one inventory item.
    Each inventory item has <ITEM-NAME>, <ITEM-SERIAL-NUMBER>, and <QUANTITY-ON-HAND> -element that must be present in that order.
    Each one of the item elements may only contain parsed character data. Click Next to proceed to the next step.
    Inventory Iterms
  3. To begin, you will define a document type declaration that specifies <INVENTORY-ITEMS> as the root element.
    Type <!DOCTYPE INVENTORY-ITEMS [ and press Enter.

    Doc Type and Elements
  4. The root element should contain at least one inventory <ITEM> element. Use the DTD symbol + to indicate one or more elements. Type <!ELEMENT INVENTORY-ITEMS (ITEM)+> and press Enter.
    prev
  5. An <ITEM> should contain <ITEM-NAME>, <ITEM-SERIAL-NUMBER>, and <QUANTITY--ON-HAND>, in that order. Type <!ELEMENT ITEM (ITEM-NAME,ITEM-SERIAL-NUMBER,QUANTITY-ON-HAND)> and press Enter.

    prev
  6. <ITEM-NAME> should contain only parsed character data. Type <!ELEMENT ITEM-NAME (#PCDATA)> and press Enter.

    prev
  7. <ITEM-SERIAL-NUMBER> should contain only parsed character data. Type <!ELEMENT ITEM-SERIAL-NUMBER (#PCDATA)> and press Enter.

    prev
  8. <QUANTITY-ON-HAND> should contain only parsed character data. Type <!ELEMENT QUANTITY-ON-HAND (#PCDATA)> and press Enter.

    prev
  9. Complete the <!DOCTYPE> declaration by typing ]> and press Enter.
  10. This completes the Simulation. Click the Exit button.
Course navigation