Item 27. Mark Up According to Meaning

One of the most fundamental principles of XML design is the separation of presentation and content. The names of all tags and attributes should reflect the information they contain rather than how they'll be presented to an end user. This is sometimes called semantic markup. Semantic markup has a number of advantages compared to more traditional presentational markup as practiced in HTML, TeX, and other languages.

  • Semantic markup provides much greater assistance to software that does anything other than present the content to an end user. It provides more reliable hooks to decipher the meaning of the data.

  • Semantic markup makes it much easier to attach alternate stylesheets and presentations to the document. ...

Get Effective XML: 50 Specific Ways to Improve Your XML 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.