A site map tells xhtml2to1 how to link the separate sections in the user's document, which are actually split into several XML documents, into one coherently-presented document in the Web browser.
The site map contains the information need to automatcally:
A site map is not necessary for processing single-file documents, but is required for multiple-file documents.
In this section, we explain how to use site maps in xhtml2to1.
Next, we also want xhtml2to1 to create navigation menus for us.
Since each section in the document
are separate XML documents,
they need to be explicitly linked together.
We tell xhtml2to1 what goes in the navigation menu
using XHTML 2.0’s
nl element (meaning navigation list).
Each entry in the navigation list is introduced
by the familiar li element.
The nl navigation lists may be nested,
to create hierarchical1 menus.
In very general terms, a site map is an index of all the relevant documents of a site and all the information needed for navigating through those documents. The information is needed to provide the navigation menu for the individual pages, to provide section numbering and to provide cross-reference labels for links between two documents.
There are many possible designs for what a site map should be, and how the information inside it should be organized. For example, one could use a content management system, backed by a database, to keep track of the site map. In xhtml2to1, the site map uses a fairly simple design that can be efficiently implemented with XSLT.
We insist on the design being simple to minimize the inertia of the potential writer to write technical documentation. Thus there will necessarily be some trade-offs, such that certain advanced modes of navigation cannot be expressed in the current design. If those features are desired, then the only recourse is to invent a new kind of site map scheme; fortunately, xhtml2to1 is modular enough to allow this. We will have more to say about this topic later.
Formally, a site map is an hierarchical list (i.e. a tree), where each node represents a sub-section of the document. At each node, we record:
The hierarchical list is encoded using nested
xs:site-item elements corresponding
to each node of the tree.
The information listed above will be entered,
inside one of the following appropriate elemental wrappers,
that are the children of the xs:site-item
they apply to.
xs:locationxs:labelxs:titlexs:number
In its early stages, xhtml2to1
encoded the site map as XHTML2 navigation lists
(x2:nl and x2:li) directly,
but the author found that it complicates the site map
code enormously, so that approach was abandoned.
Despite the colorful criticism we made of large monolithic DocBook documents, we must not get too optimistic on how far incremental building of large documents can be pushed. If a change is made to a sub-document that affects all the other documents, such as changing a cross-reference label, or adding a new entry to the navigation menu, then all the sub-documents may still have to be generated.
But we can still obtain some benefits:
Formatted using xhtml2to1 by Steve Cheng.