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

Tags and Elements

You give structure to an XML document by using markup, which consists of elements. An XML element, in turn, consists of a start tag and an end tag, except in the case of elements that are defined to be empty, which consist only of one tag.

A start tag (also called an opening tag) starts with < and ends with >. End tags (also called closing tags) begin with </ and end with >.

Tag Names

The XML specification is very specific about tag names; you can start a tag name with a letter, an underscore, or a colon. The next characters may be letters, digits, underscores, hyphens, periods, and colons (but no whitespace).

Avoid Colons in Tag Names

Although the XML 1.0 recommendation does not say so, you should definitely avoid using colons ...

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