Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

XML DTDs

Valid XML documents follow a set of rules defined in a associated DTD. This Document Type Definition defines elements, attributes, and relationships between elements.


advertisement

alid XML documents follow a set of rules defined in a associated DTD. This Document Type Definition defines elements, attributes, and relationships between elements.

DTDs are saved in an ascii text file with the extension .dtd, like this:

mypage.dtd



When your XML document is processed, it is compared to its associated DTD to be sure it is structured correctly and all tags are used in the proper manner. This comparison process is called validation and is is performed by a tool called a parser.

Remember, you don't need to have a DTD to create an XML document; you only need a DTD for a valid XML document.

Before You Begin
There are a handful of terms you'll be hearing as you work with an XML DTD. Take a couple of minutes to become familiar with them before you begin. Click on any of the terms to see its definition.

Schema DTD
Document Tree Root Element
Parent Element Child Element
Parser

DTD Contents
A DTD is a way to ensure that an XML document uses elements correctly. It contains a set of rules. When your XML document is processed, it is compared to its associated DTD to be sure it is structured correctly and all tags are used in the proper manner.

A DTD:

  • Always contains rules that define elements.
  • Always contains rules that define the relationship between elements.
  • May contain rules that define attributes for elements, althought not all elements have attributes.
  • May contain rules that define entities.
  • May may contain rules that define notations.




Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date