[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Need explanation on why I need a DTD

Posted on 2000-05-06
3
Medium Priority
?
185 Views
Last Modified: 2013-11-19
Can someone explain to me the advantages of using a DTD (Document Type Declaration)?
Do I need to go back to all of my old web pages and add this?
What is it supposed to do FOR my web pages or TO the web browser?
What happens if I don't have one?
Which numeric version should I use?
When I try to verify HTML at web sites, I am frequently told that the web page has problems even though it works, why?
0
Comment
Question by:sduell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
shlomoy earned 200 total points
ID: 2785214
A document type definition (DTD) is a specific definition that follows the rules of the Standard Generalized Markup Language (SGML), and in your case, of XML. A DTD is a specification that accompanies a document and identifies what the funny little codes (or
markup) are that separate paragraphs, identify topic headings, and so forth and how each is to be processed. By mailing a DTD with a document, any location that has a DTD "reader" (or "SGML compiler") will be able to process the document and display or print it as intended. This means that a single standard SGML compiler can serve many different kinds of documents that use a range of different markup codes and
related meanings. The compiler looks at the DTD and then prints or displays the document accordingly.

As a matter of fact, the document you are looking at is coded in a particular DTD called HTML.
In this case, the "compiler" or document handler is your Web browser which is designed to handle text documents encoded with HTML tags. (Other programs could be developed that would handle HTML and other DTDs as well.)

IBM and many large and small corporations are converting documents to SGML, each with its own company document type definition or set of definitions. For corporate intranets and extranets, the document type definition of HTML provides one new "language" that everyone can format documents in and read universally.

---------------------------------------

And now, to your questions:

In case you use HTML, no you don't really need a DTD.

In case you use XML, You probably do.

The DTD tells the probram which parses your document (a browser, for example) how to understand the code (HTML for example).

In case you don't have a DTD, you count on the parser on the user's side to be able to "guess" the DTD you use. In the case of HTML, all browsers know to guess that your HTML pages use the HTML DTD. In case you use other type of XML, the guessing wouldn't probably be good.

The numeric version of the DTD really depends on the type of code you write. in case HTML is involved, version 3.2 or 4.0 are the latest.
An example of a DTD decleration for using HTML 3.2:
<!doctype html public "-//W3C//DTD HTML 3.2//EN">

Most browsers tend to understand even BADLY WRITTEN HTML documents.
Reason is, HTML doesn't have really to be "by the rules" (according to the DTD), and browsers do a rather good job, understanding even bad HTML files.
Hopefully, using HTML 4.0 and newver versions of HTML, using a DTD decleration would be a must, hence forcing people to write VALID HTML DOCUMENTS.

I hope this answers all your questions.
0
 
LVL 2

Author Comment

by:sduell
ID: 2785399
Thank you.
0
 
LVL 8

Expert Comment

by:shlomoy
ID: 2785415
You are welcome
0

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question