O'Reilly logo

XML Parsing with PHP by John M. Stokes

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

Validation

We mentioned way back in Chapter 1 that an XML document should be well formed and valid. Well formed refers to the structure of the document and applies to every XML document, from the simplest to the most complex. Valid, on the other hand, requires a stricter external definition of what makes the form of a particular group of documents correct. The process of checking the correctness of an XML document against an external source is called validation.

The most common XML validation document is a Document Type Definition or DTD. DTDs are a holdover from XML’s parent language, SGML1. You’re probably familiar with DTDs, as they are often declared at the top of HTML pages. A DTD defines the structure, and lists the legal elements 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