Hierarchical context

When the style of an element depends on its location in the document, it is necessary to understand what contexts are allowed by the DTD. The ELEMENT declarations provide this information.

In the example above, the Book element definition specifies that a book may contain a Title element, followed by any number of Chapter elements. One possible parent of the Title element is therefore the Book element. However, the Chapter element definition also names the Title element as its first child, and so a Title element may instead have a Chapter element parent. The Para element does not mention the Title element in its definition, and so a Title element cannot have a Para element parent. The following two templates are therefore appropriate for this mode:

<template match="Book/Title">...</template>


<template match="Chapter/Title">...</template>

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

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