Chapter 6. Contextual formatting

Good design practice exploits the hierarchical nature of an XML document to minimize the number of different elements needed to describe its component parts. It should never be necessary to invent new tags for content that is conceptually similar to existing material, when it can be unambiguously distinguished by its location within the document instead. For example, a Title element may be applied in a number of circumstances: to name a book, each chapter and section within the book, and to provide a heading for tables and legends for pictures. As this approach is common practice in XML documents, effective styling can rarely be achieved simply by assigning a single output style to each element type. The title ...

Get XSL companion, The 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.