The auxiliary file with navigation information is purely an intermediate artifact to help add navigation information to a web page.
I chose the name trWNav.xml
for the auxiliary file. The name can be
changed by editing the file trWLib.py
.
Each trWNav.xml
file complements a body.htm
file and sits in the
same directory.
trWNav.xml
contains meta data
body.htm
file in the same directorybody.htm
files in other directories of the tree. These
are called related nodesThe latter information is used to construct the navigation. In principle the whole tree ‑ i.e. all nodes ‑ needed to be included to be able to construct all possible types of navigation. However this is rarely needed. To cover the most used navigation types, I selected a special class of nodes to be included.
To define this class of nodes, which I call related nodes, I
introduce first the notion of the bread crumb. The bread crumb is a
set of nodes including the current node, i.e. the current body.htm
file, plus all its ancestors up to and including the home node.
The related nodes are defined as:
The following graphical example illustrates this choice of related nodes, if node c2 is the web page in question (marked by a green circle):
In summary:
From the set of related nodes, whose meta data are stored in the file
trWNav.xml
, you select the navigation elements you want to use in
the style sheet trWSite.xsl
The XML document element in the file trWNav.xml
is called htWeb2
.
It has the following child elements:
This is the name of the directory in which the home body.htm
file
resides (= the web sites root). The htHomeDir
element is used in
trWSite.xsl
to get access to the tree, because some paths in XSLT
are relative to the directory in which the style sheet trWSite.xsl
is located. trWSite.xsl
is located the home directory's parent
directory.
htTitle
is a copy of the title element in body.htm
. trWSite.xsl
generates the title element in index.htm
from it. Alternatively
trWSite.xsl
could copy the title element directly from body.htm
to
index.htm
, but that would be more costly.
htTabName
has a copy of the content attribute of the <meta
name="htTab" content="..."/>
element of body.htm
. This is the
string that is used in the navigation. It shall be a short version of
the web page's title. It can contain spaces.
htDir
contains the name of the directory in which body.htm
resides.
This element is rarely needed in trWSite.xsl
.
htDownDir
is the relative URL to get from the home directory to the
directory in which body.htm
resides. It is used in trWSite.xsl
to
body.htm
body.htm
, i.e. the core web page
content.
htUpDir
is the relative URL to get from the directory in which
body.htm
resides to the home directory. It is used in trWSite.xsl
for example to
Of course, such central resources could also be stored in a
subdirectory of the home directory or a sibling directory. htUpDir
could then be used in trWSite.xsl
to construct a suitable relative
URL to the resource.
htLevelNo
has the nesting level of body.htm
. The home body.htm
has
nesting level 1. Root's children have nesting level 2 and so on.
htIgnore
is a copy of the content attribute of the <meta
name="htIgnore" content="y/n"/>
element. If a file body.htm
contains the htIgnore
meta element and the value of the attribute is
y
, then the node shall be excluded from the navigation and n
when it
shall be included. Note that the meta element is read and used in
trwnavs.py
to establish the tree of related nodes. htIgnore
is
normally not needed in a trWSite.xsl
style sheet.
htOrder
is a copy of the content attribute of the <meta
name="htOrder" content="nn"/>
element used for sorting the navigation
tabs. Note that the meta element is read and used in trwnavs.py
to
establish the wanted order of sibling nodes in the tree of related
nodes. htOrder
is normally not needed in a trWSite.xsl
style sheet.
The htNode
elements form the tree of related nodes. The htNode
element
pertaining to the home node is also a child of the htWeb2
document node.
The other related htNode
nodes are sub elements of the home htNode
and
are nested within each other. Each htNode
element has the following
attributes:
Each htNode contains child elements:
These child elements have the same definition as the ht… elements.
TgtURI is specific. TgtURI contains the relative URL to get from the
current body.htm
to that htNode. TgtURI is the main data element
used to construct the URL in the href
attribute of the a
link
element used for navigation.