O'Reilly logo

Real World XML by Steven Holzner

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

The Prolog

Prologs come at the very beginning of XML documents. In fact, XML documents do not need prologs to be considered well formed. However, the W3C recommends that you include at least the XML declaration, which indicates the version of XML, in the document's prolog. In general, prologs can contain XML declarations, comments, processing instructions, whitespace, and doctype declaration(s).

Here's an example. In this case, I've marked the document's prolog, which contains an XML declaration, a processing instruction, and a DTD (which we'll see more about in the next chapter):

					<?xml version = "1.0" standalone="yes"?>
					<?xml-stylesheet type="text/css" href="greeting.css"?>
					<!DOCTYPE DOCUMENT [
					<!ELEMENT DOCUMENT (CUSTOMER)*>
					<!ELEMENT CUSTOMER ...

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