瀏覽代碼

New Docbook processing system.

This is the new and improved version of the docbook build system that
was present in ser and kamailio. It consists of Makefiles, xslt
stylesheets, css stylesheets, and other auxiliary files that are needed
to convert documentation stored in docbook xml format to various output
formats. We currently support the following outputs: HTML, plain-text,
and module README. Other formats (man pages, chunked HTML and possibly
PDF) will be added later.

First of all, we are moving all files that are part of the docbook
processing system into one directory "docbook". Those files were
previously scaterred across multiple directories in the repository and
having them all at one place make the system less error-prone.

We have merged files containing SGML entity definitions from both
projects into a single file. The file is stored in docbook/entities.xml
and this is the file that should be included by all docbook documents
(we will need to update all such files in all modules).

The Kamailio CSS style sheet for module documentation is now becoming
the main CSS stylesheet for HTML documentation generated from docbook
sources. The new stylesheet is stored in docbook/sr-doc.css. The
contents of the file was slighlty updated to make sure that the styles
in the file match HTML elements in XHTML output. With the new system
the default output HTML flavor is XHTML.

The toplevel Makefile.doc is gone. It is being replaced by file
docbook/Makefile. The new makefile has been extensively polished and
improved. This also requires new Makefiles in modules. All the targets
and references that were used to generate the PDF output in SER are
gone, we were using proprietary FOP processor which is not generally
available. All configuration options that can be overriden from
module/doc Makefiles are extensively commented. The new Makefile can
save the  output being generated into a directory specified on the
command line:
  $ output_dir=/html make html
The default target of the Makefile is HTML. There is a new target that
can be used generate module README:
  $ make readme

The file that should be included from module Makefiles is
docbook/Makefile.modules. At present the file only includes the main
Makefile, but in the future some of the targets that are particular
to module documentation will be moved to this file.

The XML catalog received a small facelift, too. By default the catalog
references /etc/xml/catalog. References to dbschema DTD and XSL files
(dbschema is the scripting system used to generate SQL files in SER)
are gone. They do not belong into this file.

All references to Drupal and drupal related xsl stylesheets are gone.
Those files were used to generate HTML files suitable for inclusion
into Drupal pages at iptel.org.

File doc/kam_module_faq.xml has also been removed, this file was empty,
it was probably added because it was included by far too many docbook
documents in modules. Since I wrote a script to do some compatibility
changes in module docbook files, I taught it to remove the reference
to the file from all docbook files and then deleted the file.

All files in directory "docbook" are briefly described in
docbook/README.

The new system adopted Kamailio costumizations of the docbook stylesheet
that is used to generate READMEs. There is a new stylesheet called
readme.xsl that contains all options that should only be applied when
READMEs are being generated.

The stylesheet that generates man pages from docbook has been moved
from doc/stylesheets to docbook/man.xsl. We do not have yet support for
man pages in the docbook Makefile, this feature will be added later.

New features:
  * Automatic dependency calculation. We have a XSL stylesheet which
    traverses the source docbook document and produces a list of files
    included in the document. This list is then included in the main
    Makefile to calculate dependencies. That means you can split your
    document into multiple files and the system will always correctly
    rebuild the file.

  * Support for document inclusion with xi:include. All source docbook
    files are processed with the support for xi:include enabled which
    makes it possible to include other documents without the need to
    use SGML entities to include external files.

  * Improved top level make file, among other things the makefile is now
    much more flexible, the module can specify different source document
    for each type of produced output. The makefile can generate module
    READMEs. The output directory is configurable, which is useful if you
    need to build a collection of html pages to be uploaded to a server.

  * Separate stylesheet to customize the format of module README files.

  * Supported output formats:
    README
    XHTML (single file)
    XHTML (multiple files)
    Plain-text

  * Normalized screens: There is no longer the need to pay attention to
    the leading and trailing white space in data of <screen> (and similar)
    elements. Stylesheet common.xsl contains a template that does that
    automatically (this isn't really a new feature, is was present in
    the original ser docbook processing system).
Jan Janak 16 年之前
父節點
當前提交
5bc53be47a

+ 0 - 188
Makefile.doc

@@ -1,188 +0,0 @@
-#
-# $Id$
-#
-
-#
-# The name of the index file (the one which will be built by default
-# without specifying a target
-#
-DOCUMENTS ?= index
-
-#
-# The root of the document tree, this is used to determine the directory
-# of auxiliary files. The variable should be overwritten by per-directory
-# Makefiles
-#
-ROOT_DIR ?= ../../..
-COREPATH  ?=$(ROOT_DIR)
-
-#
-# Output directory where files produced by XSL stylesheets should be stored,
-# by default we output to the same directory, documents that are chunked may
-# choose to override this to write all chunks in a subdirectory instead
-#
-OUTPUT_DIR ?= .
-
-#
-# Stylesheet used to generate dependencies from XML files
-#
-DEP_XSL ?= $(ROOT_DIR)/doc/stylesheets/dep.xsl
-
-#
-# Default stylesheet used to generate XHTML
-#
-XHTML_XSL ?= $(ROOT_DIR)/doc/stylesheets/xhtml.xsl
-
-#
-# Default stylesheet used to generate Drupal HTML without html headers
-#
-DRUPAL_XSL ?= $(ROOT_DIR)/doc/stylesheets/drupal.xsl
-
-#
-# Default stylesheet used to generate HTML
-#
-HTML_XSL ?= $(ROOT_DIR)/doc/stylesheets/html.chunked.xsl
-
-#
-# Stylesheet used to generate plain text documents,
-# this is usually the one used for xhtml
-#
-TXT_XSL ?= $(ROOT_DIR)/doc/stylesheets/txt.xsl
-
-#
-# Stylesheet used to generate FO (Formatted Objects)
-# This is used by PDF generators
-#
-FO_XSL ?= $(ROOT_DIR)/doc/stylesheets/fo.xsl
-
-#
-# Disable document validation by default
-# 
-VALIDATE ?= 0
-
-#
-# K docbook style
-#
-ifeq ($(DOCBOOK_MODE), k)
-	HTML_CSS=/css/kam-module-docbook.css
-	XSLTPROC_FLAGS+= --stringparam section.autolabel 1 \
-				--stringparam section.label.includes.component.label 1 \
-				--stringparam generate.toc "book toc,title,figure,table,example"
-endif
-
-#
-# Default CSS used in generated HTMLs
-#
-HTML_CSS ?= ser.css
-
-CATALOG=$(ROOT_DIR)/doc/catalog.xml
-
-LYNX     ?= lynx
-DIA      ?= dia
-XSLTPROC ?= xsltproc
-XMLLINT ?= /usr/bin/xmllint
-XEP     ?= /usr/bin/xep
-
-LYNX_FLAGS     ?= -nolist
-DIA_ARGS       ?=
-XSLTPROC_FLAGS ?=
-XMLLINT_FLAGS ?= --xinclude --postvalid --noout
-XEP_FLAGS ?= 
-
-ifeq ($(VALIDATE), 0)
-	override XSLTPROC_FLAGS := $(XSLTPROC_FLAGS) --novalid
-endif
-
-alldep = Makefile $(ROOT_DIR)/Makefile.doc $(DEP_XSL) $(EXTRA_DEPS)
-
-all: xhtml
-
-xml_files = $(addsuffix .xml, $(DOCUMENTS))
-dep_files = $(addsuffix .d, $(DOCUMENTS))
-xhtml_files = $(addsuffix .xhtml, $(DOCUMENTS))
-html_files = $(addsuffix .html, $(DOCUMENTS))
-txt_files = $(addsuffix .txt, $(DOCUMENTS))
-pdf_files = $(addsuffix .pdf, $(DOCUMENTS))
-
-xhtml: $(xhtml_files)
-html: $(html_files)
-txt: $(txt_files)
-pdf: $(pdf_files)
-drupal: override HTML_XSL := $(DRUPAL_XSL)
-drupal: $(html_files)
-
-
-%.xhtml: %.xml %.d $(alldep) $(XHTML_XSL)
-	XML_CATALOG_FILES=$(CATALOG) $(XSLTPROC) $(XSLTPROC_FLAGS) \
-        --xinclude \
-        --stringparam base.dir "$(OUTPUT_DIR)/" \
-        --stringparam root.filename "$(basename $<)" \
-        --stringparam html.ext ".xhtml" \
-        --stringparam html.stylesheet $(HTML_CSS) \
-        $(XHTML_XSL) $<
-
-%.html: %.xml %.d $(alldep) $(HTML_XSL)
-	XML_CATALOG_FILES=$(CATALOG) $(XSLTPROC) $(XSLTPROC_FLAGS) \
-        --xinclude \
-        --stringparam base.dir "$(OUTPUT_DIR)/" \
-        --stringparam root.filename "$(basename $<)" \
-        --stringparam html.ext ".html" \
-        --stringparam html.stylesheet $(HTML_CSS) \
-        $(HTML_XSL) $<
-
-%.fo: %.xml $(alldep) $(FO_XSL)
-	XML_CATALOG_FILES=$(CATALOG) $(XSLTPROC) $(XSLTPROC_FLAGS) \
-        --xinclude \
-        -o $@ $(FO_XSL) $<
-
-%.pdf: %.fo %.d $(alldep)
-	$(XEP) $(XEP_FLAGS) -fo $< -pdf $@
-
-%.txt: %.xml %.d $(alldep)
-	XML_CATALOG_FILES=$(CATALOG) $(XSLTPROC) $(XSLTPROC_FLAGS) \
-        --xinclude \
-        $(TXT_XSL) $< | $(LYNX) $(LYNX_FLAGS) -stdin -dump > $@
-
-%.png: %.dia $(alldep)
-	$(DIA) $(DIA_ARGS) -t png -e $@ $<
-
-%.d: %.xml $(alldep) 
-	$(XSLTPROC) $(XSLTPROC_FLAGS) \
-        --nonet \
-        --novalid \
-        --stringparam output "$@" \
-        $(DEP_XSL) $< 
-
-.PHONY: check
-check: $(xml_files)
-	XML_CATALOG_FILES=$(CATALOG) $(XMLLINT) $(XMLLINT_FLAGS) $<
-
-.PHONY: clean
-clean:
-	@rm -f $(txt_files)
-	@rm -f $(xhtml_files)
-	@rm -f $(pdf_files)
-	@rm -f $(html_files)
-
-.PHONY: proper distclean realclean maintainer-clean
-proper realclean distclean maintainer-clean: clean
-	@rm -f $(dep_files) *~
-
-maintainer-clean: clean-tmp
-
-.PHONY: clean-tmp
-clean-tmp:
-	-rm -f TAGS tags *.dbg .*.swp
-
-
-
-ifeq (,$(MAKECMDGOALS))
-include $(dep_files) 
-else
-ifeq (,$(strip $(nodep_targets)))
-include $(COREPATH)/Makefile.targets
-endif
-ifneq (,$(filter-out $(nodep_targets) check, $(MAKECMDGOALS)))
-include $(dep_files)
-endif
-endif

