Contextual rules
There may be occasions where the style of an element should depend on where it appears within the document. For example, an XML DTD may define an element called Title, which is used to hold the title text of a book, its chapters, their embedded sections and all tables. Typically, the style of the title text should vary, depending on where it is applied. A book title would, for example, be larger than a section title. Reflecting this requirement in a stylesheet is known as contextual style mapping:
<book> <title>The Book Title</title> <chapter> <title>The First Chapter</title> <section> <title>The First Section</title> <table> <title>A Table</title> ... </table> ... </section> ... </chapter> ... </book>
Broad context
The simplest ...
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.