XML DTD




XML DTD :

  • DTD stands for Document Type Definition.
  • A DTD allows you to create rules for the elements within your XML documents.
  • Although XML itself has rules, the rules defined in a DTD are specific to your own needs.

Syntax

<!ELEMENT element_name content_model>

Example

<!ELEMENT tutorials “Wikitechy XML Tutorial”>

Internal DTD

  • The following example demonstrates Internal DTD.
    • Doctype with DTD will be placed inside the XML
    • Elements and tags will be accessed by the xml from DTD.

Syntax

<!DOCTYPE root-element [element-declarations]>

root-element is the name of root element and element-declarations is where you declare the elements.

XML DTD

Learn XML - XML tutorial - XML DTD - XML examples - XML programs

External DTD

  • The following example demonstrates External DTD.
    • Doctype with DTD will be placed as a separate file.
    • Elements and tags will be accessed by the xml file from DTD file.

Syntax

<!DOCTYPE root-element SYSTEM "file-name">

file-name is the file with .dtd extension

XML External DTD

Learn XML - XML tutorial - XML External DTD - XML examples - XML programs



Related Searches to XML DTD

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.

×