O'Reilly logo

PHP Advanced for the World Wide Web: Visual QuickPro Guide by Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Document Type Definitions

XML involves two primary steps: defining your tags (or elements) and using those tags. In the previous script you referenced elements such as album and artist. Here you will learn how to give those labels meaning.

With HTML, the tags have already been defined for you, but XML allows you to create your own. You can do this either within the document type declaration section of your XML file or in a separate DTD file, as I would recommend. This process is called document modeling, because you are creating a paradigm for how your files should be written. A DTD defines every element and attribute for your markup language.

The syntax for defining an element is

<!ELEMENT name TYPE> 

where name is the name of the new tag and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required