|
|
The parser can automatically verify the structure of an XML document if
we provide that information to the file. We provide that in a DTD,
or Document Type Definitions file.
-
You can provide the DTD inside the XML file itself.
-
But a better approach is to have a separate DTD file and link it to the
XML file.
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
That's the line that links the DTD file to our XML file. It can
either be a local file or a URL.
DTD ELEMENT Rules
|