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 of a book would normally look very different from the title of a chapter or table. The content of an element should therefore be formatted differently, depending on where that element appears, what it contains, or what attribute values are assigned to it. The stylesheet must be able to distinguish between each usage in order to apply appropriate formatting in each case. This is known as contextual formatting.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset