About XML DTD and its various components

The DTD is a building block of an XML document. It defines a list of legal documents for the document structure. A DTD can be specified either externally or internally in a document.

With the help of a DTD each of your XML files can carry information in their own format. A standard DTD can be used to verify whether the data you receive from outside is valid or not. A DTD can be declared either internally or externally. The following are the simple building blocks of XML:

_______________________________________________


_______________________________________________

* Tags
* Elements
* Entities
* Attributes
* CDDATA
* PCDATA

TAGS:

These are used to markup elements. These are used for formatting codes. This indicates how a document will appear when displayed.
Example:

<Wish>
<To>John</to>
<From>Jill</From>
<Heading>Reminder</Heading>
<Body>HAPPY BIRTHDAY</Body>
</Wish>
In the above example the term “wish” is the tag.

ELEMENTS:

These are the main building blocks of XML documents. Elements can contain text or they can be empty

Example:

<Wish>
<To>John</To>
<From>Jill</From>
<Heading>Reminder</Heading>
<Body>HAPPY BIRTHDAY</Body>
</Wish>

In the above example the terms <to>, <from>, <body> are the elements.

ENTITIES:

They are variables to define common text.

A few of the predefined entities in XML are as follows:

Entity References
Character
&gt;
>
&lt;
<
&quot;
&amp;
&
&apos;
'

ATTRIBUTES:

They provide extra information about elements.
Example:

<Img src="computer.gif" />

In the above example the Img provides more information about the image by specifying source of the image using the attribute “src”.

CDATA:

Cdata means Character Data. It is a text that will not be parsed by the parser. The text inside these tags is not treated as markups and the entities will not be expanded.

PCDATA:

PcData denotes “Parsed Character Data”. PcData is the text parsed by the parser. The text inside these tags is treated as markups and the entities will be expanded.



_______________________________________________


_______________________________________________

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




Top XML News

JSF 2.0 Views: Hello Facelets, Goodbye JSP (Developer.com)
JavaServer Faces (JSF) is a Java component UI framework for building dynamic pages for a web application. JSF technology provides an API for creating, managing, and handling UI components and a tag library for using components within a web page.





Resource List

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?

Cisco CCNA Certification Video Tutorial Guide - Learn How to Pass the Cisco CCNA 640-802 Exam... Guaranteed!

Train Signal Computer Training