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

An XML Document

An XML document has the following general structure but some parts are optional:

  • A prolog, which may optionally be empty

  • At least one element, the document element, although a typical XML document has a nested structure of elements

  • Optional content following the end tag of the document element

Each of these permitted parts of an XML document is described in the remaining sections of this chapter.

A minimal XML document can consist of a single document element, such as this:

<someElementTypeName>The content</someElementTypeName> 

Typically, XML documents are much more complex and have a nested structure of elements. An XML document that uses more of the allowed structures might look like this:

 <?xml version="1.0" ?> <!-- This ...

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