Some Rules for Naming Elements

XML is designed to allow you to be descriptive with element names, in keeping with the idea that XML should be readable. Allowing you to use descriptive names also contributes to the structure of the XML document, enabling you to use element names that are descriptive of their content and relationships to other elements. This is why we use names such as phone and cellular for elements as opposed to drexel. There is nothing in the XML Recommendation to stop us from using <drexel> as an element for cellular phone numbers. But it wouldn't be the most descriptive name we could use, and wouldn't help anyone derive meaning from our document.

At the same time, you don't want to get carried away, and overuse the capability ...

Get Special Edition Using XML, Second 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.