blob: 67d72247e0b05952d196aa4457f22eea105d1181 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<!-- /*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/ -->
<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
<title>Document type definition (DTD) - overview</title>
<body id="cdtdover"><a name="cdtdover"><!-- --></a>
<h1 class="topictitle1">Document type definitions (DTDs) - overview</h1>
<div><p>A document type definition (DTD) provides you with the means to
validate XML files against a set of rules. When you create a DTD file, you
can specify rules that control the structure of any XML files that reference
the DTD file.</p><p>A DTD can contain declarations that define elements, attributes, notations,
and entities for any XML files that reference the DTD file. It also establishes
constraints for how each element, attribute, notation, and entity can be used
within any of the XML files that reference the DTD file.</p>
<p>To be considered a valid XML file, the document must be accompanied by
a DTD (or an XML schema), and conform to all of the declarations in the DTD
(or XML schema).</p>
<p>Certain XML parsers have the ability to read DTDs and check to see if the
XML file it is reading follows all of those rules. While the parser is reading
the XML file, it will check each line to be sure that it conforms
to the rules that are laid out in the DTD file. If there is a problem, the
parser generates an error and points to where the error occurs in the XML
file. This kind of parser is called a validating parser because it validates
the content of the XML file against the DTD.</p>
<b class="parentlink">Parent topic:</b> <a href="../topics/tcretdtd.html" title="A document type definition (DTD) contains a set of rules that can be used to validate an XML file. After you have created a DTD, you can edit it, adding declarations that define elements, attributes, entities, and notations, and how they can be used for any XML files that reference the DTD file.">Creating DTDs</a><br />
<p><b class="reltaskshd">Related tasks</b><br />
<a href="../topics/tvaldtd.html" title="Validating a DTD file lets you verify that it is well formed and does not contain any errors.">Validating DTDs</a><br />
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.