O'Reilly logo

Sams Teach Yourself XML in 10 Minutes by Andrew H. Watt

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

Prolog

The prolog of an XML document, when present, precedes the document element.

The prolog may, but need not, contain the following:

  • An XML declaration

  • Miscellaneous content—processing instructions or comments

  • A Document Type Declaration, also called a DOCTYPE declaration

Let’s look at each of these in turn.

The XML Declaration

The XML declaration can be as simple as this:

<?xml version="1.0" ?> 

This declaration is an optional part of all XML documents. However, when an XML declaration is present in an XML document, it must occur in the first line of the XML document and must have no characters—not even a single space character—before it.

An XML declaration, if present, must have a version attribute. For XML documents that correspond to ...

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