<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE set PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "local/docbookx.dtd" [
<!--                                                   -->
<!--      This HyTimezation is needed to make the      -->
<!--      DocBook ULINKs work as-is in DocZilla        -->
<!--                                                   -->
<!ENTITY % local.ulink.attrib '
	HyTime CDATA #FIXED "clink"
	HyNames CDATA #FIXED "linkend url"
	loctype CDATA #FIXED "url queryloc url"'
>
<!ENTITY % local.link.attrib '
	HyTime CDATA #FIXED "clink"
	HyNames CDATA #FIXED "linkend linkend"'
>
<!NOTATION URL PUBLIC "-//IETF//NOTATION Uniform Resource Locator//EN">
<!ENTITY tocdtd SYSTEM "toc.dtd">
<!ENTITY ndataprefs SYSTEM "ndata.js">
<!ENTITY uiref SYSTEM "ui-reference">

<!-- ILLEGAL XML PROLOG (testing ilkka's css)
<!NOTATION doczillajpeg SYSTEM "doczilla:image">
<!ATTLIST #NOTATION doczillajpeg width CDATA #IMPLIED>
<!ENTITY logo SYSTEM "newlogo.jpg" NDATA doczillajpeg [ width="100%" ]>
-->
]>
<?xml-stylesheet href="docbook.css" type="text/css"?>
<!-- <?xml-stylesheet href="manual.css" type="text/css"?> -->
<?mde-toc href="toc-manual.xml" type="text/xml"
          title="DocZilla Reference Manual" persistent="sticky" open-to-depth="3"?>
<?mde-toc href="loe.xml" type="text/xsl"
          title="List of Examples" persistent="no"?>
<set>
  <!--
  <title>
  <medialabel>
  <inlinegraphic entityref="logo"/>
    </medialabel>
  </title>
  -->
  <book status="approved" security="public">
    <title>
      DocZilla SGML/XML Components and Browser
    </title>
    <subtitle>
      Reference Manual (for version 2.7)
    </subtitle>
    <bookinfo>
      <authorgroup>
	<corpauthor>Citec Information</corpauthor>
      </authorgroup>
      <address>
	<street>Silmukkatie 2</street>
	<city>Vaasa</city>
	<postcode>65100</postcode>
	<country>Finland</country>
	<phone>+358 (0)6 3240 700</phone>
	<fax>+358 (0)6 3240 800</fax>
	<email>info@citec.fi</email>
      </address>
      <productname>DocZilla Browser</productname>
      <copyright>
	<year>1998-2003, 2004-2005</year>
	<holder>Oy Citec Information Ab</holder>
      </copyright>
    </bookinfo>
    
    <!--                                                                 -->
    <!--                     Front matter                                -->
    <!--                                                                 -->
    <preface>
      <title>DocZilla Technology</title>
      
      <para>
	DocZilla is a set of software components for processing and
	viewing data in the SGML and XML formats. The main goal of the
	DocZilla project is to design a solid technology platform that
	provides a flexible SGML and XML support for enterprise-level
	document management systems. DocZilla Browser is our
	proof-of-concept product: a sophisticated and robust SGML/XML
	browser built on top of the Mozilla core. The DocZilla Browser
	itself is a standalone tool for viewing SGML/XML documents,
	but it can be easily adapted and modified to provide different
	views to all enterprise data. DocZilla can also be deployed as
	a dedicated viewer or a electronic manual application.
      </para>
      <para>
	For more information about DocZilla products, see our website
	at <ulink url="http://www.doczilla.com/">
	  http://www.doczilla.com/
	</ulink>.
      </para>
      <para>
	This book is a reference manual to the DocZilla features and
	DocZilla-specific configuration of your documentation
	environment. It assumes that DocZilla is available to you as
	the DocZilla Browser. With customized DocZilla based
	applications, this documentation may be applicable in a
	reduced form or lack descriptions of additional features not
	in the standard browser.
      </para>
      <para>
	This book does not extensively cover SGML or XML itself, the
	various standards which DocZilla conforms to nor Mozilla's
	features. For further reference on those subjects, see the
	bibliography.
      </para>
      <sect1>
	<title>
	  How to read this book
	</title>
	<para>
	  The keywords, parameter names, file and path names, computer
	  output, menus or similar names are printed in
	  <computeroutput>this style</computeroutput>. Footnotes are
	  shown like this <footnote><para>This is an example footnote.
	  CSS2 does not transparently provide support for traditional
	  footnotes.</para></footnote>.
	  
	  The text may have references to "left-clicking" and
	  "right-clicking". In systems where the number of buttons is
	  equal to two, which are configured for left-handed persons
	  or whose mouse buttons are differently arranged (e.g. some
	  laptops), these terms should be understood as clicking on
	  the primary mouse button and the secondary mouse button.
	  Finally, examples or syntax declarations are rendered like
	  this:
	  <example>
	    <title>A sample example</title>
	    <para>
	      The example contents goes here.
	    </para>
	    <literallayout>Typically computer output or some other
example text shown in this style.</literallayout>
	  </example>
	</para>
      </sect1>
    </preface>
    
    <!--                                                                 -->
    <!--                     Main matter                                 -->
    <!--                                                                 -->
    <chapter>
      <title>Getting started</title>
      <sect1>
	<title>Version Changelog</title>
	<para>
	  Here's a list of major changes between DocZilla versions 1.0
	  and 2.7:
	</para>
	<variablelist>
	  <varlistentry>
	    <term id="linkmanager-plugins">
	      LinkManager plugins
	    </term>
	    <listitem>
	      <para>
		DocZilla was refactored to support modular
		architecture in implementing new hyperlinking
		languages. Software components providing new hyperlink
		implementations can be only a few dozen lines of code.
		DocZilla's HyTime support in 2.7 was rewritten as a
		LinkManager plugin, as well as was the user hyperlink
		feature;
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      DocZilla Search Server
	    </term>
	    <listitem>
	      <para>
		This new separately available DocZilla application is
		used to serve DocZilla Search index files over a TCP/IP
		network connection. It means you can utilize DocZilla's
		structured searches and fast index lookups everywhere,
		not only on your local harddrive. All DocZilla Browsers
		have support for network searches: all you need to do is
		to tell DocZilla the mere URL of the index resource
		(file or network service) and start searching: the
		access to the index will be completely transparent for
		the user;
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      New Mozilla version
	    </term>
	    <listitem>
	      <para>
		DocZilla 2.7 is now based on the stable Mozilla
		version 1.7.8, which is the latest at the time of
		writing, June 2005. It means a huge improvement in
		speed, stability, standards compliance and robustness;
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      New SGML parser
	    </term>
	    <listitem>
	      <para>
		DocZilla 2.7 now integrates to the de-facto SGML
		parser of the industry, <ulink
		url="http://openjade.sourceforge.net/">OpenSP
		1.5.1</ulink>. This means DocZilla is now a validating
		SGML/XML browser, with quite complete parser support
		for all the constructs in the SGML standard;
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      User hyperlinks
	    </term>
	    <listitem>
	      <para>
		DocZilla 2.7 users can now maintain a database of
		their own hyperlinks. The user can create
		unidirectional and bidirectional links from any
		location in any SGML/XML document to another. This
		brings personal navigation to a new level in a
		document set;
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      CGM image plugin
	    </term>
	    <listitem>
	      <para>
		DocZilla has built-in support for the <ulink
		url="http://www.sdicgm.com/">SDI CGM Reader</ulink>
		plugin which comes bundled with DocZilla. Targetting
		and highlighting hotspots in CGM images is possible
		both from JavaScript and by using regular URL
		references. The user hyperlinks also support hotspots
		in CGM images, allowing creation of links from/to a
		CGM image;
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      Extended Table of Contents
	    </term>
	    <listitem>
	      <para>
		TOCs can now have multiple columns, with label,
		target, options and target window name specified for
		each tree cell. The width of each TOC column can be
		specified. Also, each cell in the TOC tree now
		supports alternate URL targets: if there's an
		ambiguity in clicking on a TOC item, a menu pops up,
		asking the user to choose one URL target. Targets can
		also be designated further to icon targets and text
		targets: the former are only available when the icon
		of a TOC tree cell is clicked, the latter are
		available elsewhere in a TOC tree cell;
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </sect1>
      
      <sect1>
	<title>Acquiring DocZilla Browser</title>
	<para>
	  You may have your DocZilla Browser distributed to you on a
	  CD or alternatively by downloading the full version on the
	  customer downloads page on the DocZilla website. Also, these
	  installation instructions apply to the evaluation version of
	  the DocZilla Browser which is also available on the website.
	</para>
	<para>
	  As DocZilla is based on the Mozilla application development
	  framework, it is highly portable to a number of platforms.
	  Currently, there are DocZilla versions available for Win32
	  API (Windows 95 and newer) and for Linux (glibc2 or newer
	  and GTK+ 2.0).
	</para>
	<sect2>
	  <title>The non-commercial version of DocZilla Browser</title>
	  <para>
	    The non-commercial version is a fully working DocZilla
	    distribution except that it is only licensed for
	    non-commercial, personal, or evaluation use. It comes with
	    no official support but questions can be asked on the
	    DocZilla forum<ulink
	    url="http://www.doczilla.com/cgi-bin/threads/wwwthreads.pl"></ulink>.
	  </para>
	  <note>
	    <para>
	      Note: in version 1.0, the non-commercial version had a
	      number of features disabled. In 2.7, these are now enabled
	      for everybody:
	    </para>
	    <itemizedlist>
	      <listitem>
		<simpara>
		  Table of Contents trees can be generated dynamically
		  using XSLT, in addition to static TOCS;
		</simpara>
	      </listitem>
	      <listitem>
		<simpara>
		  The professional SGML/XML indexing feature is enabled
		  in DocZilla Search;
		</simpara>
	      </listitem>
	      <listitem>
		<simpara>
		  In addition to user annotations, document authors
		  themselves can now attach relative annotation sources
		  to documents;
		</simpara>
	      </listitem>
	      <listitem>
		<simpara>
		  In addition to regular image formats on the web (JPEG,
		  GIF, PNG), DocZilla's advanced image support is
		  enabled. Currently this means support for TIFF raster
		  images in the default release. For more information
		  about the DocZilla image support, see <link
		    linkend="features-misc-images">Advanced image
		    decoder</link> section;
		</simpara>
	      </listitem>
	      <listitem>
		<simpara>
		  SSL (Secure Socket Layer) is enabled, allowing
		  encrypted network connections.
		</simpara>
	      </listitem>
	    </itemizedlist>
	  </note>
	</sect2>
      </sect1>
      <sect1>
	<title>Installation on Windows</title>
	<para>
	  The Windows version comes with an InstallShield&trade;
	  installation program. To install the program, execute
	  <computeroutput>DOCZILLA.EXE</computeroutput>
	  <footnote>
	    <simpara>In some distributions, the installation program
	      is named <computeroutput>SETUP.EXE</computeroutput>
	    </simpara>
	  </footnote> and follow the instructions on the screen.
	  Besides copying the binaries to your disk, the installation
	  program will create shortcuts and, if allowed by the user,
	  add mime-type mappings for certain file extensions to the
	  registry (<computeroutput>*.sgml, *.sgm, *.xml,
	  *.xsl</computeroutput>).
	</para>
	<para>
	  To uninstall the browser, use the <computeroutput>Add /
	    Remove programs</computeroutput> application in the
	    Control Panel.
	</para>
      </sect1>
      <sect1>
	<title>Installation on Linux</title>
	<para>
	  The Linux release of DocZilla is currently distributed in
	  tarball format (.tar.gz) for compatibility. Unpack the
	  tarball file to a suitable directory with the
	  <userinput>tar</userinput> command
	  <footnote>
	    <simpara>See the manual page of tar for more information:
	      type <userinput>man tar</userinput></simpara>
	  </footnote>
	  or alternatively with a graphical archiving utility, like
	  Gnome FileRoller or KDE Ark. The destination directory
	  should be in your home directory, or for system-wide
	  installations, under
	  <computeroutput>/usr/local/</computeroutput>. Start the
	  browser by running the file
	  <computeroutput>doczilla</computeroutput> in the
	  <computeroutput>DocZilla</computeroutput> directory.
	</para>
	<para>
	  DocZilla does not need write access to other system
	  directories, like <computeroutput>/etc</computeroutput>. It
	  stores its user preferences and data in the
	  <computeroutput>~/.doczilla/</computeroutput> directory.
	</para>
      </sect1>
      
      <sect1>
	<title>Viewing Documents</title>
	<para>
	  DocZilla's main objective is to read and display any valid
	  SGML or XML document without additional pre- or
	  postprocessing stages. The markup parser that DocZilla 2.7
	  uses is OpenSP 1.5.1 which has fairly complete SGML
	  conformance and is very strict in regard to the syntactic
	  and semantic validity of the documents and DTD subsets.
	  Invalid documents may generate warning and error messages,
	  or even critical errors that keep DocZilla from finishing
	  the document load. Any valid SGML document should raise no
	  errors.
	</para>
	<para>
	  In general, the documentation environment should be set up
	  so that all the required DTD subsets are found and
	  accessible. Typically this includes proper catalog files to
	  map public identifiers to formal system identifiers and
	  storage object identifiers. XML files are an exception in
	  that they do not necessarily require a DTD to be loaded in
	  DocZilla. About writing portable documents, please see <link
	  linkend="portable">Portability of documents</link> chapter.
	</para>
	<para>
	  All documents, however, need styling information in order to
	  be sensibly laid out on the screen or printer, as opposed to
	  the plain text view that shows up when no layout style is
	  given. DocZilla supports <link linkend="style-css">Cascading
	  Stylesheets</link> and <link linkend="style-xslt">XSL
	  Transformations</link>. The former is the primary styling
	  language, whereas the latter can be used to reorganise or
	  translate the document into a new structure for viewing. An
	  example would be to convert an XML document to elements in
	  HTML namespace, where styling information is implied for
	  each element.
	</para>
	<para>
	  See the chapter <link linkend="styling">Styling
	  Documents</link> for more information about
	  stylesheets. Here's a small quick-start example of how to
	  attach a CSS stylesheet to a document.
	  <example>
	    <title>
	      Adding a sample stylesheet to SGML/XML document
	    </title>
	    <para>
	      In the document, use the
	      <computeroutput>xml-stylesheet</computeroutput>
	      processing instruction to tell DocZilla about the
	      stylesheets. In SGML documents, use the
	      <computeroutput>mde-stylesheet</computeroutput><footnote>
	      <simpara>A historical anecdote: the acronym "mde" that
	      pops up regularly in the DocZilla terminology stands for
	      "MultiDoc Engine", referring to MultiDoc Pro, Citec's
	      previous SGML browser.</simpara></footnote> PI instead.
	    </para>
	    <literallayout>&lt;?xml version="1.0"?>
&lt;?xml-stylesheet href="meeting.css" type="text/css" title="normal"?>
&lt;doc>
  &lt;title>Example&lt;/title>
&lt;/doc></literallayout>
	  </example>
	</para>
	<sect2>
	  <title>Migrating from MultiDoc Pro</title>
	  <para>
	    Users of MultiDoc Pro are used to ViewPort&trade;
	    stylesheets. DocZilla does not support the ViewPort format
	    by default, so a tool to convert the
	    <computeroutput>.SSH</computeroutput> stylesheets to CSS
	    was written. The tool is called
	    <computeroutput>SSH2CSS.EXE</computeroutput>. It is
	    included in the DocZilla distribution for Windows, and it
	    is also available on the <ulink
	    url="http://www.doczilla.com/">DocZilla website</ulink> as
	    a plain executable file.
	  </para>
	  <para>
	    The format of <computeroutput>ENTITYRC</computeroutput>
	    has changed a little since the times of MultiDoc Pro.
	    Mainly, all arguments to keywords are required to be
	    quoted, and secondly, the syntax of some keywords has been
	    extended to support the wider range of functionality in
	    DocZilla. See the section <link
	    linkend="entityrc">ENTITYRC files</link> for more
	    information.
	  </para>
	</sect2>
      </sect1>
      <sect1 id="portable">
	<title>Portability of documents</title>
	<para>
	  The issue that is most likely to restrict the portability of
	  your documents is file naming convention. There are many
	  file systems on many computer platforms and operating
	  systems and they work differently when referring to files.
	  For example, Windows file system is
	  <emphasis>case-insensitive</emphasis> in the sense that
	  <computeroutput>document.sgml</computeroutput>,
	  <computeroutput>Document.sgml</computeroutput> and
	  <computeroutput>DOCUMENT.SGML</computeroutput> refer to the
	  same file. On the other hand, a Unix system traditionally
	  considers these as different files. An old Apple MacIntosh
	  uses case-insensitive addressing, whereas the new Mac OS X
	  can work case-sensitively, in some cases. In general,
	  case-sensitive documents work on case-insensitive systems
	  but not vice versa.
	</para>
	<sect2>
	  <title>Notes for Windows users</title>
	  <tip>
	    <para>
	      When typing system IDs in DTD subsets, ENTITYRC, CATALOG
	      etc. files, use the appropriate and correct name case;
	    </para>
	  </tip>
	  <tip>
	    <para>
	      The CATALOG and ENTITYRC files should be named
	      <computeroutput>catalog</computeroutput> and
	      <computeroutput>entityrc</computeroutput>, all in
	      lower-case letters. This helps DocZilla find them more
	      easily on a case-sensitive file system;
	    </para>
	  </tip>
	  <tip>
	    <para>
	      Use the forward slash
	      (<computeroutput>/</computeroutput>) character as the
	      path separator, not a backslash
	      (<computeroutput>\</computeroutput>): DocZilla works
	      with the notion of URLs and it can translate the
	      relative URL
	      <computeroutput>directory/file.sgml</computeroutput> to
	      point to a
	      <computeroutput>DIRECTORY\FILE.SGML</computeroutput> on
	      a Windows system. However, on non-Windows platforms the
	      backslash is not treated specially and it thinks a
	      backslashed URL points to a file literally named as
	      "DIRECTORY\FILE.SGML".
	    </para>
	  </tip>
	  <tip>
	    <para>
	      If possible, try to configure your SGML/XML authoring
	      tools to avoid these pitfalls, too. A non-portable SGML
	      documentation environment is as useful as a proprietary
	      binary-only document format.
	    </para>
	  </tip>
	</sect2>
	<sect2>
	  <title>
	    Notes for non-Windows users
	  </title>
	  <tip>
	    <para>
	      Name your files using the traditional MSDOS/Windows
	      convention, using file name suffixes. That is, first
	      append a dot to the name, then the suffix itself, like
	      <computeroutput>.sgml</computeroutput> or
	      <computeroutput>.xml</computeroutput>. Windows does not
	      support explicit file meta data or automatic recognition
	      based on the file contents and, thus, relies heavily on
	      the suffix to determine mimetypes of files.
	    </para>
	  </tip>
	</sect2>
      </sect1>
    </chapter>
    
    <chapter>
      <title>Reference manual</title>
      <para>
	This chapter explains the functionality and features of
	DocZilla in detail. <link linkend="features-core">The first
	section</link> covers the features that are visible to the
	user of DocZilla Browser or other applications based on
	DocZilla. The appropriate user interface is explained, as well
	as the instructions to implement and utilise the feature in
	your documents, if any. <link linkend="features-more">The
	second section</link> lists features that are related to
	document authoring or building a DocZilla documentation
	environment and <link linkend="features-misc">last
	section</link> contains information on miscellaneous features
	and DocZilla specific issues.
      </para>
      
      <sect1 id="features-core">
	<title>Core components</title>
	<sect2>
	  <title>User interface</title>
	  <para>
	    The user interface of DocZilla Browser is intended to feel
	    familiar and be as simple as possible and easy to use.
	    This section will describe the DocZilla specific user
	    interface items and dialog windows. For a general
	    reference to the user interface and menus, see the <link
	    linkend="appendix-ui">User Interface Reference</link>
	    appendix.
	  </para>
	  <sect3 id="prefswindow">
	    <title>
	      Preferences
	    </title>
	    <para>
	      The preferences window mostly the same as in the Mozilla
	      Browser. There's a new preferences section for DocZilla,
	      on the very bottom of the panel list.
	    </para>
	    <para>
	      The "Table of Contents" panel contains preferences items
	      related to the <link linkend="tocs">Table of
	      Contents</link> component. It provides controls to set
	      the default value of the <link
	      linkend="misc-opentodepth">
	      <computeroutput>open-to-depth</computeroutput> expansion
	      level</link>. It also allows to change the priority of
	      the default value over the value in the TOC file or TOC
	      invocation.
	    </para>
	    <para>
	      The second panel, "Extended XLinks" controls the
	      actuation rules and the user interface of the XLinks
	      component. You may give DocZilla much or little control
	      over how links are automatically followed and when a
	      target selection dialog should be popped up for you.
	    </para>
	    <para id="prefs-ndata">
	      The last panel, "NDATA" provides default handlers for
	      displaying NDATA (non-SGML data) entities, based on the
	      name of their notation. These values are used if they
	      are not overridden in the DTD. NDATA types identified by
	      their names can be set to default to being displayed as
	      an image, handled by a plugin, in a view embed to the
	      document, not displayed but automatically linked to, or
	      plain simply ignored. Also, you can choose to ignore any
	      referred entities of unknown NDATA type: otherwise
	      DocZilla auto-generates a hyperlink explaining the
	      entity and pointing to the target system ID.
	    </para>
	  </sect3>
	</sect2>
	<sect2>
	  <title>URLs and locations</title>
	  <para>
	    DocZilla addresses files and resources using standard
	    Universal Resource Locators, either relative or absolute.
	    The URL schemes supported by DocZilla are equal to the
	    ones supported by Mozilla, including
	    <computeroutput>http</computeroutput>,
	    <computeroutput>https</computeroutput>,
	    <computeroutput>ftp</computeroutput>,
	    <computeroutput>file</computeroutput> and
	    <computeroutput>javascript</computeroutput>. This enables
	    DocZilla to operate transparently over networks just as
	    easily as over local files.
	  </para>
	</sect2>
	<sect2 id="tocs">
	  <title>Table of Contents (TOC)</title>
	  <para>
	    The Table of Contents (or DocZilla TOC) component
	    maintains trees of TOC items, and it is capable of
	    displaying them visually in an interactive pane in the
	    graphical user interface. TOCs can be used to navigate
	    within a document or a set of documents. TOCs can be
	    static or dynamic, they might be document specific or
	    permanent, they may be nested and they understand various
	    parameters that control how they are processed.
	  </para>
	  <sect3>
	    <title>The TOC pane</title>
	    <para>
	      You can click on the tree items to activate the targets
	      of the tocitems. Some items contain sub-items in which
	      case you can open the lower tree branch by
	      single-clicking on the "+" sign (also known as
	      <quote>twisty</quote>) or by double-clickin the whole
	      item.
	    </para>
	    <para>
	      The TOC items have two additional uses: sometimes they
	      contain no targets and nothing happens when you
	      single-click them: this is common when the tocitem is
	      just a placeholder for sub-items or when it is a root of
	      a TOC. The TOC root items are displayed on a darker
	      background, and they stand out a bit when compared to
	      regular tocitems.
	    </para>
	    <para>
	      The other use is that a TOC item contains more than one
	      target in which case a popup menu is displayed,
	      suggesting the user to pick one of the targets.
	    </para>
	    <para>
	      Also, there's an advanced mode of display: a TOC may
	      have more than one columns in which case one (usually
	      the first) column contains the branch lines and twisties
	      of the tree structure. There can be zero of more targets
	      not only for each row but each row and column. The tree
	      cells can be activated by clicking on the row on
	      different columns.
	    </para>
	    <para>
	      There's a yet another feature that allows adding icons
	      to the TOC items as well, and making the icons separate,
	      additional targets. It means that besides each TOC item
	      can have multiple columns (and zero or more targets on
	      each), each column of an item can also have an icon,
	      containing zero or more additional targets that can be
	      activated by clicking on the icon image. However, as
	      good as it sounds, this feature hasn't got a general
	      user interface yet. While it is otherwise quite simple
	      to use from the TOC XML document, it also involves
	      writing of a custom <quote>chrome JAR</quote> package
	      that provides a <quote>XUL overlay</quote> to define the
	      actual icon. Commercial users, please ask our product
	      support for more detailed instructions, if you wish to
	      use this feature yourself.
	    </para>
	    <para>
	      A context menu is available in the TOC pane, reachable
	      by right-clicking a tocitem. The context menu contains
	      different items depending on whether you popped it up
	      over a regular tocitem or one that represents a root of
	      a TOC. The tocitem menu contains an option to open the
	      target of the tocitem in a new window, as opposed to by
	      replacing the currently shown document with the target.
	      The TOC menu contains two items to help removing
	      complete TOCs from the in-memory tree.
	    </para>
	  </sect3>
	  <sect3>
	    <title>Static TOCs</title>
	    <para>
	      Static TOCs are XML files following the DocZilla TOC
	      DTD. They are loaded by the DocZilla TOC subsystem when
	      the document is loaded, and added to the internal TOC
	      item tree. See the <link
	      linkend="appendix-tocdtd">appendix on TOC DTD</link> for
	      detailed information about the TOC structure and
	      defining link targets with element attributes. The TOC
	      DTD is simply a <computeroutput>toc</computeroutput>
	      element that contains any number of
	      <computeroutput>tocitem</computeroutput> elements. Each
	      of them represents a tree item on the interactive pane.
	      Each <computeroutput>tocitem</computeroutput> begins
	      with one or more <computeroutput>link</computeroutput>
	      element, followed by zero or more
	      <computeroutput>tocitem</computeroutput> elements. Each
	      consecutive <computeroutput>link</computeroutput>
	      element will denote the target for one TOC item column.
	      The <computeroutput>link</computeroutput> element must
	      contain a <computeroutput>title</computeroutput> element
	      as their first child element. The text content inside
	      the <computeroutput>title</computeroutput> is displayed
	      on the visual TOC pane as the content of the tocitem.
	    </para>
	    <para>
	      The <computeroutput>link</computeroutput> elements
	      contain the title of the tocitem and optionally a
	      reference to the target URL of the tocitem. It may be a
	      URL fragment (e.g.
	      <computeroutput>#mychapter</computeroutput> or
	      <computeroutput>#element(/1/1/2)</computeroutput>) in
	      which case it is resolved against the displayed
	      document. If it is a relative URL, it is resolved
	      against the URL of the TOC file itself, or against the
	      XML base URL if available. The URLs are loaded to the
	      primary browser view in the same window where the TOC
	      pane is located. The actuation is processed as if the
	      URL was typed in the browser location bar or loaded as a
	      result of clicking an ordinary link. There are no
	      limitations whether the tocitem points to an image file,
	      a PDF document or even to a snippet of JavaScript, using
	      the <computeroutput>javascript:</computeroutput> URL
	      handler. Therefore, TOCs can act as the table of
	      contents of both a single document and a set of
	      documents and resource files.
	    </para>
	    <sect4>
	      <title>Attaching TOCs to a document</title>
	      <para>
		A document can be told of a TOC in two ways: by using
		a special processing instruction or via an
		<computeroutput>entityrc</computeroutput> file. The
		first option is discussed here. The ENTITYRC method is
		feature-wise analogous to the PI method except for the
		syntax which is <link linkend="entityrc">explained in
		the ENTITYRC section</link>.
	      </para>
	      <para id="tocpi">
		The syntax of the TOC PI is:
		<example>
		  <title>
		    Syntax of the TOC processing instruction
		  </title>
		  <literallayout>&lt;?mde-toc
  href="URL"
  type="[text/xml|text/xsl]"
  title="string"
  persist="[sticky|permanent]"
  open-to-depth="a number"
  name="string"
?></literallayout>
		</example>
		The pseudo-attributes are defined as:
	      </para>
	      <variablelist>
		<varlistentry>
		  <term>
		    href
		  </term>
		  <listitem>
		    <para>
		      An URL to the TOC XML file
		    </para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    type
		  </term>
		  <listitem>
		    <para>
		      Type of the TOC, either a static (XML: text/xml)
		      or dynamic (XSLT: text/xsl). Note that the type
		      here is only a mere indicator of the type of the
		      upcoming TOC and not related to the official
		      content type of the TOC file. See <link
			linkend="notes-httpcontenttype">the section about
			HTTP content types</link> for more information.
		    </para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    title
		  </term>
		  <listitem>
		    <para>
		      The title of the TOC that is shown in the root
		      tocitem in the visual display pane.
		    </para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    persist
		  </term>
		  <listitem>
		    <para>
		      Defines the persistence of the TOC. First and by
		      default, a TOC is related to a document and when
		      another document is loaded over that document,
		      the TOC disappears from the internal TOC tree
		      and the visual TOC pane. However, if this
		      pseudo-attribute is set to "sticky", the TOC
		      remains in memory until another sticky TOC is
		      possibly loaded later. The URL targets, both
		      relative and absolute, contained by the sticky
		      TOC are loaded and displayed in normal fashion.
		      Sticky TOCs may be handy if you have split your
		      document files into a number of groups and you
		      want your TOCs to be displayed per-group instead
		      of per-document. The third option is to set the
		      TOC to persist as "permanent" which means that
		      the TOC will be present until the browser is
		      quit or when the user manually removes the TOC.
		    </para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    open-to-depth
		  </term>
		  <listitem>
		    <para>
		      The value of this pseudo-attribute is a number
		      greater than or equal to zero. It determines the
		      number of nested TOC levels to be initially
		      opened, starting from the root of the TOC tree.
		      A value of zero opens no levels, displaying only
		      the TOCs. A value of 2 opens the TOCs by default
		      and also the two highest levels of tocitems,
		      leaving the levels lower than 2 closed. See the
		      <link linkend="misc-opentodepth">TOC
		      open-to-depth parameter</link> section for
		      details on how its final value is derived.
		    </para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    name
		  </term>
		  <listitem>
		    <para>
		      This pseudo-attribute is used to attach a name
		      for the TOC being loaded. The name will be used
		      in creating sub TOCs, as described in the <link
		      linkend="subtocs">following section</link>.
		    </para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    </sect4>
	    <sect4>
	      <title>Generating TOCs on the fly at server side</title>
	      <para>
		The TOC file is just plain XML. It means that if your
		documentation environment resides on a web server, the
		TOC file can also be generated on the fly as the
		browser makes the request to load the TOC file.
		Popular server-side scripting techniques such as
		<ulink url="http://www.perl.com/">Perl</ulink>, <ulink
		url="http://www.php4.org/">PHP</ulink> and <ulink
		url="http://tomcat.apache.org/">Java Server
		Pages</ulink> all have code libraries for handling and
		outputting XML, so it can be a feasible choice if such
		behaviour is needed. This could be desirable if the
		TOC is dynamically generated but compiled of a larger
		set of data that is sent to the browser.
	      </para>
	    </sect4>
	  </sect3>
	  <sect3 id="subtocs">
	    <title>Using sub TOCs</title>
	    <para>
	      A so-called "subtoc" is a whole TOC inside another TOC.
	      If a new TOC is given a name when it is loaded, either
	      from the <link linkend="tocpi">TOC processing
	      instruction</link> or the ENTITYRC file, it becomes a
	      potential subtoc. If any of the existing tocitems in
	      memory contain the
	      <computeroutput>subtoc</computeroutput> attribute whose
	      value matches the name of the new TOC, the tocitem will
	      act as a placeholder for the new TOC. If the value of
	      the <computeroutput>subtoc</computeroutput>attribute is
	      <computeroutput>_all</computeroutput>, then any named
	      TOC will located inside the placeholder element. An
	      example of subtocs being used is the front page of the
	      <ulink
	      url="http://www.doczilla.com/demos/demos/index.xml">DocZilla
	      Demokit</ulink>: the first view contains a number of
	      tocitems pointing to different demonstration documents,
	      but when some of these documents are loaded, a new,
	      document-specific TOC is added under the originating
	      tocitem. Subtocs are no different from normal, top-level
	      TOCs except for their position in the in-memory TOC
	      tree. They are also shaded a bit differently in the
	      visual TOC pane.
	    </para>
	  </sect3>
	  <sect3>
	    <title>Dynamic TOCs</title>
	    <para>
	      The term "dynamic TOC" has two different meanings. Their
	      common denominator is that a part of or the whole the
	      TOC is not hard-coded in the TOC file but rather
	      generated later on based on the document contents.
	    </para>
	    <sect4>
	      <title>Using title references</title>
	      <para>
		This first form of dynamic contents uses the
		<computeroutput>titleref</computeroutput> element
		rather than the <computeroutput>title</computeroutput>
		element. The titlerefs should contain URL
		fragments<footnote><simpara>Note, that references to
		external documents are not yet
		supported.</simpara></footnote> like XPointers to
		refer to the elements containing the title texts, and
		they won't be resolved until the document is loaded.
		This can be useful if you have a huge number of
		documents of exactly the same form (e.g. a series of
		spare part descriptions) and you don't want to spend
		computing power in doing transformations or
		server-side TOC generation.
	      </para>
	    </sect4>
	    <sect4>
	      <title>Using built-in XSLT TOC feature</title>
	      <para>
		This is the premier TOC generation method. When
		invoking the TOC from the <link
		linkend="tocpi">processing instruction</link> or via
		the ENTITYRC, the type of the TOC must be "text/xsl".
		The TOC file must be a proper XSL stylesheet, which is
		then fed to an XSLT transformer as the stylesheet of
		the actual document. The result of the transformation
		is used as the final TOC file. This way, it's easy to
		gather all significant chapter and section titles into
		one TOC and have that generated on the fly for each
		instance of the same DTD.
	      </para>
	    </sect4>
	  </sect3>
	</sect2>
	<sect2 id="messagelogger">
	  <title>Message logger</title>
	  <para>
	    The message logger facility collects informational,
	    warning, error and critical error messages from all other
	    DocZilla components. The message logger window displays a
	    list of messages that have been raised since the last
	    start of a document load.
	  </para>
	  <para>
	    The message logger window has a <computeroutput>View >
	    Auto-show message logger</computeroutput> menu item that
	    controls the message severity level at which the message
	    logger should pop up. By default, it pops up automatically
	    if any errors or critical errors are raised. The first
	    time that happens, a small dialog window is popped up
	    before the message logger, asking the user for his
	    preferred severity level. The user can then exit the
	    dialog either directly to the message logger or skip
	    popping it up that time.
	  </para>
	</sect2>
	<sect2 id="annotations">
	  <title>Annotations</title>
	  <para>
	    DocZilla supports annotating documents. In DocZilla
	    terminology, annotations refer to attaching content to
	    documents externally, that is, without modifying the
	    document. The precision, or granularity, of a single
	    annotation is currently one element. The users can
	    maintain their own base of annotations and document
	    authors can publish additional sets of annotations with
	    documents. The collection of annotations in an annotation
	    file is called <quote>annotation context</quote>. The
	    standard annotations contain a textual message and some
	    metadata, and they can be edited with a built-in
	    annotation manager.
	  </para>
	  <sect3>
	    <title>
	      How annotations work?
	    </title>
	    <para>
	      Technically, the annotation facility is layered into
	      modules, including interchangeable backends for loading
	      annotations. The default backend loads and writes
	      XML-based RDF files, but it'd be easy to extend the
	      annotation facility by writing backends to operate with
	      MultiDoc Pro annotations or with W3 Annotea project
	      compliant annotations.
	    </para>
	    <para>
	      Also, as the annotation editor is also a mere client to
	      the annotation subsystem it could be programmed into a
	      write-only feedback machine or a sophisticated bug
	      report tool that sends new annotations to a specified
	      central server or emails them to the documentation
	      coordinator. The new annotations could be then ratified
	      and published in a central location, available to all
	      document viewers.
	    </para>
	    <para>
	      Also for now, only local annotation files can be written
	      to, network annotation contexts are readonly. If another
	      backend module was written that supported updating
	      annotations over the network, e.g. using WebDAV or some
	      other protocol, the change would be transparent to the
	      current annotation system: networked annotation contexts
	      using the new backend would simply become read-write
	      instead of read-only.
	    </para>
	  </sect3>
	  <sect3>
	    <title>User annotations</title>
	    <para>
	      The user annotation context point to elements of
	      documents addressed by absolute URLs. They are saved in
	      the user's profile directory, in a file called
	      <computeroutput>dzuserannotations.rdf</computeroutput>.
	      (It shouldn't be necessary to ever modify or move that
	      file by hand.) The user annotations are loaded and
	      become available automatically when DocZilla is started.
	    </para>
	  </sect3>
	  <sect3>
	    <title>Author's annotations</title>
	    <para>
	      Authors annotation contexts are relative, as opposed to
	      the user annotations. They're <link
	      linkend="entityrc-annotation">loaded via the ENTITYRC
	      file</link>, and they contain relative URLs to their
	      targets. The URLs are resolved against the ENTITYRC URL;
	      in other words, it matters where they're loaded, not
	      where the author annotation file is located nor what the
	      document URL is. This is good e.g. if you want to
	      maintain a global annotation file on a network drive or
	      at an HTTP URL: you can point to an absolute URL to
	      fetch the annotation file but the annotations still
	      point to their relative targets.
	    </para>
	  </sect3>
	  <sect3>
	    <title>Using the annotation editor</title>
	    <para>
	      The annotation editor can be launched in two ways:
	      either via the menu item <computeroutput>View >
	      Annotations&hellip;</computeroutput> or by making a selection
	      in the document text, right-clicking to pop up the
	      context menu and choosing
	      <computeroutput>Annotate&hellip;</computeroutput>.
	    </para>
	    <para>
	      The editor window is divided into two parts. On the left
	      there is a tree of annotation sources, including the
	      user annotation file, with single annotations as child
	      items. The right side is reserved for editing whatever
	      is selected in the left part. The right part is in turn
	      divided into upper and lower sections. The upper frame
	      contains information related to an annotation context.
	      The lower frame contains information related to a single
	      annotation.
	    </para>
	    <sect4>
	      <title>
		Basic functionality
	      </title>
	      <para>
		The tree on the left of the window contains annotation
		contexts and annotations, which can be viewed by
		clicking on them. If the clicked item was an
		annotation, also the context it belongs to is viewed.
		The menu item <computeroutput>File > New > Annotation
		context</computeroutput> can be used to create new
		annotation contexts and <computeroutput>File > New >
		Annotation</computeroutput> creates a new annotation
		to the currently selected context. The new annotation
		won't be added to the list until the fields are filled
		in and the changes are saved.
	      </para>
	      <para>
		The editor provides standard
		<computeroutput>cut</computeroutput>,
		<computeroutput>copy</computeroutput> and
		<computeroutput>paste</computeroutput> functionality
		for easy copying, moving and deleting of annotation.
		These functions work on annotations only, annotation
		contexts can only be created and deleted. If an
		annotation is selected,
		<computeroutput>cut</computeroutput> and
		<computeroutput>copy</computeroutput> work on the
		selected annotation. If an annotation context is
		selected, they work on all annotations in the selected
		context. The <computeroutput>paste</computeroutput>
		function always works in the current context, provided
		that it's writable. As the user context works with
		absolute addressing and other (author) contexts are
		relative, DocZilla tries to do the best of magic to
		preserve the URLs of annotation targets consistent
		when copying to and from the user context.
	      </para>
	      <para>
		Opening an annotation context is functionally the same
		as loading one via <link
		linkend="entityrc-annotation">ENTITYRC</link>: the
		appropriate annotation context is loaded into memory
		and affects all subsequent document loads. The
		<computeroutput>File > Save context</computeroutput>
		is essentially the same as clicking on
		<computeroutput>Save changes</computeroutput> in the
		annotation editing frame. The <computeroutput>File >
		Save context as</computeroutput> menu item will save
		the current annotation context into a new location.
		Note that the original context seems to disappear from
		the list but it just changes locations, as the "save
		as" implies, hence it looks different in the list. The
		"old" context will be loaded from the original URL and
		added to the list next time it's referred in an
		ENTITYRC file.
	      </para>
	    </sect4>
	    <sect4>
	      <title>
		Annotation contexts
	      </title>
	      <para>
		The first item in this frame is the URL where the
		annotation context was loaded. The URL is not part of
		user contexts. The next item is available only for
		author contexts and it contains the URL that the
		annotations are relative to. Normally, it's more
		useful to just see the URL than to modify it, but
		changing it is not disabled since it may be useful
		during reorganizing or merging annotations contexts.
	      </para>
	      <para>
		Next, the number of annotations in the selected
		context is shown. Aside of it, there's a checkbox that
		can be used to (temporarily) disable and enable the
		whole context. Finally, there's a button that can be
		used to remove the annotation context from memory. It
		doesn't erase the corresponding file nor delink the
		annotations from the document. If you need to remove
		an annotation context, simply remove a reference to it
		in the <link linkend="entityrc">ENTITYRC</link> file.
	      </para>
	    </sect4>
	    <sect4>
	      <title>
		Annotations
	      </title>
	      <para>
		When an annotation is clicked on the left-side tree,
		its contents is displayed in the window. The metadata
		for an annotation includes the author name, the target
		URL with an XPointer fragment to the target element, a
		boolean indicating whether this annotation should be
		popped up automatically when the document loads or
		only at user request. The message itself can be edited
		in the large textbox. The <computeroutput>Save
		changes</computeroutput> button will update the data
		and tries to save the annotation context to disk, if
		possible.<footnote><para>Note that when creating a new
		annotation from scratch, simply saving the changes
		won't dynamically update the target document, if it's
		open in any browser view. A reload of the document is
		needed to display the annotation button on the
		page.</para></footnote> The little hyperlink,
		<computeroutput>Go to target</computeroutput>, will
		open a small window and load the target of the current
		annotation to the view. This is useful for locating
		the annotation or simply checking out what it looks
		like in on a real page.
	      </para>
	    </sect4>
	  </sect3>
	</sect2>
	<sect2 id="userhyperlinks">
	  <title>User Hyperlinks</title>
	  <para>
	    User hyperlinks is a new feature that consists of three
	    technical parts: a database of user-owner (third-party)
	    links, the <link linkend="linkmanager-plugins">LinkManager
	    plugin</link> to inject links to documents off that
	    database and a user interface to create and delete link
	    arcs. The two first parts are only mentioned for technical
	    reference, and the last part is discussed here.
	  </para>
	  <sect3>
	    <title>
	      Creating links
	    </title>
	    <para>
	      Links are built by making a textual selection in the
	      document and adding the selected location as a source
	      end or a target end to the link being created. A
	      floating window represents the link being built,
	      maintaining one global state of that link accessible all
	      the time from any window. The first time a location is
	      added, the window opens up automatically. All selected
	      locations are listed in that window until either they
	      are approved as a new hyperlink or the dialog is simply
	      dismissed.
	    </para>
	    <para>
	      Select <computeroutput>Edit &gt; Set link
	      start&hellip;</computeroutput> (or, the same in the
	      context menu) to mark the start of the link. Only one
	      start point can be specified, with later target
	      selections replacing the previous one.
	    </para>
	    <para>
	      Select <computeroutput>Edit &gt; Add link
	      end&hellip;</computeroutput> (or, the same in the
	      context menu) to append a new end of the link. At least
	      one link end must be added in order to finalize creating
	      the hyperlink. In the floating window, link ends can be
	      removed or made unidirectional/bidirectional while still
	      editing the link.
	    </para>
	  </sect3>
	  <sect3>
	    <title>Deleting links</title>
	    <para>
	      The window for deleting links can be invoked from
	      <computeroutput>Edit &gt; Delete
	      links&hellip;</computeroutput>. It can list all the link
	      arcs currently in the database. Note that for one
	      bidirectional link, two arcs are listed and you can
	      delete either one of them, or both.
	    </para>
	    <para>
	      On top of the window there's a text field for entering a
	      URL prefix to restrict the number of links listed. A
	      link will be listed if one of its start or end points
	      matches the URL prefix. For example, the prefix
	      <computeroutput>file://</computeroutput> would list all
	      links that point to, or from, a local SGML/XML file. The
	      prefix is the URL of the current document by sensible
	      default, which effectively selects all the links that
	      originate from or target the current document.
	    </para>
	  </sect3>
	</sect2>
	<sect2>
	  <title>Link target dialog</title>
	  <para>
	    The link target dialog appears when there are more than
	    one possible XLink targets to choose from. Extended XLinks
	    will remain in memory as they may predefine links from
	    some arbitrary documents to others. The dialog allows
	    double-clicking on a single target, carefully selecting a
	    number of targets to be opened at once or simply
	    cancelling all link actuation requests.
	  </para>
	</sect2>
	<sect2 id="doczillasearch">
	  <title>DocZilla Search</title>
	  <para>
	    DocZilla search is available in the <computeroutput>Tools
	    > DocZilla Search</computeroutput> menu. In the search
	    window, on top of the window there is the search query
	    text field and below that, there are three alternate
	    search methods: file, directory and index search. Most of
	    the controls are common between the different search
	    methods. The file and directory search both have a text
	    field where you can add paths to files and directories,
	    separated with spaces. (A path containing a space
	    character may be enclosed within double-quotes.) The index
	    search requires the path of one index file in the text
	    field.
	  </para>
	  <para>
	    The file search and directory search both have checkboxes
	    to change the case-sensitivity of the search and whether
	    the search words should be recognized as whole words in
	    the document or as substrings. The directory search has an
	    additional control of whether to recurse into
	    subdirectories. If you enable recursive search and start
	    from the root directory of your document tree (or the root
	    directory of your hard drive) the search might take a
	    while as it goes through every directory under the root
	    directory. You may want to use the indexing capability to
	    reduce search times on large sets of documents. The
	    directory search will scan all SGML and XML files found in
	    the given directories. So far, the files are recognized by
	    the suffix after the last dot character in the file name.
	    In other words, files that match
	    <computeroutput>*.sgml</computeroutput>,
	    <computeroutput>*.sgm</computeroutput> and
	    <computeroutput>*.xml</computeroutput>.
	  </para>
	  <sect3>
	    <title>Query language</title>
	    <para>
	      The query language is simple. It contains search words,
	      separated by whitespace. Within all the files that were
	      searched, any element whose name matched one of the search
	      words will be returned. Optionally, a search word may be
	      prefixed with the "+" character or "-" character to make
	      the presence or absence of an element a requirement,
	      respectively. When the index search is not used, the
	      search words may end in the "*" character to match only a
	      start of the element name, or they may contain the "?"
	      character to match element names that contain any
	      printable character. Words spanning over several elements
	      with no white space breaks in it are treated as a single
	      word.
	      <example>
		<title>
		  The sample query "tie??k*" will match
		</title>
		<literallayout>&lt;para&gt;
The Finnish word for "computer" has the syllables:
&lt;syl&gt;tie&lt;/syl&gt;&lt;syl&gt;to&lt;/syl&gt;&lt;syl&gt;ko&lt;/syl&gt;&lt;syl&gt;ne&lt;/syl&gt;
&lt;/para&gt;</literallayout>
	      </example>
	    </para>
	  </sect3>
	  <sect3>
	    <title>Indexing files</title>
	    <para>
	      The third search method, index search requires an index
	      in which to look up the search word. On the index search
	      tab, there's a button for an alternative view which
	      enables the user to create indices of selected files.
	      Click on the <computeroutput>Create new
	      index&hellip;</computeroutput> button to enter this view. The
	      list of available options from left-to-right,
	      top-to-bottom order are:
	    </para>
	    <orderedlist>
	      <listitem>
		<para>
		  The first text field must contain the path to the
		  file in which the resulting index will be saved. For
		  convenience, you can use the <computeroutput>Find
		  file...</computeroutput> button to help picking the
		  correct path.
		  </para>
	      </listitem>
	      <listitem>
		<para>
		  The next field can contain a path to a file
		  containing a list of words, one per line, that
		  should be rejected from or exclusively included in
		  the index. A list of the most common English words
		  is included in the DocZilla distribution (see <ulink
		  url="chrome://doczillasearch/content/stopwords.english">this
		  resource file</ulink> for more information), and the
		  field can be set to point to that file by clicking
		  on the <computeroutput>Use default</computeroutput>
		  button.
		</para>
	      </listitem>
	      <listitem>
		<para>
		  DocZilla considers any length of continuous word
		  characters as one word which is then written to the
		  index. The set of word characters defaults to the
		  base and ideographic characters defined in XML
		  specification. This field allows defining additional
		  such characters: typing characters
		  <quote>0123456789</quote> or the
		  <emphasis>range</emphasis> <quote>0-9</quote> will
		  make DocZilla think of e.g.
		  <computeroutput>CIRCLIP42</computeroutput> as one
		  word. Otherwise only
		  <computeroutput>CIRCLIP</computeroutput> would have
		  been indexed from that text.
		</para>
	      </listitem>
<!--
	      Moved away, is still available in about:config !
	      <listitem>
		<para>
		  The amount of memory (in megabytes) that should be
		  available to the indexing algorithm can be set in
		  the next field. Lower values yield in slower index
		  creation, higher values make the process faster. The
		  default is 20 megabytes.
		</para>
	      </listitem>
-->
	      <listitem>
		<para>
		  The next item is a checkbox that determines whether
		  the index will be case-sensitive or not. In a
		  case-sensitive index, only case-sensitive searches
		  can be done and vice versa. Case-insensitive indices
		  are also a bit smaller in size since it the number
		  of different words is less than if words in
		  different were treated unique.
		</para>
	      </listitem>
	      <listitem>
		<para>
		  A reverse index is a rather special mode in which
		  for each word and attribute value two index entries
		  will be written. First, the word or value itself as
		  usual and then the same but lexically reversed. This
		  allows for building user interfaces for searching
		  that can do postfix search in addition to prefix
		  search, that is e.g. <quote>foo*</quote> and
		  <quote>*foo</quote>. Note that with the standard
		  DocZilla Search user interface, queries for reversed
		  words are not automatically available. This option
		  is generally needed only when creating indices for a
		  custom search interface that handles reverse queries
		  properly.
		</para>
	      </listitem>
	      <listitem>
		<para>
		  The next choice is about whether the index should
		  point to the files in an absolute manner or
		  relatively. Absolute indices are tied to the user's
		  configuration of hard disk partitioning and
		  directory structure on the disk. If the files are
		  moved, the search hits can't be reached anymore.
		  This is generally only suitable for personal indices
		  on data that will remain in the same place and not
		  moved to other computers. The relative indexing
		  model refers to the files in relative manner,
		  starting from the directory that will be indexed.
		  The resulting index file can be moved around along
		  with the indexed documents, even to other computers
		  or to a compact disk.
		</para>
	      </listitem>
	      <listitem>
		<para>
		  The last configuration item defines the directories
		  to make an index of. It's slightly different for
		  absolute and relative indices in that you can index
		  several directories into an absolute index and only
		  one into a relative index<footnote><simpara>Note,
		  this limitation only affects the number of top-level
		  directories. If you need to make a relative index of
		  two directories, simply create one extra directory,
		  move the two directories in there and index that one
		  directory. It doesn't make sense to create an index
		  relative to several directories without a common
		  parent</simpara></footnote>.
		</para>
		<para>
		  In the relative mode, you can explicitly list the
		  files to be indexed. DocZilla will ask you for a
		  text file that contains the desired paths to the
		  files, relative to the directory to be indexed. The
		  text file should contain valid pathnames, one per
		  line. After loading the text file, DocZilla will
		  inform you how many pathnames it managed to read
		  from the file.
		</para>
		<para>
		  Finally, click <computeroutput>Create
		  index</computeroutput>. If the number of data to
		  index is large then a progress bar will show up,
		  listing the number of files and kilobytes processed
		  so far.
		</para>
	      </listitem>
	    </orderedlist>
	  </sect3>
	</sect2>
	<sect2>
	  <title>Image viewer</title>
	  <para>
	    DocZilla provides a separate view for bitmap images. Using
	    the right mouse button, pop up the context menu over an
	    image in the document, then select <computeroutput>Zoom
	    image&hellip;</computeroutput>. A new window will appear with
	    the image displayed in a viewport. The user interface is
	    simple: the toolbar contains magnification controls and
	    you can move around the image by using the scrollbars. The
	    zooming window is useful with large images that wouldn't
	    otherwise fit in the browser window.
	  </para>
	</sect2>
	<sect2 id="csschecker">
	  <title>CSS Checker</title>
	  <para>
	    This little tool is designed around helping to style SGML
	    and XML documents. As we know, there are no implicit style
	    rules in effect for any particular SGML element. It means
	    that basic style rules must be explicitly applied to every
	    element. Combined with the gradually expanding document as
	    it's being authored, this often results in inconsistent or
	    undefined style rules in the CSS stylesheet.
	  </para>
	  <para>
	    One particularly common pitfall is the
	    <computeroutput>display</computeroutput> property: it
	    defaults to <computeroutput>inline</computeroutput> for
	    every element, but <computeroutput>inline</computeroutput>
	    elements can only contain other
	    <computeroutput>inline</computeroutput> elements or
	    elements with no display. This means that practically any
	    container element must be explicitly set to display as a
	    <computeroutput>block</computeroutput> element (or e.g.
	    <computeroutput>table</computeroutput>). Putting a block
	    element inside an inline element doesn't make sense and
	    thus results in undefined behaviour in the <ulink
	    url="http://www.mozilla.org/newlayout/">Mozilla's Gecko
	    rendering engine</ulink>. With large DTDs that are
	    extensively used by a document, this becomes notoriously
	    painful to debug and often hinders resolving other, more
	    obvious CSS problems.
	  </para>
	  <para>
	    Currently the CSS Checker makes sure that the
	    <computeroutput>display</computeroutput> property of each
	    element is legal in the context of the parent element.
	    With a correctly displayed element tree, it'll be much
	    easier to spot other rendering anomalities and to tune the
	    CSS rules accordingly.
	  </para>
	  <para>
	    You can find CSS Checker from the
	    <computeroutput>Tools</computeroutput> menu.
	  </para>
	</sect2>
      </sect1>
      
      <sect1 id="features-more">
	<title>Under the hood</title>
	<sect2>
	  <title>DocZilla processing instructions</title>
	  <para>
	    DocZilla recognized a number of processing instructions
	    that control various aspects of DocZilla's functionality.
	  </para>
	  <variablelist>
	    <varlistentry>
	      <term>
		<computeroutput>xml-stylesheet, mde-stylesheet</computeroutput>
	      </term>
	      <listitem>
		<para>
		  The first PI is for XML documents as specified in
		  the standard, the latter is a DocZilla specific PI
		  that is functionally equal to the XML PI but is
		  available for SGML documents too. See the section
		  <link linkend="stylepi">Styling documents</link> for
		  detailed information and examples.
		</para>
	      </listitem>
	    </varlistentry>
	    <varlistentry>
	      <term>
		<computeroutput>mde-javascript</computeroutput>
	      </term>
	      <listitem>
		<para>
		  This is used to load JavaScript files to be
		  evaluated after the document load has completed. See
		  section about <link linkend="javascriptpi">Attaching
		  scripts to documents</link> for detailed information
		  and examples.
		</para>
	      </listitem>
	    </varlistentry>
	    <varlistentry>
	      <term>
		<computeroutput>mde-toc</computeroutput>
	      </term>
	      <listitem>
		<para>
		  Tells DocZilla to include the TOC specified in the
		  processing instruction to the containing document.
		  See <link linkend="tocpi">Attaching TOCs to a
		  document</link> for detailed information and
		  examples.
		</para>
	      </listitem>
	    </varlistentry>
	    <varlistentry id="doctitlepi">
	      <term>
		<computeroutput>mde-doctitle</computeroutput>
	      </term>
	      <listitem>
		<para>
		  This processing instruction will allow setting the
		  title for the document. Without the title, DocZilla
		  will not show anything particular in the window
		  title bar. The meaning of document title is
		  effectively the same as the TITLE element in HTML
		  DTD.
		</para>
		<example>
		  <title>
		    Syntax of
		    <computeroutput>mde-doctitle</computeroutput>
		    processing instruction
		  </title>
		  <literallayout>&lt;?mde-doctitle cdata="string"?></literallayout>
		</example>
		<para>
		  The value of the minimized pseudo-attribute
		  <computeroutput>cdata</computeroutput>, enclosed in
		  double quotes, will be shown as the document title.
		  If the string begins with the "+" (plus) character,
		  it will be appended &mdash; the "+" character
		  excluded &mdash; to whatever the current document
		  title was before this processing instruction.
		  Earlier definitions could occur in other
		  <computeroutput>mde-doctitle</computeroutput>
		  processing instructions (possibly set in another
		  file if the document is compiled from several
		  external parsed entities) or from the <link
		  linkend="entityrc-doctitle">ENTITYRC file</link>.
		</para>
		<para>
		  For example, the DOCTITLE initially set in the
		  ENTITYRC could contain the manufacturer name, each
		  documentation module file would add the name of the
		  module as its own sub-title and each reusable
		  component document (referred from the documentation
		  module file as an external parsed entity) would
		  finally add the name of the particular component to
		  the title string that would be shown in the window.
		</para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	</sect2>
	<sect2 id="styling">
	  <title>Styling documents</title>
	  <para>
	    DocZilla supports CSS up to version 2 and XSLT styling
	    rules. The stylesheets are attached to documents either by
	    using one of the appropriate processing instructions or
	    via the ENTITYRC. The ENTITYRC method is feature-wise
	    analogous to using the PI except for its syntax, which is
	    explained in the <link linkend="entityrc">ENTITYRC
	    chapter</link>.
	  </para>
	  <para id="stylepi">
	    As explained in the document <ulink
	    url="http://www.w3.org/TR/xml-stylesheet/">Associating
	    Style Sheets with XML documents</ulink>, we can use the
	    following processing instruction to attach stylesheets to
	    XML documents:
	  </para>
	  <example>
	    <title>
	      Syntax of the XML stylesheet processing instruction
	    </title>
	    <literallayout>&lt;?xml-stylesheet href="URL" type="text/css" title="string" alternate="[yes]"?></literallayout>
	  </example>
	  <para>
	    Since this is defined for XML only, a variant of the PI is used in SGML files:
	  </para>
	  <example>
	    <title>
	      Syntax of the SGML (MDE) stylesheet processing instruction
	    </title>
	    <literallayout>&lt;?mde-stylesheet href="URL" type="text/css" title="string" alternate="[yes]"?></literallayout>
	  </example>
	  <para>
	    The pseudo-attributes are as follows:
	    <variablelist>
	      <varlistentry>
		<term>
		  <computeroutput>href</computeroutput>
		</term>
		<listitem>
		  <para>
		    A URL to the stylesheet file.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  <computeroutput>type</computeroutput>
		</term>
		<listitem>
		  <para>
		    Type of the stylesheet file, in this case
		    <computeroutput>text/css</computeroutput>. Note
		    that the type here is only a mere indicator of the
		    type of the upcoming stylesheet and not related to
		    the official content type of the stylesheet file.
		    See <link linkend="notes-httpcontenttype">the
		    section about HTTP content types</link> for more
		    information. XSL-stylesheets require the value of
		    <computeroutput>text/xsl</computeroutput> for
		    this pseudo-attribute.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  <computeroutput>title</computeroutput>
		</term>
		<listitem>
		  <para>
		    The value of this pseudo-attribute is used as the
		    title of the stylesheet, should it be displayed in
		    the <computeroutput>View > Use
		    style</computeroutput> menu entry in the browser.
		    Default stylesheets shouldn't have a title set.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  <computeroutput>alternate</computeroutput>
		</term>
		<listitem>
		  <para>
		    If the value of this pseudo-attribute is set to
		    <computeroutput>yes</computeroutput>, the
		    stylesheet will be regarded as an alternate style
		    and displayed in the <computeroutput>View > Use
		    style</computeroutput> menu entry in the browser.
		    The user can dynamically choose different styles
		    to be viewed. See <ulink
		    url="http://www.w3.org/TR/html401/present/styles.html#h-14.3">the
		    HTML stylesheet reference</ulink> for a more
		    detailed explanation about preferred and alternate
		    stylesheets.
		  </para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  </para>
	  <sect3 id="style-css">
	    <title>Cascading stylesheets (CSS)</title>
	    <para>
	      DocZilla supports CSS version 2 almost completely. For
	      general information about Cascading Stylesheets, see
	      <ulink url="http://www.w3.org/TR/REC-CSS2/">the
	      appropriate W3 Consortium recommendation</ulink>, as
	      well as <ulink
	      url="http://www.w3.org/TR/xml-stylesheet/">an article
	      about using CSS with XML</ulink>. DocZilla applies CSS
	      to SGML documents as well, which is not different than
	      writing CSS for HTML documents as HTML is already SGML
	      and CSS was first designed to work with HTML anyway.
	    </para>
	    <sect4>
	      <title>Case-sensitivity</title>
	      <para>
		DocZilla treats SGML documents as case-insensitive and
		XML documents as case-sensitive. This must be taken
		into account when writing the CSS rules, too.
	      </para>
	    </sect4>
	    <sect4>
	      <title>CSS1 and CSS2 compliance</title>
	      <para>
		DocZilla supports CSS version 1, and much of CSS
		version 2. Because DocZilla uses the <ulink
		url="http://www.mozilla.org/newlayout/">Mozilla Gecko
		rendering engine</ulink>, the compliance to those
		standards is effectively the same as in <ulink
		url="http://www.mozilla.org/releases/mozilla1.0/">Mozilla
		1.0</ulink> browser.
	      </para>
	    </sect4>
	  </sect3>
	  <sect3 id="style-xslt">
	    <title>XSL transformations</title>
	    <para>
	      DocZilla supports a one-phase transformation of
	      documents after they are loaded but before they're
	      displayed. An XSL stylesheet must be invoked from a
	      <link linkend="stylepi">processing instruction</link>
	      or via ENTITYRC, and only the first one is processed.
	      CSS stylesheets are applied as usual, but on the
	      document that resulted from the transformation. The
	      <computeroutput>title</computeroutput> and
	      <computeroutput>alternate</computeroutput>
	      pseudo-attributes are ignored in the case of an XSL
	      stylesheet.
	    </para>
	    <note>
	      <para>
		Using XSLT only affects the document in memory, the
		document object model (DOM). This means that e.g. search
		hits from DocZilla Search point to the original,
		non-transformed document. If the transformation severely
		changes the document structure, the search hits pointing
		to a certain location in the document may target wrong
		or non-existing elements.
	      </para>
	    </note>
	  </sect3>
	</sect2>
	<sect2>
	  <title>External unparsed entities</title>
	  <para>
	    DocZilla will try to display external unparsed entities in
	    the most sophisticated way as possible. Images and plugins
	    will be displayed embedded on the page, HTML documents in
	    an embedded frame and a hyperlink will be generated to all
	    those entities whose type was unknown or which DocZilla
	    wasn't able to display. Document style rules apply as
	    usual to the elements containing those entities for
	    greater control over how the non-SGML data is rendered.
	  </para>
	  <para>
	    For more information about displaying external unparsed
	    entities, see the section about <link
	      linkend="misc-ndata">NDATA type handling in
	      DocZilla</link>.
	  </para>
	  <sect3>
	    <title>Supported formats</title>
	    <para>
	      Regular image formats are supported off-the-shelf,
	      including GIF, PNG, TIFF and JPEG. More professional
	      image formats (such as CGM) can be licensed separately.
	      Also note that most of the Netscape 4, Netscape 6 and
	      Mozilla plugins such as Flash work in DocZilla.
	    </para>
	  </sect3>
	  <sect3>
	    <title>Images as file references</title>
	    <para>
	      Some DTDs (e.g. DocBook) use so-called file references
	      instead of entity references to display graphics. It means
	      that the container element has an attribute of type CDATA
	      whose value is the system identifier of the image. This is
	      also supported in DocZilla, see the <link
		linkend="entityrc">IMAGEREF keyword in ENTITYRC
		section</link> for more information.
	    </para>
	  </sect3>
	</sect2>
	<sect2>
	  <title>XLink and HyTime links</title>
	  <para>
	    DocZilla supports the XLink standard, including extended
	    XLinks in addition to simple XLinks. The only feature that
	    is not yet supported is showing the link targets embed in
	    the document. For more information about XLinks, see
	    <ulink url="http://www.w3.org/TR/xlink/">the XLink
	    standards page</ulink>. DocZilla supports multiple
	    linkends and bidirectional links where possible.
	  </para>
	  <sect3 id="xlinkcontrol">
	    <title>
	      Extended XLink control dialog
	    </title>
	    <para>
	      To control the memory-resident extended XLink arcs,
	      choose <computeroutput>View >
	      XLinks&hellip;</computeroutput>. The control window will
	      list each XLink rule currently in memory and allows
	      disabling and enabling them. If a large number of XLinks
	      are in memory that possibly overlap or simply have the
	      same start points, browsing may become confusing as they
	      tend to request actuation all the time.
	    </para>
	  </sect3>
	  <sect3>
	    <title>
	      HyTime support
	    </title>
	    <para>
	      A widely used subset of the HyTime standard is
	      supported: contextual links (CLINK) with nameloc,
	      treeloc and queryloc addressing included. Also, HyNames
	      attribute is supported to activate hyperlinks in
	      DocZilla for any DTD.
	    </para>
	  </sect3>
	</sect2>
	<sect2>
	  <title>XML base</title>
	  <para>
	    DocZilla supports the XML Base feature. Any XML element
	    can contain the special XML namespace attribute
	    <computeroutput>xml:base</computeroutput>. The value of
	    that attribute will be used as the base URL of any
	    relative links located in the DOM tree below the element
	    contains the XML base URL. See <ulink
	    url="http://www.w3.org/TR/xmlbase/">the XML Base page on
	    the W3C site</ulink> for more information.
	  </para>
	</sect2>
	<sect2>
	  <title>Scripting documents</title>
	  <para>
	    DocZilla provides support for scripting languages to run
	    external program code in restricted environment with
	    real-time access to the document's contents and the DTD.
	    The scripting framework is based on the Mozilla's
	    XPConnect facility that enables scripting of theoretically
	    all of the native code. So far, JavaScript support is
	    complete and included in DocZilla.<footnote><para>As an
	    example of flexibility of the Mozilla's XPConnect
	    framework, there is e.g. a third-party project to enable
	    XPConnect bindings for the Python language. (The
	    developers are not affiliated with Citec and the bindings
	    are not, to our knowledge, production-ready.)</para>
	    </footnote>
	  </para>
	  <sect3>
	    <title>Attaching scripts to documents</title>
	    <para>
	      There are two ways to attach external scripts to
	      documents. One is a processing instruction and the other
	      is via ENTITYRC. The latter is feature-wise analogous to
	      the first method and it's syntax is described in the
	      <link linkend="entityrc">ENTITYRC chapter</link>. Also,
	      it's possible to include snippets of JavaScript inside
	      the document.
	    </para>
	    <para id="javascriptpi">
	      The syntax of the processing instruction is:
	      <example>
		<title>
		  JavaScript processing instruction
		</title>
		<literallayout>&lt;?mde-javascript href="URL"?></literallayout>
	      </example>
	      The value of the pseudo-attribute href is a URL to the
	      text file containing the JavaScript to be evaluated.
	    </para>
	    <para>
	      If you include the HTML namespace in your XML document,
	      you can use the HTML
	      <computeroutput>SCRIPT</computeroutput> element to
	      contain your code. Also, an easy way to trigger
	      evaluation of short JavaScript code when the user
	      presses a button or clicks on a link is to make the
	      element a link pointing to a
	      <computeroutput>javascript</computeroutput> pseudo-URL.
	      The URL looks like <computeroutput>javascript:code
	      here;</computeroutput> and the JavaScript code right
	      from the first colon will be executed the link is
	      triggered.
	    </para>
	  </sect3>
	  <sect3>
	    <title>The environment and interfaces</title>
	    <para>
	      As for the scripting environment, DocZilla should be
	      familiar to all those who know JavaScript and DOM as
	      implemented in regular browsers like Mozilla, Opera and
	      mostly in Internet Explorer too. There are <ulink
	      url="http://www.mozilla.org/docs/dom/mozilla/">plenty</ulink>
	      of <ulink
	      url="http://developer.netscape.com/docs/manuals/js/core/jsref15/contents.html">references</ulink>
	      and <ulink
	      url="http://www.xs4all.nl/~ppk/js/dom1.html">tutorials</ulink>
	      on the <ulink
	      url="http://www.xs4all.nl/~ppk/js/version5.html">subject</ulink>.
	    </para>
	  </sect3>
	</sect2>
      </sect1>
      
      <sect1 id="features-misc">
	<title>Special features</title>
	<sect2>
	  <title>CATALOG file</title>
	  <para>
	    The catalog parser in DocZilla implements the most common
	    entries in the catalog file format, as described in <ulink
	    url="http://www.oasis-open.org/specs/a401.htm">Oasis-Open
	    entity management page</ulink>. The supported entries are
	    <ulink url="http://www.jclark.com/sp/catalog.htm">as
	    listed on the SP website</ulink>. Any entry that affects
	    the direct loading of the SGML entities and other catalog
	    files are in effect. Also entities and notations are
	    resolved with the help of any additional information in
	    the catalogs.
	  </para>
	  <para>
	    The most important rules only are listed here:
	  </para>
	  <variablelist>
	    <varlistentry>
	      <term>
		<computeroutput>PUBLIC "publicid"
		  "systemid"</computeroutput>
	      </term>
	      <listitem>
		<para>
		  Maps a given public identifier to a system
		  identifier.
		</para>
	      </listitem>
	    </varlistentry>
	    <varlistentry>
	      <term>
		<computeroutput>ENTITY "name" "publicid"
		  ["systemid"]</computeroutput>
	      </term>
	      <listitem>
		<para>
		  Maps the entity name to public identifier and
		  possibly also to a system identifier.
		</para>
	      </listitem>
	    </varlistentry>
	    <varlistentry>
	      <term>
		<computeroutput>CATALOG "href"</computeroutput>
	      </term>
	      <listitem>
		<para>
		  Loads a subsequent catalog from the URL
		  <quote>href</quote> after this catalog has been
		  processed.
		</para>
	      </listitem>
	    </varlistentry>
	    <varlistentry>
	      <term>
		<computeroutput>DOCTYPE "name" "systemid"</computeroutput>
	      </term>
	      <listitem>
		<para>
		  Maps the public identifier and possibly a system
		  identifier for the document type
		  <computeroutput>name</computeroutput>.
		</para>
	      </listitem>
	    </varlistentry>
	    <varlistentry>
	      <term>
		<computeroutput>OVERRIDE "yes|no"</computeroutput>
	      </term>
	      <listitem>
		<para>
		  While processing the catalog file, DocZilla
		  maintains an
		  <computeroutput>OVERRIDE</computeroutput> mode
		  setting. The override mode is initially false, and
		  may be changed with this keyword in the catalog
		  file. When the override mode is true
		  (<computeroutput>yes</computeroutput>),
		  <computeroutput>ENTITY</computeroutput>,
		  <computeroutput>DOCTYPE</computeroutput> and
		  <computeroutput>NOTATION</computeroutput> entries
		  will be resolved by looking up their public ID
		  whether or not an explicit system ID is present. If
		  the override mode is false, a system ID will always
		  be used if given.
		</para>
	      </listitem>
	    </varlistentry>
	    <varlistentry>
	      <term>
		SGMLDECL "sysid"
	      </term>
	      <listitem>
		<para>
		  For SGML documents, uses the SGML declaration
		  defined in <computeroutput>sysid</computeroutput>.
		  See <link linkend="appendix-sgmldecl">SGML and XML
		  declarations</link> for more information.
		</para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	</sect2>
	<sect2 id="entityrc">
	  <title>ENTITYRC file</title>
	  <para>
	    The ENTITYRC file contains DocZilla specific
	    instructions and resources to control how the document
	    is interpreted and viewed. It is thus analogous to the
	    semantics of a processing instruction in the document
	    markup. The format of the DocZilla ENTITYRC is loosely
	    based on the Synex Viewport&trade; ENTITYRC format used
	    by MultiDoc Pro &mdash; converting MDP entityrcs for
	    DocZilla shouldn't imply more than a few tweaks.
	  </para>
	  <para>
	    The ENTITYRC file consists of scope keywords and
	    instruction keywords. The scope keywords declare the
	    context to which the following instruction keywords are
	    attached. Currently there are two scope keywords,
	    <computeroutput>PUBLIC</computeroutput> and
	    <computeroutput>DOCTYPE</computeroutput>. The following
	    keywords until the next occurrence of either of those
	    two will affect documents that have that particular
	    public identifier or doctype as defined in the arguments
	    to the scope. For example:
	    <example>
	      <title>
		A sample ENTITYRC file
	      </title>
	      <literallayout>PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
    DOCTITLE "DocBook example"
    JAVASCRIPT "hello.js"</literallayout>
	    </example>
	    will set the document title that is shown in the window
	    title bar to <quote>DocBook example</quote> and load and
	    evaluate the JavaScript code in the file
	    <computeroutput>hello.js</computeroutput> only for all
	    documents whose public ID is the one of DocBook-XML
	    version 4.2.
	  </para>
	  <sect3>
	    <title>Keywords</title>
	    <para>
	      Each of the keywords accepts one or more mandatory
	      arguments and sometimes, one or more optional
	      arguments. Each keyword must be unquoted whereas each
	      argument must be enclosed in single or double quotes.
	    </para>
	    <variablelist>
	      <varlistentry>
		<term>
		  <computeroutput>ENTITYRC "href"</computeroutput>
		</term>
		<listitem>
		  <para>
		    Load a subsequent ENTITYRC file located at
		    <quote>href</quote> after this file has been
		    processed.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  <computeroutput>PUBLIC "publicid"</computeroutput>
		</term>
		<listitem>
		  <para>
		    Sets the context to the specified public
		    identifier. The following instruction keywords
		    will be taken into account for documents who
		    match the given public identifier.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  <computeroutput>DOCTYPE "doctype"</computeroutput>
		</term>
		<listitem>
		  <para>
		    Sets the context to the specified doctype. The
		    following instruction keywords will be taken into
		    account for documents whose doctype matches the
		    given <quote>doctype</quote> argument.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  <computeroutput>SDATAMAP "href"</computeroutput>
		</term>
		<listitem>
		  <para>
		    For documents in the current context, load the
		    SDATA definition file from the URL
		    <quote>href</quote>. The file will be merged to
		    the in-memory map of SDATA entities and won't be
		    loaded twice until DocZilla is restarted. Note
		    that while SDATA maps can be loaded along with any
		    document, SDATA entities are only available in
		    SGML documents. The SDATA entity definitions in
		    SDATA map file must follow the syntax defined in
		    section <link linkend="sdatamaps">SDATA
		    maps</link>.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  <computeroutput>JAVASCRIPT "href"</computeroutput>
		</term>
		<listitem>
		  <para>
		    Load JavaScript code from URL <quote>href</quote>
		    and evaluate it when the document has finished
		    loading.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry id="entityrc-doctitle">
		<term>
		  <computeroutput>DOCTITLE "string"</computeroutput>
		</term>
		<listitem>
		  <para>
		    Use <quote>string</quote> as the document title
		    which will be shown in the window title bar. If
		    <quote>string</quote> begins with the '+'
		    character (plus sign), it will be concatenated to
		    whatever the document title was set before.
		    Doctitle definitions in ENTITYRC are processed
		    before <link linkend="doctitlepi">mde-doctitle
		    processing instructions</link> in the markup
		    document.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry id="entityrc-annotation">
		<term>
		  <computeroutput>ANNOTATION "href" "type"</computeroutput>
		</term>
		<listitem>
		  <para>
		    Start loading a new annotation file from the URL
		    <quote>href</quote>. The <quote>type</quote> is
		    the type of the file at the URL
		    <quote>href</quote>: for now, it should be
		    <computeroutput>rdf</computeroutput> or
		    <quote>localdir</quote>. In the former, the
		    <quote>href</quote> points to an RDF file created
		    by DocZilla, containing the annotations and in the
		    latter case, <quote>href</quote> points to a local
		    URL that is a directory: this directory will be
		    searched for any files whose content type is
		    <computeroutput>text/rdf</computeroutput> which
		    are loaded and finally merged into one annotation
		    context. This is good if you need to easily
		    include a varying set of RDF annotation files to a
		    document. The context represents the directory and
		    is read-only, because the annotations get merged
		    together. Each of the files can be edited
		    separately if opened in the annotation editor, of
		    course.
		  </para>
		  <para>
		    The annotations &mdash;
		    assuming the file is in a format that is
		    recognized by DocZilla &mdash; will be added to
		    DocZilla's annotation facility and if any
		    annotations point to the upcoming markup document,
		    they will be displayed in it. See <link
		    linkend="annotations">Annotations</link> for more
		    information.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  <computeroutput>IMAGEREF "spec1 [spec2 [&hellip; specN]]]"</computeroutput>
		</term>
		<listitem>
		  <para>
		    This sets up image reference specifications for
		    the document. Image reference specifications are
		    element-attribute tuples which are treated
		    specially in DocZilla. The syntax of a single
		    spec is:
		    <example>
		      <title>
			Imageref tuple specification syntax
		      </title>
		      <literallayout>element-name[attribute-name]</literallayout>
		    </example>
		    Any number of specs may be defined in a single
		    IMAGEREF entry, separated with space characters.
		    Given a IMAGEREF spec, if the element in
		    questions contains the appropriate attribute,
		    the value of that attribute is treated as if it
		    was the system identifier of an external
		    unparsed entity, an image, attached to the
		    element.
		    <example>
		      <title>
			These two markups produce the same display
		      </title>
		      <literallayout>&lt;!-- In DTD subset: -->
&lt;!NOTATION jpeg SYSTEM "doczilla:image">
&lt;!ENTITY foobar SYSTEM "image.jpg" NDATA jpeg>
&lt;!ATTLIST graphic image ENTITY #IMPLIED>
&hellip;
&lt;graphic image=foobar></literallayout>
		      <para>
			versus
		      </para>
		      <literallayout>&lt;!-- In ENTITYRC: -->
IMAGEREF "graphic[image]"
&hellip;
&lt;graphic image="image.jpg"></literallayout>
		    </example>
		    Note that using image references instead of
		    entities is conceptually wrong: it hardcodes
		    direct references to data files into the document
		    itself where the SGML-way &mdash; that is, using
		    entities &mdash; enables a multi-layer, platform
		    independent resolution of the final location of
		    the data file in question.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  <computeroutput>STYLESPEC "name" "href" "type" ["alternate"]</computeroutput>
		</term>
		<listitem>
		  <para>
		    This keyword allows attaching stylesheets to
		    documents. The parameters are semantically similar
		    to the
		    <computeroutput>xml-stylesheet</computeroutput> or
		    <computeroutput>mde-stylesheet</computeroutput>
		    <link linkend="stylepi">processing
		    instructions</link> except that since the leftmost
		    arguments are always required, an empty title must
		    be denoted as <computeroutput>""</computeroutput>
		    (a double-quoted zero-length string). Also, the
		    alternativeness of a stylesheet is implied by
		    using the optional argument
		    <quote>alternate</quote> whose value is always the
		    string literal <quote>alternate</quote>.
		    <example>
		      <title>
			Stylesheets in ENTITYRC
		      </title>
		      <literallayout>DOCTYPE doc
STYLESPEC "" "basic.css" "text/css"
STYLESPEC "Fancy" "another.css" "text/css" "alternate"</literallayout>
		    </example>
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  <computeroutput>TOC "title" "href" ["type" ["persist" ["name" ["open-to-depth"]]]]</computeroutput>
		</term>
		<listitem>
		  <para>
		    This entry will attach the given Table of Contents
		    file (TOC) to the document. The arguments are
		    semantically similar to the <link
		    linkend="tocpi">TOC processing instruction</link>.
		    The value of the <quote>persist</quote> argument
		    should be either the string literal
		    <quote>sticky</quote> or <quote>permanent</quote>.
		    The <quote>name</quote> argument is the name for
		    <link linkend="subtocs">sub TOC
		    construction</link> and the value of the
		    <quote>open-to-depth</quote> argument should be a number
		    greater than or equal to zero. If any of the
		    arguments should be left unset, just use an empty
		    string ("") instead.
		    <example>
		      <title>
			A sample ENTITYRC for loading TOCs
		      </title>
		      <literallayout>PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
    TOC "List of Figures" "doc2figures.xml" "text/xsl" "" "" "1"</literallayout>
		    </example>
		    In this example, all DocBook XML documents will
		    get a TOC named <quote>List of Figures</quote>.
		    The TOC uses XSLT to presumably compile a list of
		    tocitems that point to all the images found in the
		    document.
		  </para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  </sect3>
	</sect2>
	<sect2 id="sdatamaps">
	  <title>SDATA maps</title>
	  <para>
	    SDATA maps define SGML SDATA entities. An initial
	    <computeroutput>sdata.map</computeroutput> file is
	    automatically loaded when DocZilla needs to resolve a
	    SDATA entity for the first time, and the initial map can
	    be augmented by loading further SDATA entity definitions
	    from a <link linkend="entityrc">custom map file via
	    ENTITYRC</link>.
	  </para>
	  <para>
	    The format of an SDATA map file as supported by DocZilla
	    is described as follows:
	    <example>
	      <title>
		SDATA map syntax
	      </title>
	      <literallayout>SDATA "[name]" "value"</literallayout>
	      <para>
		At any point on a line, a "#" (hash sign) begins a
		comment which ends at the end of the line. The
		<quote>name</quote> is the name of the entity,
		enclosed first in square bracket and then in double
		quotes. The <quote>value</quote> is either a decimal
		or a hexadecimal number, denoted in C-language fashion
		where hexadecimal values begin with "0x". Here are
		excerpts from DocZilla's default SDATA map file, that
		contains the ISO character entity character codes for
		SGML documents:
	      </para>
	      <literallayout>SDATA "[aacute]" "225" #     a acute
SDATA "[Aacute]" "193" #     A acute
SDATA "[Alpha ]" "0x0391" #
SDATA "[Beta  ]" "0x0392" #</literallayout>
	      <para>
		Note that e.g. the FDATA definitions are ignored.
		DocZilla is based on Unicode and the SDATA entities
		are mapped directly to Unicode letters, based on their
		values. It's up to the operating system then to load
		and enable the right font to make the available the
		glyphs requested in the character codes.
	      </para>
	    </example>
	  </para>
	</sect2>
	<sect2 id="notes-httpcontenttype">
	  <title>HTTP server configuration</title>
	  <para>
	    For HTTP connections, DocZilla relies on the server to
	    announce a proper content type for each file that it
	    downloads. If the server is misconfigured, it may return
	    false defaults for known file type, e.g. the type
	    <computeroutput>text/plain</computeroutput> or
	    <computeroutput>application/octet-stream</computeroutput>for
	    CSS files, which should be of the type
	    <computeroutput>text/css</computeroutput>. The result is
	    that DocZilla will see that there's no
	    <computeroutput>text/css</computeroutput> available when
	    it tries to load a CSS stylesheet and then ignores the
	    request.
	  </para>
	  <para>
	    The server should be set to return the content types for
	    different files as follows:
	  </para>
	  <variablelist>
	    <varlistentry>
	      <term>
		<computeroutput>text/sgml</computeroutput>
	      </term>
	      <listitem>
		<para>
		  for SGML files
		</para>
	      </listitem>
	    </varlistentry>
	    <varlistentry>
	      <term>
		<computeroutput>text/xml</computeroutput>
	      </term>
	      <listitem>
		<para>
		  for XML files, XML TOC files, XSL stylesheets, RDF
		  files (the default <link
		  linkend="annotations">annotation</link> format) etc.
		  Note that the content type
		  <computeroutput>text/xsl</computeroutput> does not
		  exist, XSL is the semantic file type but the primary
		  type is still
		  <computeroutput>text/xml</computeroutput> which is
		  needed for DocZilla to know that the file should be
		  fed to its XML parser.
		</para>
	      </listitem>
	    </varlistentry>
	    <varlistentry>
	      <term>
		<computeroutput>text/css</computeroutput>
	      </term>
	      <listitem>
		<para>
		  for CSS files. Some HTTP servers send CSS files as
		  <computeroutput>text/plain</computeroutput> which
		  is reserved for a generic text file.
		</para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	</sect2>
	<sect2 id="misc-opentodepth">
	  <title>TOC open-to-depth parameter</title>
	  <para>
	    The default value for this parameter comes initially from
	    the user preferences. That value will be overridden by the
	    value of an
	    <computeroutput>open-to-depth</computeroutput> attribute
	    in the <computeroutput>toc</computeroutput> element of the
	    TOC file. The resulting value will be ultimately overriden
	    by a open-to-depth value defined in the TOC <link
	    linkend="tocpi">processing instruction</link> or in the
	    equivalent ENTITYRC entry, if either is present.
	  </para>
	  <para>
	    A notable exception is that the user is able to set the
	    priority of the open-to-depth user preference to the
	    highest possible, thus overriding both PI/ENTITYRC value
	    and the attribute value in TOC.
	  </para>
	</sect2>
	<sect2 id="features-misc-images">
	  <title>Advanced image decoder</title>
	  <para>
	    The DocZilla advanced image decoder provides support for
	    bitmap image decoding modules. Currently the <ulink
	    url="http://www.libtiff.org/">libtiff</ulink> TIFF library
	    is implemented as one, both because TIFF is a widely used
	    format in technical documentation and also as a
	    proof-of-concept implementation. We also have a test
	    implementation that utilizes a generic commercial image
	    decoder library that supports dozens of formats and made
	    them all available in DocZilla. For example, that library
	    &mdash; or any other for that matter &mdash; can be
	    implemented in DocZilla per customer request.
	  </para>
	</sect2>
	<sect2 id="misc-ndata">
	  <title>NDATA handling in DocZilla</title>
	  <para>
	    The way how DocZilla handles non-SGML data in external
	    unparsed entities is configurable and comes with
	    reasonable defaults that can be changed by the user. The
	    rules in the document environment override the default
	    values.
	  </para>
	  <para>
	    DocZilla supports a few internal system identifiers for
	    notations. If an entity has the NDATA set to a notation
	    name, then one of the following possibilities will occur
	    based on the system identifier of the notation:
	    <variablelist>
	      <varlistentry>
		<term>
		  For <computeroutput>doczilla:image</computeroutput>:
		</term>
		<listitem>
		  <para>
		    Tries to display the entity as an image: if the
		    image format is not supported or the entity is not
		    an image, nothing will be displayed.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  For <computeroutput>doczilla:embed</computeroutput>:
		</term>
		<listitem>
		  <para>
		    Tries to display the entity in a frame that is
		    embed to the document. The frame works similarly
		    to the view area in the DocZilla Browser's window
		    and should be able to display any file that
		    DocZilla itself is able display.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  For <computeroutput>doczilla:plugin</computeroutput>:
		</term>
		<listitem>
		  <para>
		    DocZilla will search for a plugin library that
		    would be capable of displaying the entity. If one
		    is found, the plugin will show the entity file
		    inside the element.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  For <computeroutput>doczilla:autolink</computeroutput>:
		</term>
		<listitem>
		  <para>
		    DocZilla will generate a little icon to represent
		    the entity. Clicking on the icon will trigger a
		    hyperlink to the entity file which will then
		    replace the current document, provided that
		    DocZilla is capable of displaying the entity in
		    the first place.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  For explicit
		  <computeroutput>doczilla:ignore</computeroutput>:
		</term>
		<listitem>
		  <para>
		    DocZilla will silently ignore all occurrences of
		    this entity when referred in entity attributes.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  For
		  <computeroutput>doczilla:default</computeroutput> or
		  <computeroutput>""</computeroutput> (empty string or
		  unset value):
		</term>
		<listitem>
		  <para>
		    DocZilla will utilize the notation
		    name&mdash;system identifier mappings in the
		    preferences file to determine the correct system
		    identifier. If none is found, DocZilla will fall
		    back to unknown system identifier, which is
		    described in the next entry.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>
		  Anything else
		</term>
		<listitem>
		  <para>
		    will be considered unknown, and a proper
		    explanation content is automatically generated in
		    the document. The content will also act as a
		    hyperlink to the entity in question. This
		    behaviour may be suppressed to silent ignorance by
		    setting the appropriate preference item in the
		    <link linkend="prefswindow">Preferences
		    window</link>.
		  </para>
		</listitem>
	      </varlistentry>
	    </variablelist>
	  </para>
	  <para>
	    It's possible to set the dimensions of an image, plugin or
	    an embed frame. To do this, define notation attributes
	    <computeroutput>width</computeroutput> and/or
	    <computeroutput>height</computeroutput>, and set their
	    default value to the desired size of the displayed NDATA
	    entity. You can override those values with setting the
	    attribute values for one entity in its declaration. The
	    values can be written in pixels or percents.
	    <example>
	      <title>
		Example: To set the dimensions of displayed NDATA entities
	      </title>
	      <literallayout>&lt;!NOTATION jpeg SYSTEM "doczilla:default">
&lt;!ATTLIST #notation jpeg
    width CDATA "100%"
    height CDATA #IMPLIED
>
&lt;!ENTITY first SYSTEM "first.jpg">
&lt;!ENTITY foobar SYSTEM "image.jpg" [ width="300" height="300" ]></literallayout>
	    </example>
	    This code will display the image
	    <computeroutput>first.jpg</computeroutput> page-wide,
	    depending on the width of the window. (The width is always
	    100% of the available space and the height will adjust
	    according to the aspect ratio as it's not fixed.) The
	    second image will be fixed at the size of 300 per 300
	    pixels.
	  </para>
	  <sect3>
	    <title>
	      Configuring NDATA handling as a user
	    </title>
	    <para>
	      The DocZilla preferences contains mappings of notation
	      names to the special system identifiers. See <link
		linkend="prefs-ndata">appropriate preferences
		panel</link>.
	    </para>
	  </sect3>
	  <sect3>
	    <title>Configuring NDATA handling as the author</title>
	    <para>
	      The above was a user-side configuration. You can of
	      course set the system identifier in a markup
	      declaration, too. Consider that you want to display some
	      smaller TIFF images as usual but link to the huge ones,
	      you can use a new notation for huge TIFFs:
	      <example>
		<title>
		  NDATA authoring in DTD
		</title>
		<literallayout>&lt;!NOTATION hugetiff SYSTEM "doczilla:autolink">
&lt;!NOTATION tiff SYSTEM "doczilla:default">
&lt;!ENTITY mapofworld SYSTEM "huge/map.tiff" NDATA hugetiff></literallayout>
	      </example>
	      Then, DocZilla will use the user's preference for
	      <computeroutput>NDATA "tiff"</computeroutput> which
	      defaults to
	      <computeroutput>doczilla:image</computeroutput> and
	      display icons for those entities that were declared to
	      be of the type
	      <computeroutput>hugetiff</computeroutput>.
	    </para>
	    <para>
	      Note that the system identifier of the notation may well
	      be referenced using a public ID which would then be
	      resolved using catalog files. In fact, this is the
	      recommended way. Using system IDs directly in notation
	      declarations reduces flexibility.
	    </para>
	  </sect3>
	</sect2>
	<sect2>
	  <title>CGM hotspots</title>
	  <para>
	    The <ulink url="http://www.sdicgm.com/">SDI CGM Reader
	    plugin</ulink> supports dynamic hotspots with DocZilla.
	    Besides viewing CGM images with existing hotspots defined
	    in the image data, it's possible to dynamically point to a
	    hotspot region inside the CGM image.
	  </para>
	  <para>
	    The documentation for this feature is currently not
	    written yet, as of 2.7pre1.<!-- FIXME: Full screen CGM
	    hotspot integration code not in the 2.7pre1 yet!! -->
	  </para>
	</sect2>
      </sect1>
    </chapter>
    
    <!--                                                                 -->
    <!--                      Back matter                                -->
    <!--                                                                 -->
    <appendix id="appendix-tocdtd">
      <title>
	DocZilla TOC DTD
      </title>
      <para>
	The DocZilla TOC DTD consists of three main elements,
	<computeroutput>toc</computeroutput>,
	<computeroutput>tocitem</computeroutput> and
	<computeroutput>link</computeroutput>. The markup for tocitem
	targets is a subset of the markup specified in the XLink
	standard<footnote><simpara>As a technical note: It was one of
	the early ideas in development of DocZilla to accept any XML
	document containing XLinks as the TOC file. This feature won't
	be implemented until an implementation of modular TOC loader
	backends is written.</simpara></footnote>. The attribute
	<computeroutput>xml:base</computeroutput> is supported for TOC
	files.
      </para>
      <programlisting>&tocdtd;</programlisting>
    </appendix>
    
    <appendix id="appendix-ui">
      <title>
	User Interface Reference
      </title>
      <table>
	<title>
	  Key to menus
	</title>
	
	<textobject>
	  <note>
	    <para>
	      Note that the table below lists those DocZilla specific
	      menu entries only that are not included in the standard
	      Mozilla Browser distribution. Many of the omitted menu
	      entries are self-explanatory and more Mozilla
	      documentation is available on the <ulink
	      url="http://www.mozilla.org/">Mozilla Foundation</ulink>
	      home page.
	    </para>
	  </note>
	</textobject>
	
	<!-- Include the horribly large table from this external
	parsed entity text -->
	&uiref;
      </table>
    </appendix>
    
    <appendix id="appendix-sgmldecl">
      <title>
	SGML and XML declarations
      </title>
      <para>
	When loading SGML documents, if no SGML declaration is defined
	in the catalogs via the SGMLDECL keyword then a default
	declaration <ulink
	url="http://www.jclark.com/sp/sgmldecl.htm">similar to in
	OpenSP</ulink> is in effect.
      </para>
      <para>
	When loading an XML document, the <ulink
	url="resource:///res/doczilla/xml.decl">following SGML
	declaration</ulink> is automatically applied before any
	declarations in the catalogs. This is because XML is well
	defined in terms of an SGML declaration and needs not be
	changed.
      </para>
    </appendix>
    
    <!-- Comment this one out if no time to finish it up! -->
    <!--
    <bibliography>
      <title>Bibliography</title>
      <biblioentry>
	<title>
	  FIXME
	</title>
      </biblioentry>
    </bibliography>
    -->
  </book>
</set>
