Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

what is dtd in xml?

2 Answer(s) Available
Answer # 1 #

An XML document with correct syntax is called "Well Formed".

An XML document validated against a DTD is both "Well Formed" and "Valid".

DTD stands for Document Type Definition.

A DTD defines the structure and the legal elements and attributes of an XML document.

A "Valid" XML document is "Well Formed", as well as it conforms to the rules of a DTD:

The DOCTYPE declaration above contains a reference to a DTD file. The content of the DTD file is shown and explained below.

The purpose of a DTD is to define the structure and the legal elements and attributes of an XML document:

The DTD above is interpreted like this:

A DOCTYPE declaration can also be used to define special characters or strings, used in the document:

With a DTD, independent groups of people can agree to use a standard DTD for interchanging data.

With a DTD, you can verify that the data you receive from the outside world is valid.

You can also use a DTD to verify your own data.

If you want to study DTD, please read our DTD Tutorial.

XML does not require a DTD.

When you are experimenting with XML, or when you are working with small XML files, creating DTDs may be a waste of time.

If you develop applications, wait until the specification is stable before you add a DTD. Otherwise, your software might stop working because of validation errors.

[1]
Edit
Query
Report
Aldous Ponti
Botanist
Answer # 2 #

An XML document with correct syntax is called "Well Formed".

An XML document validated against a DTD is both "Well Formed" and "Valid".

DTD stands for Document Type Definition.

A DTD defines the structure and the legal elements and attributes of an XML document.

A "Valid" XML document is "Well Formed", as well as it conforms to the rules of a DTD:

The DOCTYPE declaration above contains a reference to a DTD file. The content of the DTD file is shown and explained below.

The purpose of a DTD is to define the structure and the legal elements and attributes of an XML document:

The DTD above is interpreted like this:

A DOCTYPE declaration can also be used to define special characters or strings, used in the document:

With a DTD, independent groups of people can agree to use a standard DTD for interchanging data.

With a DTD, you can verify that the data you receive from the outside world is valid.

You can also use a DTD to verify your own data.

If you want to study DTD, please read our DTD Tutorial.

XML does not require a DTD.

When you are experimenting with XML, or when you are working with small XML files, creating DTDs may be a waste of time.

If you develop applications, wait until the specification is stable before you add a DTD. Otherwise, your software might stop working because of validation errors.

[1]
Edit
Query
Report
Shan Sermet
Hiwi – A German Abbreviation For "Assistant Scientist"