< Understanding the different parts of xml dtd with a sample xml DTD

 

Understanding the different parts of XML dtd with a sample XML DTD

You can easily understand the different parts of an XML DTD with a sample DTD document. Consider the following sample code in a DTD file.

_______________________________________________


_______________________________________________

<!ELEMENT books ( book+ ) >
<!ELEMENT book ( title, author+ ) >
<!ATTLIST book category NMTOKEN #REQUIRED >
<!ELEMENT title ( #PCDATA ) >
<!ELEMENT author ( #PCDATA ) >

The ELEMENT keyword indicates that an element is defined in the document. The word that follows the keyword is the name of the element.

After the element the child nodes of that element are given in brackets. A plus sign by the side of the child node indicates that there could be one or more child nodes of that name.

There are different notations to define different patterns like '?' and '*' after the name of the child node.

The attributes of an element is defined using the keyword ATTLIST. If that particular attribute is always required you will be using the keyword #REQUIRED.

The NMTOKEN in the above examples indicates the type of data that the attribute holds. An NMTOKEN can hold letters, point, digits, hyphen, underline and colon. The word #PCDATA indicates that the node can have text data that is parsed by the parser.



FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

_______________________________________

Recommended XML Books

cover
cover
cover
cover
cover
cover


 

FREE Subscription

Stay Current With the Latest Technology Developments Realted to XML. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.

 

 

Add to My Yahoo!


New XML Books Titles - Best Seller's @ Amazon.com

Visit XML Training Material Guide Homepage

Technology helps engage students - how do classroom instruction and social dynamics change when the classroom is completely dependant on modern technology?

Dallas Web Design- local Dallas web design firm offers site design and backend system development