+ 0 - 53
doc/catalog.xml

@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
-         "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
-<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
-
-    <!-- DTDs and XSL stylesheets for DBSchema are bundled with SER
-         so we will just redirect xsltproc to their location in the
-	 source tree
-      -->
-    <public publicId="-//iptel.org//DTD DBSchema V1.0//EN"
-            uri="stylesheets/dbschema/dtd/dbschema.dtd"/>
-
-    <rewriteURI uriStartString="http://iptel.org/dbschema/xsl/current/"
-                rewritePrefix="stylesheets/dbschema/xsl/"/> 
-
-    <!-- Uncomment the following entry if you have docbook DTDs in unusual
-         location or if you would like to validate the documentation against
-	 newer docbook version
-      -->
-    <!--
-    <public publicId="-//OASIS//DTD DocBook XML V4.3//EN"
-            uri="file:///home/janakj/docbook/dtd/docbookx.dtd"/>
-      -->
-
-    <!-- Uncomment the following entry if you have docbook XSL stylesheets
-         in unusual location, the value of rewritePrefix parameter should
-	 point to the top level directory of your XSL stylesheets
-      -->
-    <!--
-    <rewriteURI uriStartString="http://docbook.sourceforge.net/release/xsl/current/"
-                rewritePrefix="file:///home/janakj/docbook/xsl/"/>
-      -->
-
-    <!-- Try the system wide catalogs as the last step before reverting
-         to using the value of system identifiers and URI references
-	 from the documents being processed (they usualy contain HTTP
-	 URIs).
-      -->
-    <delegatePublic publicIdStartString="" catalog="file:///etc/xml/catalog"/>
-    <delegateURI    uriStartString=""      catalog="file:///etc/xml/catalog"/>
-
-    <!-- If xsltproc gets here while searching the catalog then no entry was
-         found in the catalog files for the requested resource and in this case
-	 xsltproc will attempt to download the resource from the internet using
-	 the HTTP protocol. It will use the HTTP URIs from system identifiers
-	 and URI references (therefore the XSL customization stylesheets in SER
-	 refer to the original XSL stylesheets using HTTP URIs).
-
-	 Note: Downloading DTDs and XSL stylesheets can be very slow, because
-	       each file will be downloaded several times, because xsltproc
-	       does not cache downloaded files.
-      -->
-</catalog>

+ 0 - 0
doc/kam_module_faq.xml


+ 0 - 48
doc/ser_entities.xml

@@ -1,48 +0,0 @@
-<!-- $Id$ -->
-
-<!-- Entities often used in the documentation -->
-
-<!ENTITY fhg "FhG FOKUS">
-<!ENTITY iptel "<ulink url='http://iptel.org'>iptel.org</ulink>">
-<!ENTITY ser "SER">
-<!ENTITY sername "SIP Express Router">
-
-<!ENTITY serhome "http://iptel.org/ser">
-<!ENTITY serbugs "http://iptel.org/ser/bugs">
-<!ENTITY serusers "http://mail.iptel.org/mailman/listinfo/serusers">
-<!ENTITY serdev "http://mail.iptel.org/mailman/listinfo/serdev">
-
-<!ENTITY serhomelink "<ulink url='&serhome;'>&serhome</ulink>">
-<!ENTITY serbugslink "<ulink url='&serbugs;'>&serbugs</ulink>">
-<!ENTITY seruserslink "<ulink url='&serusers;'>&serusers</ulink>">
-<!ENTITY serdevlink "<ulink url='&serdev;'>&serdev</ulink>">
-
-<!ENTITY serusersmail "<email>[email protected]</email>">
-<!ENTITY serdevmail "<email>[email protected]</email>">
-
-<!-- Often used acronyms -->
-
-<!ENTITY sip "<acronym>SIP</acronym>">
-<!ENTITY sdp "<acronym>SDP</acronym>">
-<!ENTITY rtp "<acronym>RTP</acronym>">
-<!ENTITY pstn "<acronym>PSTN</acronym>">
-<!ENTITY http "<acronym>HTTP</acronym>">
-<!ENTITY uri "<acronym>URI</acronym>">
-<!ENTITY url "<acronym>URL</acronym>">
-<!ENTITY uac "<acronym>UAC</acronym>">
-<!ENTITY uas "<acronym>UAS</acronym>">
-<!ENTITY ua "<acronym>UA</acronym>">
-<!ENTITY nat "<acronym>NAT</acronym>">
-<!ENTITY ip "<acronym>IP</acronym>">
-<!ENTITY udp "<acronym>UDP</acronym>">
-<!ENTITY ietf "<ulink url='http://www.ietf.org'>IETF</ulink>">
-<!ENTITY im "<acronym>IM</acronym>">
-<!ENTITY smtp "<acronym>SMTP</acronym>">
-<!ENTITY gnu "<ulink url='http://www.gnu.org'>GNU</ulink>">
-<!ENTITY gpl "<ulink url='http://www.gnu.org/licenses/licenses.html#GPL'>GPL</ulink>">
-
-<!-- Often used RFCs -->
-
-<!ENTITY rfc3261 "<ulink url='http://www.ietf.org/rfc/rfc3261.txt'>RFC3261</ulink>">
-<!ENTITY rfc822 "<ulink url='http://www.ietf.org/rfc/rfc822.txt'>RFC822</ulink>">
-<!ENTITY rfc2543 "<ulink url='http://www.ietf.org/rfc/rfc2543.txt'>RFC2543</ulink>">

