• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint


A name describes an element. It is not unique: lots of elements can have the same name. Therefore, a name cannot be used to identify an individual element. Instead, it tells us the kind of element, similar to declaring the class of an object or the type of a variable. There are no predefined element types and (with a single exception explained later) there are no reserved element names. It is up to the user to create and maintain meaning.

Flash Context

Lexically, XML names are similar to ActionScript names. XML is slightly more permissive. There is a potential for trouble from two characters, the colon (:) and the period (.). These have special meaning in ActionScript but are permitted in XML names. Yet even in XML they imply a sense of namespace hierarchy. The colon is explicitly discouraged (though not forbidden) in the XML protocol. And use of the period seems only to invite disaster. We avoid the use of either one due to their use as namespace delimiters.

Of course there is no requirement that an application map XML names directly to ActionScript names. Most applications that tried to do so would come across an obstacle larger than a dot or two.

ActionScript names are unique within their scope (you cannot have two variables called “foo” on the same level). XML element names are very frequently identical to the names of their siblings. While ActionScript names serve to identify an individual datum, XML element names do not.


The restrictions on names are simple. Names can use any letter in the alphabet. The alphabet does not have to be ASCII, Latin-1, or even 8 bit. XML supports Unicode and allows names in the current alphabet. Our examples, however, will all be within the Latin alphabet.

Case matters, but it is your choice. There is no standard practice for use of case in XML. Often element names are all lower case with dashes standing in for spaces:


Names can use any digits, but they may not start with a digit:


XML defines no element names, but it does reserve all names beginning with the three letters “xml” (case insensitive), so xml-test is not a permitted name.


letters yes yes A B C a b c Å ß ç
digits  yes 0 1 2 3
underscore yes yes _
colon yes, but[1] yes, but[1] :
dot and dash  yes .—
xml prefix  yes XML xml xML

[1] Colons should be avoided due to the namespace connotation.

Examples of Names

ADDRESS Street, city, etc.
player Contains personal data, such as an address
team Probably contains several player elements
_team Different kind of team element
team.mascot Just a simple name. The dot has no meaning.
team_mascot Alternative name
team-mascot Traditional XML name formation
Formula1 Digits can be included
test-xml Noninitial XML triplet is fine

Bad examples

xmlTEST Cannot begin with xml
9-iron Cannot begin with digit
team:player Legal, but very bad form unless team is a namespace

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint