When I first heard about XML, I thought it was something similar to HTML. Needless to say, I was wrong. XML and HTML were designed with different goals. XML was designed to describe data and HTML was designed to display data. In this article we will try to learn some basics about XML. Then we will learn about DTD and XML schemas.
<!ELEMENT book (title, author, year, price)> <!ELEMENT title (#PCDATA)> <!ATTLIST title id CDATA "0"> <!ELEMENT author (#PCDATA)> <!ELEMENT year (#PCDATA)> <!ELEMENT price (#PCDATA)> ]>
DTD can be internal or external. Internal DTD means the definition, like the one above, would be specified after the XML processing instruction -- <?xml version="1.0" ?>. External DTD is a reference to an external definition like the one below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">