+ 0 - 53
doc/stylesheets/README

@@ -1,53 +0,0 @@
-Description of files in this directory:
-
-* common.xsl:
-     Customization regardless of output format. This file contains,
-     for example, XSL code that strips leading and trailing
-     whitespace from screen sections
-
-* xhtml.common.xsl:
-     Common customization for XHTML output. Some parts of the
-     documentation tree may use a bit different customized stylesheets
-     to generate the output. This file contains sections that are
-     common for all of them, such as options needed to generate strict
-     nicely formatted XHTML output.
-
-* xhtml.root.xsl:
-     Stylesheet used to build all the documentation. This stylesheet
-     is used for the documentation root in sip_router/doc/doc_root.xml.
-     This stylesheet generates chunked XHTML output in xhtml subdirectory.
-
-* xhtml.xsl:
-     Stylesheet used to build parts of the documentation tree. This would
-     generate single large xhtml file in the same directory.
-
-* xhtml.chunked.xsl:
-     Stylesheet used to generate chunked xhtml version, i.e. multiple 
-     files. Normally used with a Makefile setting output_dir=some_sub_dir
-     to generate all output files in one directory.
-
-* html.chunked.xsl:
-     Stylesheet used to generate chunked html version, i.e. multiple
-     files. Used to generate html that browsers without xhtml support
-     can view.  Normally used with a Makefile setting 
-     output_dir=some_sub_dir to generate all output files in one directory.
-
-* dep.xsl:
-     XSL stylesheet that traverses XML documents and generates list of
-     dependencies that will be included by makefiles.
-
-* txt.xsl:
-     XSL stylesheet used to generate plain text version of documentation.
-     XHTML stylesheets are used to generate XHTML code that is then fed
-     to lynx to produce plain text version. This stylesheet contains XHTML
-     customization that are applied only when TXT is generated.
-
-* ser.css:
-     Cascade stylesheets for XHTML outpout. Presentation related settings
-     go here.
-
-* dbschema/:
-     Stylesheets that generate SQL statements for various database systems
-     from the XML description in sip_router/db/schema.
-
-  -- Jan Janak <[email protected]>, $Id$

+ 0 - 44
doc/stylesheets/dep.xsl

@@ -1,44 +0,0 @@
-<?xml version='1.0'?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-     version='1.0' xmlns:xi="http://www.w3.org/2001/XInclude">
-
-    <xsl:param name="prefix"/>
-    <xsl:param name="output"/>
-
-    <xsl:template match="/">
-	<xsl:document href="{$output}" method="text" indent="no" omit-xml-declaration="yes">
-            <xsl:value-of select="concat($output, ': ')"/>
-	    <xsl:apply-templates mode="subroot"/>
-	</xsl:document>
-    </xsl:template>
-
-    <xsl:template name="get-prefix">
-	<xsl:if test="contains($prefix, '/')">
-	    <xsl:value-of select="concat(substring-before($prefix, '/'), '/')"/>
-	    <xsl:call-template name="get-prefix">
-		<xsl:with-param name="prefix" select="substring-after($prefix, '/')"/>
-	    </xsl:call-template>
-	</xsl:if>
-    </xsl:template>
-    
-    <xsl:template match='xi:include' mode="subroot">
-	<xsl:value-of select="concat($prefix, concat(@href, ' '))"/>
-	<xsl:apply-templates select="document(@href)" mode="subroot">
-	    <xsl:with-param name="prefix">
-		<xsl:call-template name="get-prefix">
-		    <xsl:with-param name="prefix" select="concat($prefix, @href)"/>
-		</xsl:call-template>
-	    </xsl:with-param>
-	</xsl:apply-templates>
-    </xsl:template>
-    
-    <xsl:template match='xi:include[@parse="text"]' mode="subroot">
-	<xsl:value-of select="concat($prefix, concat(@href, ' '))"/>
-    </xsl:template>
-    
-    <xsl:template match="graphic|imagedata|inlinemediaobject|textdata" mode="subroot">
-	<xsl:value-of select="concat($prefix, concat(@fileref, ' '))"/>
-    </xsl:template>
-    
-    <xsl:template match="text()|@*" mode="subroot"/>
-</xsl:stylesheet>

+ 0 - 163
doc/stylesheets/drupal.xsl

