DTD - Is it the right way?

suresh at niitblvl.niit.co.in suresh at niitblvl.niit.co.in
Mon Jul 5 07:14:49 BST 1999


I am a starter at XML. Below is a DTD I have written for Contacts. I have   
used a tool called as XML Spy. I have a few questions
1. Is this is the right way of writing a DTD?
2. The tool said that the DTD was valid, but I cant open it in IE5.

Suresh Yellamaraju

<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT Contacts (Contact)*>
<!ELEMENT Contact ((Person | Company)?,  Notes?)>
<!ELEMENT Person (FullName, Company?, Title?, Department?, Office?,   
Profession?, AssistantName?, ManagerName?, NickName?, Birthday?,   
PersonalEMail?, Mobile?, Pager?, PersonalTelNo?, PersonalAddress?)>
<!ELEMENT FullName ((FirstName, MiddleInitials?, LastName) | (LastName,   
MiddleInitials?, FirstName) | (LastName, FirstName, MiddleInitials?) |   
(FirstName, LastName, MiddleInitials?))>
<!ELEMENT Company (CompanyName, Address*, TelNo*, EMailAddress*)>
<!ELEMENT Address (AddressType, Streets?, City?, State?, PinCode?,   
Country?)>
<!ELEMENT AddressType EMPTY>
<!ATTLIST AddressType AddrType (Home| Business| Other) "Business">
<!ELEMENT Streets (Street1?,Street2?,Street3?)>
<!ELEMENT Street1 (#PCDATA)>
<!ELEMENT Street2 (#PCDATA)>
<!ELEMENT Street3 (#PCDATA)>
<!ELEMENT City (#PCDATA)>
<!ELEMENT State (#PCDATA)>
<!ELEMENT PinCode (#PCDATA)>
<!ELEMENT Country (#PCDATA)>
<!ELEMENT FirstName (#PCDATA)>
<!ELEMENT MiddleInitials (#PCDATA)>
<!ELEMENT LastName (#PCDATA)>
<!ELEMENT CompanyName (#PCDATA)>
<!ELEMENT Title (#PCDATA)>
<!ELEMENT Department (#PCDATA)>
<!ELEMENT Office (#PCDATA)>
<!ELEMENT Profession (#PCDATA)>
<!ELEMENT AssistantName ((FullName | SimpleName)?, NickName)>
<!ELEMENT ManagerName ((FullName | SimpleName)?, NickName)>
<!ELEMENT SimpleName (#PCDATA)>
<!ELEMENT NickName (#PCDATA)>
<!ELEMENT BirthDay (#PCDATA)>
<!ELEMENT Notes (#PCDATA)>
<!ELEMENT PersonalEMail (#PCDATA)>
<!ELEMENT Mobile (#PCDATA)>
<!ELEMENT Pager (#PCDATA)>
<!ELEMENT PersonalTelNo (#PCDATA)>
<!ELEMENT TelNo (#PCDATA)>
<!ELEMENT EMailAddress (#PCDATA)>
<!ELEMENT PersonalAddress (Address)>

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list