Appropriate names

There are few restrictions on the naming of elements, but some guidelines are worth considering. A number of software and markup language conventions are available to choose from.

Letter-case

A coherent and easily remembered policy on the use of upper-case and lower-case letters is essential, as element names are case-sensitive. The most obvious options are all lower-case ('myelement') and all upper-case ('MYELEMENT'). Lower-case letters are, for two reasons, generally considered to be better. First, they are easier on the eye, whether viewing elements in XML documents, or options from an XML editor menu (and tests have shown that upper-case words take 30% longer to read). But they also make documents compressed for transfer ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.