DTD : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)
The JDisplay Java Applet displays the large program listings on this web page. JDisplay requires an up-to-date browser and Java version 1.8+, preferably 1.8.0_131. If you can’t see the listings, or if you just want to learn more about JDisplay, click  Help Use Firefox for best results.

DTD
DTD (Document Type Definition) A carefully structured document that formally defines the syntax of one of the HTML (Hypertext Markup Language) or XML (extensible Markup Language) variants using an BNF (Backus-Naur Form) variant notation. For some reason, the academics who define HTML, think this document, intended for computers, is the way ordinary humans should learn about HTML. A DTD is pretty well incomprehensible until you already fully understand HTML, or have a background in computer language theory.

You need a DTD statement, case-sensitive at the very top of each HTML document, even before the <html>, to tell with version of the HTML grammar you are using.

DTDs (Document Type Definitions) are also used with XML. In that case every file format you devise requires its own individually composed DTD to describe what fields are in it.

Here is how to read an DTD tag at the top of each HTML file.

<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN https://www.w3.org/TR/html4/loose.dtd>
DTD field Notes
HTML this is HTML, not XML
PUBLIC this is a public standard, not some DTD you cooked up yourself.
W3C (World Wide Web Consortium) who wrote the DTD
HTML 4.01 which version of HTML it supports.
transitional
  • Strict does not let you use features that may be phased out later.
  • Transitional is laxer.
  • Frameset is for when you use <frameset.
EN English
https://www.w3.org/TR/html4/loose.dtd url of the DTD computer-readable grammar
DTD Notes
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN
https://www.w3.org/TR/html4/strict.dtd>
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN
https://www.w3.org/TR/html401/strict.dtd
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
https://www.w3.org/TR/html4/loose.dtd>
This is what I use on my ordinary documents
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
https://www.w3.org/TR/html401/loose.dtd
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
https://www.w3.org/TR/REC-html40/loose.dtd
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Frameset//EN 
https://www.w3.org/TR/html4/frameset.dtd">
This is what I use on my frame defining pages
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Frameset//EN 
https://www.w3.org/TR/html401/frameset.dtd"> 
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0//EN
https://www.w3.org/TR/REC-html40/strict.dtd>
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
https://www.w3.org/TR/REC-html40/loose.dtd>
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0//EN
https://www.w3.org/TR/1998/REC-html40-19980424/strict.dtd>
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Frameset//EN
https://www.w3.org/TR/REC-html40/frameset.dtd>
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
This is what you might use for very clean HTML.
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Frameset//EN
https://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd>
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML Basic 1.0//EN
https://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd
<?xml version=1.0 encoding=UTF-8?>
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN
https://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd>
This is what you might use if you are preparing an eBook.
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML (extensible Hypertext Markup Language) +RDFa 1.0//EN
https://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd>
<!DOCTYPE wml PUBLIC -//WAPFORUM//DTD WML 1.1//EN
http://www.wapforum.org/DTD/wml_1.1.xml>
for WAP (Wireless Application Protocol) handheld devices
<!DOCTYPE wml PUBLIC -//WAPFORUM//DTD WML 1.2//EN
http://www.wapforum.org/DTD/wml12.dtd>
<!DOCTYPE wml PUBLIC -//WAPFORUM//DTD WML 1.3//EN
http://www.wapforum.org/DTD/wml13.dtd>
<!DOCTYPE html PUBLIC -//WAPFORUM//DTD WML 2.0//EN
http://www.wapforum.org/dtd/wml20.dtd>
<!DOCTYPE HTML>
<!DOCTYPE html> simplied for HTML5 (Hypertext Markup Language v 5)
<!DOCTYPE HTML SYSTEM about:legacy-compat>
<!DOCTYPE HTML SYSTEM 'about:legacy-compat'>
View a typical DTD definition of an HTML grammar.

Understanding a *.DTD

Here is a DTD that describes the grammar of Java Web Start JNLP (Java Network Launching Protocol) 6.0 file: view A *.DTD file, as opposed to a DOCTYPE that references a DTD at the top of a *.html file, describes the grammar of an html, jnlp or xml file. <!ELEMENT defines a tag and the tags it encloses. EMPTY means the tag does not enclose any data or other tags. An enpty element would normally end with />. + means one or more children, * means 0 or more children, ? means 0 or 1 child. <!ATTLIST describes a keyword=value option on a tag. CDATA (Character DATA) means character data — the value of the attribute is a string. PCDATA means the begin end tags enclose some user data. #IMPLIED means any characters for the field are acceptable, including nothing at all. Did the people who made this up speak English? This has to be one of the goofiest grammars I have ever run across. This is baffling since the job it tackles is trivial.

There are other more-elaborate XML-layout describing languages: XSD, RELAX NG and Schematron.


This page is posted
on the web at:

http://mindprod.com/jgloss/dtd.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\dtd.html
Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[18.97.14.89]
You are visitor number