Understanding the DTD XML examples

Knowing the different components of a DTD file would help you to understand the concepts of DTD and XML very well. Consider the DTD example given below.


_______________________________________________

<!ELEMENT books (book+) >
<!ELEMENT book (title, author+) >
<!ELEMENT title (#PCDATA) >
<!ELEMENT author (#PCDATA) >

The ELEMENT keyword is used to define an element in the DTD file. The word next to the ELMENT keyword is the name of the element that will be present in the XML file. After the element name some text will be available in the brackets. These are the names of the child nodes of that element.

The different child nodes are separated by a comma. A plus sign after the node name indicates that it can be present one or more times within that element. Similarly sign like '?' and '*' are also used in it. Data types defined in the DTD are PCDATA and CDATA.

A DTD can be embedded within an XML file or it can be separate in an external file.




_______________________________________________

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.

_______________________________________








 

 

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!

Visit XML Training Material Guide Homepage

 

 

Copyright - © 2004 - 2017 - All Rights Reserved.