O'Reilly logo

Platinum Edition Using XHTML™, XML, and Java™ 2 by Andrew H. Watt, Mike Morgan, Jim O'Donnell, Eric Ladd

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

XML Names

If an XML parser is to properly process an XML document, it must know which characters are permitted in which locations. So, let's take a brief look at the legal characters that can be used in constructing an XML name.

All XML names must begin with a letter, an underscore character (_), or a colon (:). In practice, avoid starting an XML name with a colon because it's used, in effect, as a continuation character in namespaces, and so on. In fact, although it's legal, you should entirely avoid using a colon except as a namespace continuation character.

A name can continue using either the characters that are valid to begin a name, or using digits, hyphens, or full stops.

XML is case sensitive. Therefore, an element named <MyName> is treated ...

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