@@ -1,163 +0,0 @@
-<?xml version="1.0" encoding="US-ASCII"?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="exsl">
-
-    <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
-    <xsl:import href="xhtml.common.xsl"/>
-
-    <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk-common.xsl"/>
-
-    <xsl:include href="http://docbook.sourceforge.net/release/xsl/current/xhtml/manifest.xsl"/>
-    <xsl:include href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk-code.xsl"/>
-    
-    <xsl:param name="use.id.as.filename">yes</xsl:param>
-    <xsl:param name="chunk.quietly">1</xsl:param>
-    <xsl:param name="suppress.header.navigation">1</xsl:param>
-
-
-<xsl:template name="chunk-element-content">
-  <xsl:param name="prev"/>
-  <xsl:param name="next"/>
-  <xsl:param name="nav.context"/>
-  <xsl:param name="content">
-    <xsl:apply-imports/>
-  </xsl:param>
-
-<!--
- <xsl:call-template name="user.preroot"/>
--->
-      <xsl:call-template name="user.header.navigation"/>
-
-      <xsl:call-template name="header.navigation">
-        <xsl:with-param name="prev" select="$prev"/>
-        <xsl:with-param name="next" select="$next"/>
-        <xsl:with-param name="nav.context" select="$nav.context"/>
-      </xsl:call-template>
-
-      <xsl:call-template name="user.header.content"/>
-
-      <xsl:copy-of select="$content"/>
-
-      <xsl:call-template name="user.footer.content"/>
-
-      <xsl:call-template name="footer.navigation">
-        <xsl:with-param name="prev" select="$prev"/>
-        <xsl:with-param name="next" select="$next"/>
-        <xsl:with-param name="nav.context" select="$nav.context"/>
-      </xsl:call-template>
-
-      <xsl:call-template name="user.footer.navigation"/>
-</xsl:template>
-
-<!---    
-    <xsl:template name="dbhtml-chunk">
-	<xsl:param name="pis" select="./processing-instruction('dbhtml')"/>
-	<xsl:call-template name="dbhtml-attribute">
-	    <xsl:with-param name="pis" select="$pis"/>
-	    <xsl:with-param name="attribute">chunk</xsl:with-param>
-	</xsl:call-template>
-    </xsl:template>
--->
-    <!-- Override chunk template, it will also check if the dbhtml PI contains
-         chunk="yes" attribute and if so then it will start a new chunk. This
-         allows for fine-grained manual chunking
-    -->
-<!--
-    <xsl:template name="chunk">
-	<xsl:param name="node" select="."/>
-
-	<xsl:variable name="make_chunk">
-	    <xsl:call-template name="dbhtml-chunk">
-		<xsl:with-param name="pis" select="$node/processing-instruction('dbhtml')"/>
-	    </xsl:call-template>
-	</xsl:variable>
-
-	<xsl:choose>
-	    <xsl:when test="$make_chunk='yes'">1</xsl:when>
-	    <xsl:when test="not($node/parent::*)">1</xsl:when>
-	    <xsl:when test="local-name($node)='sect1' and 
-		            $chunk.section.depth &gt;= 1 and 
-		            ($chunk.first.sections != 0 or
-		            count($node/preceding-sibling::sect1) &gt; 0)
-		           ">
-		<xsl:text>1</xsl:text>
-	    </xsl:when>
-	    <xsl:when test="local-name($node)='sect2' and 
-		            $chunk.section.depth &gt;= 2 and 
-		            ($chunk.first.sections != 0 or 
-		            count($node/preceding-sibling::sect2) &gt; 0)
-		           ">
-		<xsl:call-template name="chunk">
-		    <xsl:with-param name="node" select="$node/parent::*"/>
-		</xsl:call-template>
-	    </xsl:when>
-	    <xsl:when test="local-name($node)='sect3' and 
-		            $chunk.section.depth &gt;= 3 and 
-		            ($chunk.first.sections != 0 or
-		            count($node/preceding-sibling::sect3) &gt; 0)
-		           ">
-		<xsl:call-template name="chunk">
-		    <xsl:with-param name="node" select="$node/parent::*"/>
-		</xsl:call-template>
-	    </xsl:when>
-	    <xsl:when test="local-name($node)='sect4' and 
-		            $chunk.section.depth &gt;= 4 and 
-		            ($chunk.first.sections != 0 or 
-		            count($node/preceding-sibling::sect4) &gt; 0)
-		           ">
-		<xsl:call-template name="chunk">
-		    <xsl:with-param name="node" select="$node/parent::*"/>
-		</xsl:call-template>
-	    </xsl:when>
-	    <xsl:when test="local-name($node)='sect5' and 
-		            $chunk.section.depth &gt;= 5 and 
-		            ($chunk.first.sections != 0 or 
-		            count($node/preceding-sibling::sect5) &gt; 0)
-		           ">
-		<xsl:call-template name="chunk">
-		    <xsl:with-param name="node" select="$node/parent::*"/>
-		</xsl:call-template>
-	    </xsl:when>
-	    <xsl:when test="local-name($node)='section' and 
-		            $chunk.section.depth&gt;=count($node/ancestor::section)+1
-		            and  ($chunk.first.sections != 0 or 
-		            count($node/preceding-sibling::section) &gt; 0)
-		           ">
-		<xsl:call-template name="chunk">
-		    <xsl:with-param name="node" select="$node/parent::*"/>
-		</xsl:call-template>
-	    </xsl:when>
-	    
-	    <xsl:when test="local-name($node)='preface'">1</xsl:when>
-	    <xsl:when test="local-name($node)='chapter'">1</xsl:when>
-	    <xsl:when test="local-name($node)='appendix'">1</xsl:when>
-	    <xsl:when test="local-name($node)='article'">1</xsl:when>
-	    <xsl:when test="local-name($node)='part'">1</xsl:when>
-	    <xsl:when test="local-name($node)='reference'">1</xsl:when>
-	    <xsl:when test="local-name($node)='refentry'">1</xsl:when>
-
-	    <xsl:when test="local-name($node)='index' and 
-		            ($generate.index != 0 or count($node/*) &gt; 0) 
-		            and (local-name($node/parent::*) = 'article' or 
-		            local-name($node/parent::*) = 'book' or 
-		            local-name($node/parent::*) = 'part')">1
-	    </xsl:when>
-	    <xsl:when test="local-name($node)='bibliography' and 
-		            (local-name($node/parent::*) = 'article' or 
-		            local-name($node/parent::*) = 'book' or 
-		            local-name($node/parent::*) = 'part')">1</xsl:when>
-	    <xsl:when test="local-name($node)='glossary' and 
-		            (local-name($node/parent::*) = 'article' or 
-		            local-name($node/parent::*) = 'book' or 
-		            local-name($node/parent::*) = 'part')">1</xsl:when>
-	    <xsl:when test="local-name($node)='colophon'">1</xsl:when>
-	    <xsl:when test="local-name($node)='book'">1</xsl:when>
-	    <xsl:when test="local-name($node)='set'">1</xsl:when>
-	    <xsl:when test="local-name($node)='setindex'">1</xsl:when>
-	    <xsl:when test="local-name($node)='legalnotice' and $generate.legalnotice.link != 0">1</xsl:when>
-	    <xsl:otherwise>0</xsl:otherwise>
-	</xsl:choose>
-    </xsl:template>
--->
-
-</xsl:stylesheet>

+ 0 - 16
doc/stylesheets/fo.xsl

@@ -1,16 +0,0 @@
-<?xml version='1.0'?>
-
-<!-- Common settings for generating FO output -->
-<xsl:stylesheet  
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
-    <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
-    <xsl:import href="common.xsl"/>
-
-    <xsl:param name="paper.type">A4</xsl:param>
-    <xsl:param name="double.sided">1</xsl:param>
-    <xsl:param name="xep.extensions">1</xsl:param>
-    <xsl:param name="insert.xref.page.number">yes</xsl:param>
-    <xsl:param name="admon.graphics">1</xsl:param>
-    <xsl:param name="ulink.footnotes">0</xsl:param>
-</xsl:stylesheet>

+ 0 - 40
doc/stylesheets/html.chunked.xsl

@@ -1,40 +0,0 @@
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:exsl="http://exslt.org/common"
-		version="1.0"
-                exclude-result-prefixes="exsl">
-
-<!-- ********************************************************************
-     $Id$
-     ********************************************************************
-
-     This file is part of the XSL DocBook Stylesheet distribution.
-     See ../README or http://nwalsh.com/docbook/xsl/ for copyright
-     and other information.
-
-     ******************************************************************** -->
-
-<!-- ==================================================================== -->
-
-<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
-<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/>
-<xsl:include href="http://docbook.sourceforge.net/release/xsl/current/html/manifest.xsl"/>
-
-<!-- Why is chunk-code now xsl:included?
-
-Suppose you want to customize *both* the chunking algorithm used *and* the
-presentation of some elements that may be chunks. In order to do that, you
-must get the order of imports "just right". The answer is to make your own
-copy of this file, where you replace the initial import of "docbook.xsl"
-with an import of your own base.xsl (that does its own import of docbook.xsl).
-
-Put the templates for changing the presentation of elements in your base.xsl.
-
-Put the templates that control chunking after the include of chunk-code.xsl.
-
-Voila! (Man I hope we can do this better in XSLT 2.0)
-
--->
-
-<xsl:include href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-code.xsl"/>
-
-</xsl:stylesheet>

+ 0 - 192
doc/stylesheets/ser.css

@@ -1,192 +0,0 @@
-/* Inspired by docbook.css from Phorum.org */
-body {
-    font-family: arial,helvetica,sans-serif;
-    color: #345;
-    line-height: 1.3em;
-    padding: 20px;
-    margin: 10px 50px 10px 50px;
-}
-
-a:link,a:visited,a:active {
-    color: #3D6F3D;
-}
-a:hover {
-    color: #5C5CA6;
-}
-h1,h2,h3,h4 {
-    color: black;
-    padding-top: 20px;
-}
-h1 {
-    border: 3px solid black;
-    padding: 5px;
-    background-color: #ccf;
-    color: black;
-}
-
-h2.title {
-	border: 3px solid black;
-	padding: 8px;
-	background-color: #ccf;
-	color: black;
-}
-
-h3.title {
-    border: 2px solid black;
-    padding: 5px;
-    background-color: #ccf;
-    color: black;
-}
-
-h3.author {
-    font-size: 20px;
-    padding-top: 0px;
-}
-
-h4.title {
-	margin: 15px;
-	padding: 2px;
-	background-color: #ddd;
-	color: black;
-	font-size: 20px;
-}
-
-.programlisting {
-    background-color: #f5f5f5;
-    border: 1px solid black;
-    padding: 10px;
-    margin: 5px 40px;
-}
-
-.screen {
-    background-color: #f5f5f5;
-    color: black;
-    border: 1px solid black;
-    padding: 10px;
-    margin: 5px 40px;
-}
-.screen .literal {
-    font-size: inherit;
-    color: darkgreen;
-}
-
-p {
-    padding-left: 30px;
-}
-
-.itemizedlist {
-    margin-left: 30px;
-}
-
-li p {
-    padding: 0px;
-}
-
-.copyright,.toc {
-    padding-left: 0px;
-}
-
-.toc {
-    color: black;
-}
-.toc p,
-.list-of-examples p {
-    padding-left: 0px;
-}
-
-.example .title {
-    font-size: 14px;
-    margin: 0px;
-}
-
-.variablelist .term {
-    font-weight: bold;
-    padding-left: 40px;
-}
-
-
-.filename {
-    white-space: nowrap;
-    font-size: 16px;
-    color: darkred;
-}
-
-.literal {
-    white-space: nowrap;
-    font-size: 16px;
-    color: darkblue;
-}
-
-.note {
-    border: 1px solid #ccc;
-    padding: 10px;
-    padding-left: 20px;
-/*
-    background-image: url(&quot;images/note.png&quot;);
-    background-position: 10px 15px;
-    background-repeat: no-repeat;
-*/
-}
-.note h3.title {
-    border: 1px solid #ccc;
-    background-color: #ddd;
-    padding: 3px;
-    padding-left: 10px;
-    margin: 5px;
-    font-size: 14px;
-}
-
-.important {
-    border: 1px solid #ddd;
-    padding: 15px;
-    padding-left: 70px;
-	/*
-    background-image: url(&quot;images/important.gif&quot;);
-    background-position: 10px 15px;
-    background-repeat: no-repeat;
-	*/
-}
-.important h3 {
-    padding: 0px 0px 10px 0px;
-    margin: 0px;
-    color: black;
-}
-.important p {
-    padding: 0px;
-    margin: 0px;
-}
-.important .programlisting {
-    margin: 10px 0px 10px 0px;
-}
-
-.remark {
-    background-color: darkred;
-    color: white;
-    border: 1px solid black;
-    padding: 5px;
-    margin: 10px 10px 10px 0px;
-    display: block; /* Change to &quot;none&quot; in production */
-}
-
-.navheader th,td,tr {
-	background-color: #D5D0D2;
-	font-size: 18px;
-	padding: 5px;
-	display: block;
-	border: 1px solid black;
-}
-
-.revhistory th,td,tr {
-    background-color: #f5f5f5;
-    font-size: 10px;    
-    padding: 5px;
-    display: none;
-}
-
-.varname {
-	padding: 0px 0px 10px 0px;
-	margin: 0px;
-	color: black;
-	font-style: italic;
-	font-size: x-small;
-}

+ 193 - 0
docbook/Makefile

@@ -0,0 +1,193 @@
+# This variable contains a list of docbook sources separated by white space to
+# be processed by the docbook build system if the user did not specify any
+# document on the command line. Documents configure here are processed one
+# after another, each of them will be treated as a standalone documentation
+# file.
+docs ?= index.xml
+
+# Here you can specify the name of the file that will be used to generate a
+# module README file. You can override it in a module Makefile. This is
+# useful, for example, if you want to use a different docbook file to generate
+# README and a different docbook file to generate documentation in other
+# formats (HTML, TXT). If you omit this variable in your Makefile then the
+# first document specified in DOCS is used to generate module README file.
+readme_docs ?= $(docs)
+
+# This is the list of docbook files to be used to generate HTML
+# documentation. You can use this variable in your Makefile if you have
+# docbook documents that should be processed only when HTML documentation is
+# being generated (i.e. you want them to be ignored when plain-text
+# documentation is being generated). Multiple documents separated by white
+# space can be configured here and they will be processed one after
+# another. If you omit this variable then the documents specified in DOCS
+# variable will be converted to HTML when HTML documentation is being built.
+html_docs ?= $(docs)
+
+# This is the list of docbook files to be used to generate plain-text
+# documentation. You can use this variable in your Makefile if you have
+# docbook documents that should be processed only when plain-textdocumentation
+# is being generated (i.e. you want them to be ignored when HTML documentation
+# is being generated). Multiple documents separated by white space can be
+# configured here and they will be processed one after another. If you omit
+# this variable then the documents specified in DOCS variable will be
+# converted to plain-text when plain-text documentation is being built.
+txt_docs ?= $(docs)
+
+# Output directory where files produced by XSL stylesheets should be stored,
+# by default we output to the same directory, documents that are chunked may
+# choose to override this to write all chunks in a subdirectory instead.
+output_dir ?= .
+
+# Here you can configure the path to the directory which contains all
+# auxiliary files that are needed to convert docbook documentation to other
+# formats. You should not need to use this variable under normal
+# circumstances.
+docbook_dir ?= ../../../docbook
+COREPATH ?= $(docbook_dir)/..
+
+# This is the stylesheet used to generate a list of dependencies for a docbook
+# source file. The stylesheet walks through the document and prints all files
+# that are included in the document. The list of files is then written in a
+# standalone file by this Makefile and the file can be included by the
+# Makefile.
+dep_xsl ?= $(docbook_dir)/dep.xsl
+
+# This is the stylesheet that is used to produce a single HTML file for every
+# docbook document being processed. This stylesheet contains configuration for
+# docbook XSL scripts that only applies when the build system generates a
+# single HTML file.
+single_html_xsl ?= $(docbook_dir)/html.xsl
+
+# This stylesheet is used to produce chunked HTML documention, the output will
+# be a set of HTML files. This stylesheet contains configuration for docbook
+# XSL scripts that only applies when multiple-file HTML documentation is being
+# generated.
+chunked_html_xsl ?= $(chunked_html_xls)/html.chunked.xsl
+
+# This stylesheet is used to produce plain-text documentation. Internally this
+# stylesheet includes the docbook XSL stylesheet used to produce single-file
+# HTML documentation and the output is then converted by lynx to a plain-text
+# file.
+txt_xsl ?= $(docbook_dir)/txt.xsl
+
+# This stylesheet is used when the docbook build system generates a module
+# README. The process is similar to the process of generating plain-text file,
+# but we use a separate stylesheet here because the configuration of docbook
+# XSL stylesheets can be a bit different for READMEs (i.e. we do not want to
+# have list of examples in READMES, etc.)
+readme_xsl ?= $(docbook_dir)/readme.xsl
+
+# Use this configuration variable to enable or disable docbook document
+# validation before the build system converts the document into another
+# format.
+validate ?= 0
+
+# A list of CSS stylesheets separated by whitespace to be included in HTML
+# files.
+html_css ?= /css/sr-doc.css
+
+# This is the catalog file used by xsltproc to locate docbook schema files
+# needed to validate docbook documents and docbook XSL stylesheets needed
+# convert docbook documents to other formats. All docbook documents in the
+# sip-router projects refer to schema files using public
+# identifiers. Similarly customization stylesheets refer to docbook XSL
+# stylesheets using public URIs. The catalog file is then used to convert
+# public identifiers and public URIs to files on local filesystem. The default
+# version of the catalog file only refers to file /etc/xml/catalog, this is
+# the site-wide catalog file present in Debian and possibly other systems
+# too. This file is updated by the package manager whenever docbook schema
+# file or docbook xsl stylesheets are being installed.
+catalog=$(docbook_dir)/catalog.xml
+
+lynx     ?= lynx
+dia      ?= dia
+xsltproc ?= xsltproc
+xmllint  ?= xmllint
+
+lynx_flags     ?= -nolist
+dia_args       ?=
+xsltproc_flags ?=
+xmllint_flags  ?= --xinclude --postvalid --noout
+
+ifeq ($(validate), 0)
+	override xsltproc_flags := $(xsltproc_flags) --novalid
+endif
+
+all_deps = Makefile $(docbook_dir)/Makefile $(dep_xsl) $(catalog) $(extra_deps)
+
+all: txt
+
+html_files = $(addprefix $(output_dir)/, $(addsuffix .html,\
+			 $(basename $(html_docs))))
+html_deps = $(addsuffix .d, $(basename $(html_docs)))
+
+txt_files = $(addprefix $(output_dir)/, $(addsuffix .txt,\
+			$(basename $(txt_docs))))
+txt_deps = $(addsuffix .d, $(basename $(txt_docs)))
+
+readme_deps = $(addsuffix .d, $(basename $(readme_docs)))
+
+html xhtml single_html single_xhtml: $(html_files)
+txt text plaintext: $(txt_files)
+readme README: ../README
+
+../README: $(readme_docs) $(readme_deps) $(readme_xsl) $(all_deps)
+	XML_CATALOG_FILES=$(catalog) $(xsltproc) $(xsltproc_flags) \
+		--xinclude \
+        $(readme_xsl) $< | $(lynx) $(lynx_flags) -stdin -dump > $@
+
+$(output_dir)/%.html: %.xml %.d $(single_html_xsl) $(all_deps)
+	XML_CATALOG_FILES=$(catalog) $(xsltproc) $(xsltproc_flags) \
+        --xinclude \
+        --stringparam base.dir "$(output_dir)/" \
+        --stringparam root.filename "$(basename $<)" \
+        --stringparam html.stylesheet "$(html_css)" \
+        --stringparam html.ext ".html" \
+        $(single_html_xsl) $<
+
+
+$(output_dir)/%.txt: %.xml %.d $(txt_xsl) $(all_dep)
+	XML_CATALOG_FILES=$(catalog) $(xsltproc) $(xsltproc_flags) \
+		--xinclude \
+        $(txt_xsl) $< | $(lynx) $(lynx_flags) -stdin -dump > $@
+
+%.png: %.dia $(all_dep)
+	$(dia) $(dia_flags) -t png -e $@ $<
+
+%.d: %.xml $(all_dep) 
+	$(xsltproc) $(xsltproc_flags) \
+        --nonet \
+        --novalid \
+        --stringparam output "$@" \
+        $(dep_xsl) $< 
+
+.PHONY: check
+check: $(docs) $(html_docs) $(txt_docs) $(readme_docs)
+	XML_CATALOG_FILES=$(catalog) $(xmllint) $(xmllint_flags) $<
+
+.PHONY: clean
+clean:
+	-rm -f $(html_files) $(txt_files)
+
+
+.PHONY: proper realclean distclean maintainer-clean
+proper realclean distclean maintainer-clean: clean
+	-rm -f $(html_deps) $(txt_deps) $(readme_deps) *~
+
+maintainer-clean: clean-tmp
+
+.PHONY: clean-tmp
+clean-tmp:
+	-rm -f TAGS tags *.dbg .*.swp
+
+
+ifeq (,$(MAKECMDGOALS))
+include $(html_deps) $(txt_deps) $(readme_deps)
+else
+ifeq (,$(strip $(nodep_targets)))
+include $(COREPATH)/Makefile.targets
+endif
+ifneq (,$(filter-out $(nodep_targets) check, $(MAKECMDGOALS)))
+include $(html_deps) $(txt_deps) $(readme_deps)
+endif
+endif

+ 4 - 0
docbook/Makefile.module

@@ -0,0 +1,4 @@
+# This is the future home for module specific targets,
+# nothing here yet
+
+include $(docbook_dir)/Makefile

+ 66 - 0
docbook/README

@@ -0,0 +1,66 @@
+This directory contains a number of auxiliary files that are used by the
+docbook build system to convert the documentation in docbook-xml format to
+various output formats.
+
+* catalog.xml:
+    This is a XML catalog file. The file is used by the tools that process
+    docbook sources to map public identifiers, which are commonly found in
+    docbook source files, such as 
+      "-//OASIS//DTD DocBook XML V4.3//EN"
+    to local files. The default version of the file refers to a generic 
+    catalog file that is commonly found in /etc/xml/catalog.
+
+    You can modify the file if you want to use a particular version of docbook
+    schema files or XSL stylesheets to produce the output. This is very useful
+    because there is no need to modify source docbook files, the catalog file
+    can be used to re-map the public identifier in those files to a local (and
+    possibly customized) version of the schema or stylesheets.
+
+* common.xsl:
+    This file contains docbook XSL stylesheet customizations that are shared
+    by all output-specific XSL files, for example, the code that strips
+    leading and trailing whitespace in <screen> sections is located here.
+
+* dep.xsl:
+    This file contains a special XSL stylesheet which can be used to produce a
+    file with dependencies for any given docbook source file. The stylesheet
+    traverses docbook documents and looks for files included with the
+    xi:include mechanism, or for files included by docbook tags, such as
+    images, screen listings, etc. The list of dependencies is then written in
+    a separate file and the file can be included in a Makefile that is used to
+    build documentation. This is all done by the docbook makefile system.
+
+* html.chunked.xsl: 
+    The stylesheet in this file is used to generate HTML output split in
+    multiple files. This is useful if you need to generate HTML files with
+    documentation for browsers that do not support XHTML.
+
+* Makefile:
+    This is the main Makefile of the Docbook build system. Rules implemented
+    in this Makefile can be used to validate docbook documents, generate lists
+    of dependendies, generate HTML, plain-text, READMEs, and other output
+    formats out of docbook documents. This file is not meant to be used
+    directly. Instead, each directory with docbook source files should have
+    its own minimal Makefile which includes this file.
+
+* man.xsl:
+    This stylesheet can be used to convert docbook sources into man pages. The
+    docbook build system uses this stylesheet to convert docbook files with
+    man pages contents to real man pages, some modules contain such docbook
+    files.
+
+* readme.xsl:
+	This stylesheet is used to generate module README files from docbook sources.
+
+* sr-doc.css:
+    The CSS stylesheets that are used for online HTML documentation generated
+    from docbook sources.
+
+* txt.xsl:
+    The XSL stylesheet used to generate plain text version of the
+    documentation.  XHTML stylesheets are used to generate XHTML code that is
+    then fed to lynx to produce plain a text version. This stylesheet contains
+    XHTML customization that are applied only when a plain-text output is
+    desired.
+
+  -- Jan Janak <[email protected]>

+ 10 - 0
docbook/TODO

@@ -0,0 +1,10 @@
+* XSLT stylesheet included from other stylesheet are not among dependencies
+  (if you modify html.common.xsl) then the html output won't be rebuilt
+
+* Support for man pages
+
+* Support for embedded css stylesheets in generated HTML documents
+
+* There is an issue with .d files, they are not sometimes regenerated when
+  one of the files included gets changed to a non-existent file and back
+  (maybe it happens only when you run make clean html)

+ 37 - 0
docbook/catalog.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
+         "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
+	<!-- Uncomment the following entry if you have docbook DTDs in unusual
+	     location or if you would like to validate the documentation against
+	     newer docbook version -->
+	<!--
+	<public publicId="-//OASIS//DTD DocBook XML V4.3//EN"
+            uri="file:///home/janakj/docbook/dtd/docbookx.dtd"/>
+      -->
+
+    <!-- Uncomment the following entry if you have docbook XSL stylesheets in
+         unusual location, the value of rewritePrefix parameter should point
+         to the top level directory of your XSL stylesheets -->
+    <!--
+    <rewriteURI uriStartString="http://docbook.sourceforge.net/release/xsl/current/"
+                rewritePrefix="file:///home/janakj/docbook/xsl/"/>
+      -->
+
+    <!-- Try the system wide catalogs as the last step before reverting to
+         using the value of system identifiers and URI references from the
+         documents being processed (they usualy contain HTTP URIs). -->
+    <delegatePublic publicIdStartString="" catalog="file:///etc/xml/catalog"/>
+    <delegateURI    uriStartString=""      catalog="file:///etc/xml/catalog"/>
+
+    <!-- If xsltproc gets here while searching the catalog then no entry was
+         found in the catalog files for the requested resource and in this
+         case xsltproc will attempt to download the resource from the internet
+         using the HTTP protocol. It will use the HTTP URIs from system
+         identifiers and URI references (therefore the XSL customization
+         stylesheets in SR refer to the original XSL stylesheets using HTTP
+         URIs). Note: Downloading DTDs and XSL stylesheets can be very slow,
+         because each file will be downloaded several times, xsltproc does not
+         cache downloaded files.
+      -->
+</catalog>

+ 0 - 0
doc/stylesheets/common.xsl → docbook/common.xsl


+ 48 - 0
docbook/dep.xsl

@@ -0,0 +1,48 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+				version='1.0' xmlns:xi="http://www.w3.org/2001/XInclude">
+	
+	<xsl:param name="prefix"/>
+	<xsl:param name="output"/>
+	
+	<xsl:template match="/">
+		<xsl:document href="{$output}" method="text" indent="no" 
+					  omit-xml-declaration="yes">
+			<xsl:value-of select="concat($output, ': ')"/>
+			<xsl:apply-templates mode="subroot"/>
+		</xsl:document>
+	</xsl:template>
+	
+	<xsl:template name="get-prefix">
+		<xsl:if test="contains($prefix, '/')">
+			<xsl:value-of select="concat(substring-before($prefix, '/'), '/')"/>
+			<xsl:call-template name="get-prefix">
+				<xsl:with-param name="prefix" 
+								select="substring-after($prefix, '/')"/>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+	
+	<xsl:template match='xi:include' mode="subroot">
+		<xsl:value-of select="concat($prefix, concat(@href, ' '))"/>
+		<xsl:apply-templates select="document(@href)" mode="subroot">
+			<xsl:with-param name="prefix">
+				<xsl:call-template name="get-prefix">
+					<xsl:with-param name="prefix" 
+									select="concat($prefix, @href)"/>
+				</xsl:call-template>
+			</xsl:with-param>
+		</xsl:apply-templates>
+	</xsl:template>
+	
+	<xsl:template match='xi:include[@parse="text"]' mode="subroot">
+		<xsl:value-of select="concat($prefix, concat(@href, ' '))"/>
+	</xsl:template>
+	
+	<xsl:template match="graphic|imagedata|inlinemediaobject|textdata" 
+				  mode="subroot">
+		<xsl:value-of select="concat($prefix, concat(@fileref, ' '))"/>
+	</xsl:template>
+	
+	<xsl:template match="text()|@*" mode="subroot"/>
+</xsl:stylesheet>

+ 13 - 3
doc/kam_entities.xml → docbook/entities.xml

@@ -1,8 +1,7 @@
-<!-- $Id: entities.xml 5591 2009-02-11 15:07:42Z henningw $ -->
-
 <!-- Entities often used in the documentation -->
 
 <!ENTITY fhg "FhG FOKUS">
+<!ENTITY iptel "<ulink url='http://iptel.org'>iptel.org</ulink>">
 
 <!ENTITY kamailio "Kamailio">
 <!ENTITY kamailioname "Kamailio SIP Server Platform">
@@ -33,12 +32,23 @@
 <!ENTITY develguide "Developer Guide">
 <!ENTITY faqguide "Frequently Asked Questions">
 
+<!ENTITY ser "SER">
+<!ENTITY sername "SIP Express Router">
+
+<!ENTITY serhome "http://iptel.org/ser">
+<!ENTITY serbugs "http://iptel.org/ser/bugs">
+<!ENTITY serusers "http://mail.iptel.org/mailman/listinfo/serusers">
+<!ENTITY serdev "http://mail.iptel.org/mailman/listinfo/serdev">
+
 <!ENTITY serhomelink "<ulink url='&serhome;'>&serhome;</ulink>">
 <!ENTITY serbugslink "<ulink url='&serbugs;'>&serbugs;</ulink>">
 <!ENTITY serhelplink "<ulink url='&serhelp;'>&serhelp;</ulink>">
 <!ENTITY seruserslink "<ulink url='&serusers;'>&serusers;</ulink>">
 <!ENTITY serdevlink "<ulink url='&serdev;'>&serdev;</ulink>">
 
+<!ENTITY serusersmail "<email>[email protected]</email>">
+<!ENTITY serdevmail "<email>[email protected]</email>">
+
 <!ENTITY defaultdb "mysql://openser:openserrw@localhost/openser">
 <!ENTITY defaultrodb "mysql://openserro:openserro@localhost/openser">
 <!ENTITY exampledb "dbdriver://username:password@dbhost/dbname">
@@ -74,4 +84,4 @@
 <!ENTITY rfc2543 "<ulink url='http://www.ietf.org/rfc/rfc2543.txt'>RFC2543</ulink>">
 
 <!ENTITY vsname "Voice Sistem SRL">
-<!ENTITY voicesystem "<ulink url='http://www.voice-system.ro'>voice-system.ro</ulink>">
+<!ENTITY voicesystem "<ulink url='http://www.voice-system.ro'>voice-system.ro</ulink>">

+ 1 - 1
doc/stylesheets/xhtml.chunked.xsl → docbook/html.chunked.xsl

@@ -6,7 +6,7 @@
     <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
 
     <!-- Commmon XHTML customization -->
-    <xsl:import href="xhtml.common.xsl"/>
+    <xsl:import href="html.common.xsl"/>
 
 <!-- Chunking -->
     <xsl:param name="use.id.as.filename">yes</xsl:param>

+ 13 - 1
doc/stylesheets/xhtml.common.xsl → docbook/html.common.xsl

@@ -2,7 +2,9 @@
 
 <!-- Common settings for generating XHTML output -->
 <xsl:stylesheet  
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+	xmlns:xi="http://www.w3.org/2003/XInclude"
+	version="1.0">
 
    <!-- Stylesheets that override this one must import either onechunk.xsl
         or chunk.xsl
@@ -11,6 +13,8 @@
 <!-- Stylesheets common for all transformations (xhtml, txt, fo) -->
     <xsl:import href="common.xsl"/>
 
+	<xsl:param name="html.embedded.stylesheet"/>
+
     <xsl:output method="xml"/>
     
 <!-- HTML Customization -->
@@ -29,4 +33,12 @@
     <xsl:param name="chunker.output.indent">yes</xsl:param>
     <xsl:param name="chunker.output.doctype-public">-//W3C//DTD XHTML 1.0 Strict//EN</xsl:param>
     <xsl:param name="chunker.output.doctype-system">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</xsl:param>
+
+	<xsl:template name="user.head.content">
+		<xsl:if test="$html.embedded.stylesheet != ''">
+			<xsl:text disable-output-escaping="yes">&lt;style type="text/css"&gt;</xsl:text>
+			<xsl:value-of select="$html.embedded.stylesheet"/>
+			<xsl:text disable-output-escaping="yes">&lt;style&gt;</xsl:text>
+		</xsl:if>
+	</xsl:template>
 </xsl:stylesheet>

+ 2 - 1
doc/stylesheets/xhtml.xsl → docbook/html.xsl

@@ -6,5 +6,6 @@
     <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/onechunk.xsl"/>
 
     <!-- Common XHTML customization -->
-    <xsl:import href="xhtml.common.xsl"/>
+    <xsl:import href="html.common.xsl"/>
+
 </xsl:stylesheet>

+ 0 - 0
doc/stylesheets/serdoc2man.xsl → docbook/man.xsl


+ 14 - 0
docbook/readme.xsl

@@ -0,0 +1,14 @@
+<?xml version='1.0'?>
+<xsl:stylesheet  
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+    <!-- Produce a single file when building parts of documentation -->
+    <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
+
+    <!-- Import plain-text customization -->
+    <xsl:import href="txt.xsl"/>
+
+	<xsl:param name="section.autolabel">1</xsl:param>
+	<xsl:param name="section.label.includes.component.label">1</xsl:param>
+	<xsl:param name="generate.toc">book toc,title,figure,table,example</xsl:param>
+</xsl:stylesheet>

+ 39 - 38
doc/kam-module-docbook.css → docbook/sr-doc.css

@@ -1,4 +1,4 @@
-BODY {
+body {
   padding: 20px;
   margin: 5px 50px 5px 50px;
   background: #ffffff;
@@ -8,35 +8,36 @@ BODY {
   font-family: Helvetica,Arial;
 }
 
-P {
+p {
   font-family: Helvetica,Arial;
   font-size: 12;
   text-align: justify;
 }
 
-P.C2 {
+p.c2 {
   COLOR: #ffffff ;
   BACKGROUND-color: #a0a0d0;
   BORDER: solid 1px #606090;
   PADDING: 1px
 }
 
-A {
+a {
   color: #041fc5;
   text-decoration: none;
 }
 
-A:hover {
+a:hover {
   color: #990000;
   text-decoration: underline;
 }
 
-DIV.ABSTRACT {
+div.abstract {
   border: solid 2px;
   padding-left: 10pt;
   padding-right: 10pt;
 }
-PRE.SCREEN {
+
+pre.screen {
   font-family:monospace;
   white-space: pre;
   background-color: #fefeee;
@@ -50,7 +51,7 @@ PRE.SCREEN {
   padding-left: 15pt;
 }
 
-PRE.PROGRAMLISTING {
+pre.programlisting {
   font-family:monospace;
   white-space: pre;
   background-color: #fefeee;
@@ -64,7 +65,7 @@ PRE.PROGRAMLISTING {
   padding-left: 15pt;
 }
 
-H1 {
+h1 {
   color: #000000;
   border: solid 2px #a0a0a0;
   background-color: #DCDCDC;
@@ -73,22 +74,22 @@ H1 {
   padding-left: 5px;
 }
 
-.TITLE a {
+.title a {
   color: #000000; 
   text-decoration: none;
 }
 
-.TITLE a:active {
+.title a:active {
   color: #000000; 
   text-decoration: none;
 }
 
-.TITLE a:visited {
+.title a:visited {
   color: #000000; 
   text-decoration: none;
 }
 
-H2 {       
+h2 {       
   COLOR: #000000 ;
   font-style: italic;
   border: solid 1px #b0b0b0;
@@ -99,27 +100,27 @@ H2 {
   font-size: 14;
 }
 
-H2 a {
+h2 a {
   color: #000000; 
   text-decoration: none;
 }
 
-H2 a:active {
+h2 a:active {
   color: #000000; 
   text-decoration: none;
 }
 
-H2 a:visited {
+h2 a:visited {
   color: #000000; 
   text-decoration: none;
 }
 
-H2 a:hover {
+h2 a:hover {
   color: #000000; 
   text-decoration: none;
 }
 
-H3.SECTION {       
+h3.section {       
   COLOR: #000000 ;
   font-style: italic;
   border: solid 1px #c0c0c0;
@@ -130,74 +131,74 @@ H3.SECTION {
   font-size: 13;
 }
 
-H3 a {
+h3 a {
   color: #000000; 
   text-decoration: none;
 }
 
-H3 a:active {
+h3 a:active {
   color: #000000; 
   text-decoration: none;
 }
 
-H3 a:visited {
+h3 a:visited {
   color: #000000; 
   text-decoration: none;
 }
 
-H3 a:hover {
+h3 a:hover {
   color: #000000; 
   text-decoration: none;
 }
 
-H3.AUTHOR {
+h3.author {
   font-family: Helvetica,Arial;
   font-weight: bold;
   font-size: 13;
 }
 
-H3.EDITOR {
+h3.editor {
   font-family: Helvetica,Arial;
   font-weight: bold;
   font-style: italic;
   font-size: 11;
 }
 
-H4 {
+h4 {
   font-family: Helvetica,Arial;
   font-weight: bold;
   font-size: 12;
 }
 
-TABLE.IMPORTANT {
+table.important {
   font-style:italic;
   border: solid 2px #ff0000;
   width: 70%;
   margin-left: 15%;       
 }
 
-TABLE.CAUTION {
+table.caution {
   font-style:italic;
   border: ridge 2px #ffff00;
   width: 70%;
   margin-left: 15%;       
 }
 
-TABLE.NOTE {
+table.note {
   font-style:italic;
   border: solid 1px #000000;
   width: 70%;
   margin-left: 15%;       
 }
 
-TABLE.TIP {
+table.tip {
   font-style:italic;
   border: solid 1px #000000;
   width: 70%;
   margin-left: 15%;       
 }
 
-TABLE.WARNING {
+table.warning {
   font-style:italic;
   font-weight: bold;
   border: ridge 4px #ff0000;
@@ -205,14 +206,14 @@ TABLE.WARNING {
   margin-left: 15%;       
 }
 
-DIV.VARIABLELIST {
+div.variablelist {
   font-family: sans-serif;
   font-style: normal;
   font-weight: normal;
   padding-left: 20px;
 }
 
-.VARLISTENTRY {
+.varlistentry {
   font-weight: bold;
   margin-top: 10px;
   COLOR: #ffffff ;
@@ -221,7 +222,7 @@ DIV.VARIABLELIST {
   PADDING: 1px
 }
 
-DIV.NAVFOOTER {
+div.navfooter {
   color: #000000;
   background-color: #EFEFF8;
   padding: 5px;
@@ -230,7 +231,7 @@ DIV.NAVFOOTER {
   border: thin solid #a0a0d0;
 }
 
-DIV.NUKEFOOTER {
+div.nukefooter {
   color: #000000;
   background-color: #B0E0E6;
   padding: 5px;
@@ -239,7 +240,7 @@ DIV.NUKEFOOTER {
   border: thin solid #a0a0d0;
 }
 
-DIV.NAVHEADER {
+div.navheader {
   color: #000000;
   background-color: #EFEFF8;
   padding: 5px;
@@ -248,11 +249,11 @@ DIV.NAVHEADER {
   border: thin solid #a0a0d0;
 }
 
-DIV.SECT1,DIV.SECT2,DIV.SECT3 {
+div.sect1,div.sect2,div.sect3 {
   margin-left: 20px;
 }
 
-DIV.EXAMPLE,DIV.TOC {
+div.example,div.toc {
   border: thin dotted #70AAE5;
   padding-left: 10px;
   padding-right: 10px;
@@ -260,7 +261,7 @@ DIV.EXAMPLE,DIV.TOC {
   background-color: #EFF8F8;
 }
 
-DIV.TOC {
+div.toc {
   margin-left: 20px;
   margin-right: 20px;
 }

+ 1 - 1
doc/stylesheets/txt.xsl → docbook/txt.xsl

@@ -6,7 +6,7 @@
     <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
 
     <!-- Common XHTML customization -->
-    <xsl:import href="xhtml.common.xsl"/>
+    <xsl:import href="html.common.xsl"/>
 
 	<!-- Display all subsections in in the toc of READMEs -->
   	<xsl:param name="toc.section.depth">4</xsl:param>