diff options
author | Patrick McCarty <patrick.mccarty@linux.intel.com> | 2012-06-12 14:05:47 -0700 |
---|---|---|
committer | Patrick McCarty <patrick.mccarty@linux.intel.com> | 2012-06-12 14:58:00 -0700 |
commit | 0ebc96393cd7cd5c861276ae733307bd7b8d87f7 (patch) | |
tree | 899f86030089e8daa5eaf48af5b8b5b7780998d6 /website | |
parent | 7f26f4160c974d34117c14272d3e4f56a471e8f1 (diff) | |
download | docbook-xsl-2.0alpha.tar.gz docbook-xsl-2.0alpha.tar.bz2 docbook-xsl-2.0alpha.zip |
Required package for building systemd man pages.
Change-Id: I0a200a2340a5aea24898b428b8e9b55da57e3e5b
Signed-off-by: Patrick McCarty <patrick.mccarty@linux.intel.com>
Diffstat (limited to 'website')
-rw-r--r-- | website/autolayout.xsl | 258 | ||||
-rw-r--r-- | website/chunk-common.xsl | 227 | ||||
-rw-r--r-- | website/chunk-tabular.xsl | 12 | ||||
-rw-r--r-- | website/chunk-website.xsl | 12 | ||||
-rw-r--r-- | website/head.xsl | 316 | ||||
-rw-r--r-- | website/makefile-dep.xsl | 143 | ||||
-rw-r--r-- | website/olink.xsl | 297 | ||||
-rw-r--r-- | website/param.xml | 788 | ||||
-rw-r--r-- | website/param.xsl | 53 | ||||
-rw-r--r-- | website/rss.xsl | 143 | ||||
-rw-r--r-- | website/tabular.xsl | 213 | ||||
-rw-r--r-- | website/toc-tabular.xsl | 480 | ||||
-rw-r--r-- | website/toc.xsl | 286 | ||||
-rw-r--r-- | website/website-common.xsl | 821 | ||||
-rw-r--r-- | website/website-targets.xsl | 27 | ||||
-rw-r--r-- | website/website.xsl | 132 | ||||
-rw-r--r-- | website/xbel.xsl | 114 |
17 files changed, 4322 insertions, 0 deletions
diff --git a/website/autolayout.xsl b/website/autolayout.xsl new file mode 100644 index 0000000..461bfce --- /dev/null +++ b/website/autolayout.xsl @@ -0,0 +1,258 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + +<xsl:output method="xml" indent="no" + doctype-public="-//Norman Walsh//DTD Website Autolayout V2.5.0//EN" + doctype-system="http://docbook.sourceforge.net/release/website/2.5.0/schema/dtd/autolayout.dtd" +/> + +<xsl:strip-space elements="toc tocentry layout copyright"/> + +<xsl:template match="layout"> + <autolayout> + <xsl:text> </xsl:text> + <xsl:apply-templates/> + </autolayout> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="style|script|headlink|copyright|config"> + <xsl:apply-templates select="." mode="copy"/> +</xsl:template> + +<xsl:template match="*" mode="copy"> + <xsl:element name="{name(.)}"> + <xsl:copy-of select="@*"/> + <xsl:apply-templates mode="copy"/> + </xsl:element> +</xsl:template> + +<xsl:template match="toc"> + <xsl:if test="not(@page)"> + <xsl:message terminate="yes"> + <xsl:text>All toc entries must have a page attribute.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:variable name="page" select="document(@page,.)"/> + + <toc> + <xsl:call-template name="tocentry"/> + </toc> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="tocentry"> + <tocentry> + <xsl:call-template name="tocentry"/> + </tocentry> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="notoc"> + <notoc> + <xsl:call-template name="tocentry"/> + </notoc> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template name="tocentry"> + <xsl:if test="@revisionflag"> + <xsl:attribute name="revisionflag"> + <xsl:value-of select="@revisionflag"/> + </xsl:attribute> + </xsl:if> + <xsl:choose> + <xsl:when test="@href"> + <xsl:call-template name="tocentry.href"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="tocentry.page"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="tocentry.href"> + <xsl:if test="not(@href)"> + <xsl:message terminate="yes"> + <xsl:text>All toc entries must have an href attribute.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="not(@id)"> + <xsl:message terminate="yes"> + <xsl:text>All href toc entries must have an id attribute.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:message> + <xsl:text>off site: </xsl:text> + <xsl:value-of select="@href"/> + </xsl:message> + + <xsl:attribute name="id"> + <xsl:value-of select="@id"/> + </xsl:attribute> + <xsl:attribute name="href"> + <xsl:value-of select="@href"/> + </xsl:attribute> + <xsl:if test="@tocskip = '1'"> + <xsl:attribute name="tocskip"> + <xsl:value-of select="@tocskip"/> + </xsl:attribute> + </xsl:if> + + <xsl:if test="not(title)"> + <xsl:message terminate="yes"> + <xsl:text>Off-site links must provide a title.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:text> </xsl:text> + <xsl:apply-templates select="title|titleabbrev|summary" mode="copy"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="tocentry"/> +</xsl:template> + +<xsl:template name="tocentry.page"> + <xsl:if test="not(@page)"> + <xsl:message terminate="yes"> + <xsl:text>All toc entries must have a page attribute.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:variable name="page" select="document(@page,.)"/> + + <xsl:if test="not($page/*[1]/@id)"> + <xsl:message terminate="yes"> + <xsl:value-of select="@page"/> + <xsl:text>: missing ID.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:variable name="id" select="$page/*[1]/@id"/> + + <xsl:variable name="filename"> + <xsl:choose> + <xsl:when test="@filename"> + <xsl:value-of select="@filename"/> + </xsl:when> + <xsl:when test="/layout/config[@param='default-filename']"> + <xsl:value-of select="(/layout/config[@param='default-filename'])[1]/@value"/> + </xsl:when> + <xsl:otherwise>index.html</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="dir"> + <xsl:apply-templates select="." mode="calculate-dir"/> + </xsl:variable> + + <xsl:if test="$filename = ''"> + <xsl:message terminate="yes"> + <xsl:value-of select="@page"/> + <xsl:text>: missing filename.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:message> + <xsl:value-of select="@page"/> + <xsl:text>: </xsl:text> + <xsl:if test="$dir != ''"> + <xsl:value-of select="$dir"/> + </xsl:if> + <xsl:value-of select="$filename"/> + </xsl:message> + + <xsl:attribute name="page"> + <xsl:value-of select="@page"/> + </xsl:attribute> + <xsl:attribute name="id"> + <xsl:value-of select="$id"/> + </xsl:attribute> + <xsl:if test="$dir != ''"> + <xsl:attribute name="dir"> + <xsl:value-of select="$dir"/> + </xsl:attribute> + </xsl:if> + <xsl:attribute name="filename"> + <xsl:value-of select="$filename"/> + </xsl:attribute> + <xsl:if test="@tocskip = '1'"> + <xsl:attribute name="tocskip"> + <xsl:value-of select="@tocskip"/> + </xsl:attribute> + </xsl:if> + + <xsl:text> </xsl:text> + <xsl:choose> + <xsl:when test="title"> + <xsl:apply-templates select="title" mode="copy"/> + </xsl:when> + <xsl:otherwise> + <title> + <xsl:apply-templates select="$page/*[1]/head/title"/> + </title> + </xsl:otherwise> + </xsl:choose> + <xsl:text> </xsl:text> + + <xsl:if test="titleabbrev or $page/*[1]/head/titleabbrev"> + <xsl:choose> + <xsl:when test="titleabbrev"> + <xsl:apply-templates select="titleabbrev" mode="copy"/> + </xsl:when> + <xsl:otherwise> + <titleabbrev> + <xsl:apply-templates select="$page/*[1]/head/titleabbrev"/> + </titleabbrev> + </xsl:otherwise> + </xsl:choose> + <xsl:text> </xsl:text> + </xsl:if> + + <xsl:if test="summary or $page/*[1]/head/summary"> + <xsl:choose> + <xsl:when test="summary"> + <xsl:apply-templates select="summary" mode="copy"/> + </xsl:when> + <xsl:otherwise> + <summary> + <xsl:apply-templates select="$page/*[1]/head/summary"/> + </summary> + </xsl:otherwise> + </xsl:choose> + <xsl:text> </xsl:text> + </xsl:if> + + <xsl:apply-templates select="tocentry"/> +</xsl:template> + +<xsl:template match="*" mode="calculate-dir"> + <xsl:choose> + <xsl:when test="starts-with(@dir, '/')"> + <!-- if the directory on this begins with a "/", we're done... --> + <xsl:value-of select="substring-after(@dir, '/')"/> + <xsl:text>/</xsl:text> + </xsl:when> + + <xsl:when test="parent::*"> + <!-- if there's a parent, try it --> + <xsl:apply-templates select="parent::*" mode="calculate-dir"/> + <xsl:if test="@dir"> + <xsl:value-of select="@dir"/> + <xsl:text>/</xsl:text> + </xsl:if> + </xsl:when> + + <xsl:otherwise> + <xsl:if test="@dir"> + <xsl:value-of select="@dir"/> + <xsl:text>/</xsl:text> + </xsl:if> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> diff --git a/website/chunk-common.xsl b/website/chunk-common.xsl new file mode 100644 index 0000000..d750c05 --- /dev/null +++ b/website/chunk-common.xsl @@ -0,0 +1,227 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xweb="xalan://com.nwalsh.xalan.Website" + xmlns:sweb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Website" + exclude-result-prefixes="sweb xweb" + version="1.0"> + +<xsl:output method="html"/> + +<xsl:param name="output-root" select="'.'"/> +<xsl:param name="dry-run" select="'0'"/> +<xsl:param name="rebuild-all" select="'0'"/> + +<xsl:template match="autolayout"> + <!-- Regenerate olink database? --> + <xsl:if test="$collect.xref.targets = 'yes' or + $collect.xref.targets = 'only'"> + <xsl:apply-templates select="." mode="collect.targets"/> + </xsl:if> + + <xsl:if test="$collect.xref.targets != 'only'" > + <xsl:apply-templates select="toc|notoc" mode="make"/> + </xsl:if> +</xsl:template> + +<xsl:template match="toc|tocentry|notoc" mode="make"> + <xsl:call-template name="make.tocentry"/> + <xsl:apply-templates select="tocentry" mode="make"/> +</xsl:template> + +<xsl:template name="make.tocentry"> + <xsl:variable name="srcFile" select="@page"/> + + <xsl:if test="@page and @href"> + <xsl:message terminate="yes"> + <xsl:text>Fail: tocentry has both page and href attributes.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:variable name="filename"> + <xsl:choose> + <xsl:when test="@filename"> + <xsl:value-of select="@filename"/> + </xsl:when> + <xsl:otherwise>index.html</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="dir"> + <xsl:apply-templates select="." mode="calculate-dir"/> + </xsl:variable> + +<!-- + <xsl:message> + <xsl:text>!!</xsl:text> + <xsl:value-of select="$dir"/> + <xsl:text>!!</xsl:text> + <xsl:value-of select="$filename-prefix"/> + <xsl:text>!!</xsl:text> + <xsl:value-of select="$filename"/> + </xsl:message> +--> + + <xsl:variable name="targetFile"> + <xsl:value-of select="$dir"/> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="$filename"/> + </xsl:variable> + + <xsl:choose> + <xsl:when test="function-available('sweb:exists')"> + <xsl:if test="not(@href) and not(sweb:exists($srcFile))"> + <xsl:message terminate="yes"> + <xsl:value-of select="$srcFile"/> + <xsl:text> does not exist.</xsl:text> + </xsl:message> + </xsl:if> + </xsl:when> + <xsl:when test="function-available('xweb:exists')"> + <xsl:if test="not(@href) and not(xweb:exists($srcFile))"> + <xsl:message terminate="yes"> + <xsl:value-of select="$srcFile"/> + <xsl:text> does not exist.</xsl:text> + </xsl:message> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="no"> + <xsl:value-of select="$srcFile"/> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + + <xsl:variable name="output-file"> + <xsl:choose> + <xsl:when test="@href"> + <xsl:value-of select="@href"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$output-root"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="$targetFile"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="needsUpdate"> + <xsl:choose> + <xsl:when test="@href">0</xsl:when> + <xsl:when test="function-available('sweb:needsUpdate')"> + <xsl:choose> + <xsl:when test="$rebuild-all != 0 + or sweb:needsUpdate($autolayout-file, $output-file) + or sweb:needsUpdate($srcFile, $output-file)"> + <xsl:text>1</xsl:text> + </xsl:when> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="function-available('xweb:needsUpdate')"> + <xsl:choose> + <xsl:when test="$rebuild-all != 0 + or xweb:needsUpdate($autolayout-file, $output-file) + or xweb:needsUpdate($srcFile, $output-file)"> + <xsl:text>1</xsl:text> + </xsl:when> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$needsUpdate != 0"> + <xsl:message> + <xsl:text>Update: </xsl:text> + <xsl:value-of select="$output-file"/> + <xsl:text>: </xsl:text> + <xsl:value-of select="$srcFile"/> + </xsl:message> + + <xsl:variable name="webpage" select="document($srcFile,.)"/> + <xsl:variable name="content"> + <xsl:apply-templates select="$webpage/webpage"/> + </xsl:variable> + + <xsl:if test="$dry-run = 0"> + <xsl:call-template name="write.chunk"> + <xsl:with-param name="filename" select="$output-file"/> + <xsl:with-param name="content" select="$content"/> + </xsl:call-template> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Up-to-date: </xsl:text> + <xsl:value-of select="$output-file"/> + </xsl:message> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="*" mode="calculate-dir"> + <xsl:choose> + <xsl:when test="@dir"> + <!-- if there's a directory, use it --> + <xsl:choose> + <xsl:when test="starts-with(@dir, '/')"> + <!-- if the directory on this begins with a "/", we're done... --> + <xsl:value-of select="substring-after(@dir, '/')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@dir"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + + <xsl:when test="parent::*"> + <!-- if there's a parent, try it --> + <xsl:apply-templates select="parent::*" mode="calculate-dir"/> + </xsl:when> + + <xsl:otherwise> + <!-- nop --> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="autolayout" mode="collect.targets"> + <xsl:choose> + <xsl:when test="$website.database.document = ''"> + <xsl:message> + Must specify a $website.database.document parameter when + $collect.xref.targets is set to 'yes' or 'only'. + The xref targets were not collected. + </xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="$website.database.document"> + <xsl:call-template name="write.chunk"> + <xsl:with-param name="filename" + select="$website.database.document"/> + <xsl:with-param name="method" select="'xml'"/> + <xsl:with-param name="encoding" select="'utf-8'"/> + <xsl:with-param name="omit-xml-declaration" select="'no'"/> + <xsl:with-param name="indent" select="'yes'"/> + <xsl:with-param name="quiet" select="0"/> + <xsl:with-param name="content"> + <targetset> + <xsl:apply-templates select="." mode="olink.mode"/> + </targetset> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <!-- Else write to standard output --> + <xsl:apply-templates select="." mode="olink.mode"/> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + +</xsl:template> + +</xsl:stylesheet> diff --git a/website/chunk-tabular.xsl b/website/chunk-tabular.xsl new file mode 100644 index 0000000..cdf97cf --- /dev/null +++ b/website/chunk-tabular.xsl @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xweb="xalan://com.nwalsh.xalan.Website" + xmlns:sweb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Website" + exclude-result-prefixes="sweb xweb" + version="1.0"> + +<xsl:import href="tabular.xsl"/> +<xsl:import href="../html/chunker.xsl"/> +<xsl:include href="chunk-common.xsl"/> + +</xsl:stylesheet> diff --git a/website/chunk-website.xsl b/website/chunk-website.xsl new file mode 100644 index 0000000..a9179a0 --- /dev/null +++ b/website/chunk-website.xsl @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xweb="xalan://com.nwalsh.xalan.Website" + xmlns:sweb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Website" + exclude-result-prefixes="sweb xweb" + version="1.0"> + +<xsl:import href="website.xsl"/> +<xsl:import href="../html/chunker.xsl"/> +<xsl:include href="chunk-common.xsl"/> + +</xsl:stylesheet> diff --git a/website/head.xsl b/website/head.xsl new file mode 100644 index 0000000..e3ac308 --- /dev/null +++ b/website/head.xsl @@ -0,0 +1,316 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + +<xsl:template match="head" mode="head.mode"> + <xsl:variable name="nodes" select="*"/> + <head> + <meta name="generator" content="Website XSL Stylesheet V{$VERSION}"/> + <xsl:if test="$html.stylesheet != ''"> + <link rel="stylesheet" href="{$html.stylesheet}" type="text/css"> + <xsl:if test="$html.stylesheet.type != ''"> + <xsl:attribute name="type"> + <xsl:value-of select="$html.stylesheet.type"/> + </xsl:attribute> + </xsl:if> + </link> + </xsl:if> + + <xsl:variable name="thisid" select="ancestor-or-self::webpage/@id"/> + <xsl:variable name="thisrelpath"> + <xsl:apply-templates select="$autolayout//*[@id=$thisid]" mode="toc-rel-path"/> + </xsl:variable> + + <xsl:variable name="topid"> + <xsl:call-template name="top.page"/> + </xsl:variable> + + <xsl:if test="$topid != ''"> + <link rel="home"> + <xsl:attribute name="href"> + <xsl:call-template name="page.uri"> + <xsl:with-param name="page" select="$autolayout//*[@id=$topid]"/> + <xsl:with-param name="relpath" select="$thisrelpath"/> + </xsl:call-template> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:value-of select="$autolayout//*[@id=$topid]/title"/> + </xsl:attribute> + </link> + </xsl:if> + + <xsl:variable name="upid"> + <xsl:call-template name="up.page"/> + </xsl:variable> + + <xsl:if test="$upid != ''"> + <link rel="up"> + <xsl:attribute name="href"> + <xsl:call-template name="page.uri"> + <xsl:with-param name="page" select="$autolayout//*[@id=$upid]"/> + <xsl:with-param name="relpath" select="$thisrelpath"/> + </xsl:call-template> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:value-of select="$autolayout//*[@id=$upid]/title"/> + </xsl:attribute> + </link> + </xsl:if> + + <xsl:variable name="previd"> + <xsl:call-template name="prev.page"/> + </xsl:variable> + + <xsl:if test="$previd != ''"> + <link rel="previous"> + <xsl:attribute name="href"> + <xsl:call-template name="page.uri"> + <xsl:with-param name="page" select="$autolayout//*[@id=$previd]"/> + <xsl:with-param name="relpath" select="$thisrelpath"/> + </xsl:call-template> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:value-of select="$autolayout//*[@id=$previd]/title"/> + </xsl:attribute> + </link> + </xsl:if> + + <xsl:variable name="nextid"> + <xsl:call-template name="next.page"/> + </xsl:variable> + + <xsl:if test="$nextid != ''"> + <link rel="next"> + <xsl:attribute name="href"> + <xsl:call-template name="page.uri"> + <xsl:with-param name="page" select="$autolayout//*[@id=$nextid]"/> + <xsl:with-param name="relpath" select="$thisrelpath"/> + </xsl:call-template> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:value-of select="$autolayout//*[@id=$nextid]/title"/> + </xsl:attribute> + </link> + </xsl:if> + + <xsl:variable name="firstid"> + <xsl:call-template name="first.page"/> + </xsl:variable> + + <xsl:if test="$firstid != ''"> + <link rel="first"> + <xsl:attribute name="href"> + <xsl:call-template name="page.uri"> + <xsl:with-param name="page" select="$autolayout//*[@id=$firstid]"/> + <xsl:with-param name="relpath" select="$thisrelpath"/> + </xsl:call-template> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:value-of select="$autolayout//*[@id=$firstid]/title"/> + </xsl:attribute> + </link> + </xsl:if> + + <xsl:variable name="lastid"> + <xsl:call-template name="last.page"/> + </xsl:variable> + + <xsl:if test="$lastid != ''"> + <link rel="last"> + <xsl:attribute name="href"> + <xsl:call-template name="page.uri"> + <xsl:with-param name="page" select="$autolayout//*[@id=$lastid]"/> + <xsl:with-param name="relpath" select="$thisrelpath"/> + </xsl:call-template> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:value-of select="$autolayout//*[@id=$lastid]/title"/> + </xsl:attribute> + </link> + </xsl:if> + + <xsl:apply-templates select="$autolayout/autolayout/style + |$autolayout/autolayout/script + |$autolayout/autolayout/headlink" + mode="head.mode"> + <xsl:with-param name="webpage" select="ancestor::webpage"/> + </xsl:apply-templates> + <xsl:apply-templates mode="head.mode"/> + <xsl:call-template name="user.head.content"> + <xsl:with-param name="node" select="ancestor::webpage"/> + </xsl:call-template> + </head> +</xsl:template> + +<xsl:template match="title" mode="head.mode"> + <title><xsl:value-of select="."/></title> +</xsl:template> + +<xsl:template match="titleabbrev" mode="head.mode"> + <!--nop--> +</xsl:template> + +<xsl:template match="subtitle" mode="head.mode"> + <!--nop--> +</xsl:template> + +<xsl:template match="summary" mode="head.mode"> + <!--nop--> +</xsl:template> + +<xsl:template match="base" mode="head.mode"> + <base href="{@href}"> + <xsl:if test="@target"> + <xsl:attribute name="target"> + <xsl:value-of select="@target"/> + </xsl:attribute> + </xsl:if> + </base> +</xsl:template> + +<xsl:template match="keywords" mode="head.mode"> + <meta name="keyword" content="{.}"/> + <meta name="keywords" content="{.}"/> +</xsl:template> + +<xsl:template match="copyright" mode="head.mode"> + <!--nop--> +</xsl:template> + +<xsl:template match="author" mode="head.mode"> + <!--nop--> +</xsl:template> + +<xsl:template match="edition" mode="head.mode"> + <!--nop--> +</xsl:template> + +<xsl:template match="meta" mode="head.mode"> + <xsl:choose> + <xsl:when test="@http-equiv"> + <meta http-equiv="{@http-equiv}" content="{@content}"/> + </xsl:when> + <xsl:otherwise> + <meta name="{@name}" content="{@content}"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="script" mode="head.mode"> + <script> + <xsl:choose> + <xsl:when test="@language"> + <xsl:attribute name="language"> + <xsl:value-of select="@language"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="language">JavaScript</xsl:attribute> + </xsl:otherwise> + </xsl:choose> + <xsl:choose> + <xsl:when test="@type"> + <xsl:attribute name="type"> + <xsl:value-of select="@type"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="type">text/javascript</xsl:attribute> + </xsl:otherwise> + </xsl:choose> + <xsl:apply-templates/> + </script> +</xsl:template> + +<xsl:template match="script[@src]" mode="head.mode" priority="2"> + <xsl:param name="webpage" select="ancestor::webpage"/> + <xsl:variable name="relpath"> + <xsl:call-template name="root-rel-path"> + <xsl:with-param name="webpage" select="$webpage"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="language"> + <xsl:choose> + <xsl:when test="@language"> + <xsl:value-of select="@language"/> + </xsl:when> + <xsl:otherwise>JavaScript</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="type"> + <xsl:choose> + <xsl:when test="@type"> + <xsl:value-of select="@type"/> + </xsl:when> + <xsl:otherwise>text/javascript</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <script src="{$relpath}{@src}" language="{$language}" type="{$type}"/> +</xsl:template> + +<xsl:template match="style" mode="head.mode"> + <style> + <xsl:if test="@type"> + <xsl:attribute name="type"> + <xsl:value-of select="@type"/> + </xsl:attribute> + </xsl:if> + + <xsl:apply-templates/> + + </style> +</xsl:template> + +<xsl:template match="style[@src]" mode="head.mode" priority="2"> + <xsl:param name="webpage" select="ancestor::webpage"/> + <xsl:variable name="relpath"> + <xsl:call-template name="root-rel-path"> + <xsl:with-param name="webpage" select="$webpage"/> + </xsl:call-template> + </xsl:variable> + + <xsl:choose> + <xsl:when test="starts-with(@src, '/')"> + <link rel="stylesheet" href="{@src}"> + <xsl:if test="@type"> + <xsl:attribute name="type"> + <xsl:value-of select="@type"/> + </xsl:attribute> + </xsl:if> + </link> + </xsl:when> + <xsl:otherwise> + <link rel="stylesheet" href="{$relpath}{@src}"> + <xsl:if test="@type"> + <xsl:attribute name="type"> + <xsl:value-of select="@type"/> + </xsl:attribute> + </xsl:if> + </link> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="headlink" mode="head.mode"> + <link> + <xsl:copy-of select="@*"/> + </link> +</xsl:template> + +<xsl:template match="abstract" mode="head.mode"> + <!--nop--> +</xsl:template> + +<xsl:template match="revhistory" mode="head.mode"> + <!--nop--> +</xsl:template> + +<xsl:template match="rddl:*" mode="head.mode" + xmlns:rddl='http://www.rddl.org/'> + <!--nop--> +</xsl:template> + +</xsl:stylesheet> diff --git a/website/makefile-dep.xsl b/website/makefile-dep.xsl new file mode 100644 index 0000000..00f810b --- /dev/null +++ b/website/makefile-dep.xsl @@ -0,0 +1,143 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + +<xsl:param name="filename-prefix" select="''"/> +<xsl:param name="depends-file" select="''"/> +<xsl:param name="output-root" select="''"/> +<!-- Additional dependencies for target website --> +<xsl:param name="add-website-depends" select="''"/> +<!-- Remove output root dir instead removing each html output file. + Useful for removing subdirs and none html files: images, css etc. --> +<xsl:param name="remove-output-root" select="0"/> + +<xsl:output method="text"/> + +<xsl:template match="autolayout"> + <xsl:text>website: </xsl:text> + <xsl:value-of select="$add-website-depends"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="toc" mode="all"/> + <xsl:apply-templates select="notoc" mode="all"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="toc"/> + <xsl:apply-templates select="notoc"/> + <xsl:text> </xsl:text> + <xsl:text>distclean: clean +	-rm -f </xsl:text> + <xsl:text>autolayout.xml website.database.xml </xsl:text> + <xsl:text> </xsl:text> + <xsl:value-of select="$depends-file"/> + <xsl:text> </xsl:text> + <xsl:text>clean: </xsl:text> + <xsl:choose> + <xsl:when test="$remove-output-root and not($output-root='')"> + <xsl:text>	-rm -rf </xsl:text> + <xsl:call-template name="output-root"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>	-rm -f </xsl:text> + <xsl:apply-templates select="toc" mode="all"/> + <xsl:apply-templates select="notoc" mode="all"/> + </xsl:otherwise> + </xsl:choose> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="toc"> +<!-- + <xsl:apply-templates select="." mode="calculate-dir"/> +--> + <xsl:call-template name="output-root"/> + <xsl:value-of select="@dir"/> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="@filename"/> + <xsl:text>: </xsl:text> + <xsl:value-of select="@page"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select=".//tocentry"/> +</xsl:template> + +<xsl:template match="tocentry|notoc"> +<!-- + <xsl:apply-templates select="." mode="calculate-dir"/> +--> + <xsl:if test="@filename"> + <xsl:call-template name="output-root"/> + <xsl:value-of select="@dir"/> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="@filename"/> + <xsl:text>: </xsl:text> + <xsl:value-of select="@page"/> + <xsl:text> </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="toc" mode="all"> + <xsl:apply-templates select=".//tocentry" mode="all"/> +<!-- + <xsl:apply-templates select="." mode="calculate-dir"/> +--> + <xsl:call-template name="output-root"/> + <xsl:value-of select="@dir"/> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="@filename"/> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="tocentry|notoc" mode="all"> +<!-- + <xsl:apply-templates select="." mode="calculate-dir"/> +--> + <xsl:if test="@filename"> + <xsl:call-template name="output-root"/> + <xsl:value-of select="@dir"/> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="@filename"/> + <xsl:text> </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="*" mode="calculate-dir"> + <xsl:choose> + <xsl:when test="starts-with(@dir, '/')"> + <!-- if the directory on this begins with a "/", we're done... --> + <xsl:value-of select="substring-after(@dir, '/')"/> +<!-- + <xsl:if test="@dir != '/'"> + <xsl:text>/</xsl:text> + </xsl:if> +--> + </xsl:when> + + <xsl:when test="parent::*"> + <!-- if there's a parent, try it --> + <xsl:apply-templates select="parent::*" mode="calculate-dir"/> + <xsl:if test="@dir"> + <xsl:value-of select="@dir"/> +<!-- + <xsl:text>/</xsl:text> +--> + </xsl:if> + </xsl:when> + + <xsl:otherwise> + <xsl:if test="@dir"> + <xsl:value-of select="@dir"/> +<!-- + <xsl:text>/</xsl:text> +--> + </xsl:if> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="output-root"> + <xsl:if test="$output-root != ''"> + <xsl:value-of select="$output-root"/> + <xsl:text>/</xsl:text> + </xsl:if> +</xsl:template> + + +</xsl:stylesheet> diff --git a/website/olink.xsl b/website/olink.xsl new file mode 100644 index 0000000..6766bdd --- /dev/null +++ b/website/olink.xsl @@ -0,0 +1,297 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + +<xsl:param name="website.database.document" + select="'website.database.xml'"/> + +<xsl:template match="olink"> + <xsl:choose> + <xsl:when test="@targetdoc != '' or @targetptr != ''"> + <xsl:apply-imports/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="olink-entity"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="olink-entity"> + <xsl:variable name="xmlfile" + select="document(unparsed-entity-uri(@targetdocent),$autolayout)"/> + <xsl:variable name="webpage" + select="$xmlfile/webpage"/> + <xsl:variable name="tocentry" + select="$autolayout//*[$webpage/@id=@id]"/> + + <xsl:variable name="dir"> + <xsl:choose> + <xsl:when test="starts-with($tocentry/@dir, '/')"> + <xsl:value-of select="substring($tocentry/@dir, 2)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$tocentry/@dir"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + +<!-- debug + <xsl:message>Olink for <xsl:value-of select="unparsed-entity-uri(@targetdocent)"/></xsl:message> + <xsl:message>Page id <xsl:value-of select="$webpage/@id"/></xsl:message> +--> + + <xsl:choose> + <xsl:when test="@type = 'embed'"> + <xsl:apply-templates select="$xmlfile"/> + </xsl:when> + <xsl:otherwise> + <!-- @type = 'replace' or @type = 'new' --> + <a> + <xsl:if test="@id"> + <xsl:attribute name="name"> + <xsl:value-of select="@id"/> + </xsl:attribute> + </xsl:if> + +<!-- debug + <xsl:message> + <xsl:text>href: </xsl:text> + <xsl:call-template name="root-rel-path"/> + <xsl:text>::</xsl:text> + <xsl:value-of select="$dir"/> + <xsl:text>::</xsl:text> + <xsl:value-of select="$filename-prefix"/> + <xsl:text>::</xsl:text> + <xsl:value-of select="$tocentry/@filename"/> + <xsl:text>::</xsl:text> + <xsl:if test="@localinfo"> + <xsl:text>#</xsl:text> + <xsl:value-of select="@localinfo"/> + </xsl:if> + </xsl:message> +--> + + <xsl:attribute name="href"> + <xsl:call-template name="root-rel-path"/> + <xsl:value-of select="$dir"/> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="$tocentry/@filename"/> + <xsl:if test="@localinfo"> + <xsl:text>#</xsl:text> + <xsl:value-of select="@localinfo"/> + </xsl:if> + </xsl:attribute> + + <xsl:if test="@type = 'new'"> + <xsl:attribute name="target">_blank</xsl:attribute> + </xsl:if> + + <xsl:choose> + <xsl:when test="count(node()) = 0"> + <xsl:apply-templates select="$webpage/head/title"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </a> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- Customize the selection to use both website and offsite databases --> +<xsl:template name="select.target.database"> + <xsl:param name="targetdoc.att" select="''"/> + <xsl:param name="targetptr.att" select="''"/> + <xsl:param name="olink.lang" select="''"/> + + <!-- Is the target in the website database? --> + <xsl:variable name="website.olink.key"> + <xsl:if test="$website.database.document != ''"> + <xsl:call-template name="select.olink.key"> + <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/> + <xsl:with-param name="targetptr.att" select="$targetptr.att"/> + <xsl:with-param name="olink.lang" select="$olink.lang"/> + <xsl:with-param name="target.database" + select="document($website.database.document,/)"/> + </xsl:call-template> + </xsl:if> + </xsl:variable> + + <!-- Is the target in the offsite database? --> + <xsl:variable name="offsite.olink.key"> + <xsl:if test="$target.database.document != ''"> + <xsl:call-template name="select.olink.key"> + <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/> + <xsl:with-param name="targetptr.att" select="$targetptr.att"/> + <xsl:with-param name="olink.lang" select="$olink.lang"/> + <xsl:with-param name="target.database" + select="document($target.database.document,/)"/> + </xsl:call-template> + </xsl:if> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$website.olink.key != ''"> + <xsl:value-of select="$website.database.document"/> + </xsl:when> + <xsl:when test="$offsite.olink.key != ''"> + <xsl:value-of select="$target.database.document"/> + </xsl:when> + <xsl:otherwise> + <!-- Return a bogus string and let the olink template deal with it + <xsl:text>NOMATCHINANYDATABASEDOCUMENT</xsl:text> + --> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- Customize this template to use Website root-relative --> +<xsl:template name="make.olink.href"> + <xsl:param name="olink.key" select="''"/> + <xsl:param name="target.database"/> + + <xsl:if test="$olink.key != ''"> + + <xsl:variable name="targetdoc"> + <xsl:value-of select="substring-before($olink.key, '/')"/> + </xsl:variable> + + <xsl:variable name="targetptr"> + <xsl:value-of select="substring-before(substring-after($olink.key, '/'),'/')"/> + </xsl:variable> + + <xsl:variable name="target.href" > + <xsl:for-each select="$target.database" > + <xsl:value-of select="key('targetptr-key', $olink.key)/@href" /> + </xsl:for-each> + </xsl:variable> + + <xsl:variable name="target.dir" > + <xsl:for-each select="$target.database" > + <xsl:value-of select="key('targetdoc-key', $targetdoc)/@dir" /> + </xsl:for-each> + </xsl:variable> + + <xsl:variable name="target.element" > + <xsl:for-each select="$target.database" > + <xsl:value-of select="key('targetptr-key', $olink.key)/@element" /> + </xsl:for-each> + </xsl:variable> + + <!-- Does the target database use a sitemap? --> + <xsl:variable name="use.sitemap"> + <xsl:choose> + <xsl:when test="$target.database//sitemap">1</xsl:when> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + + <!-- Get the baseuri for this targetptr --> + <xsl:variable name="baseuri" > + <xsl:choose> + <!-- Does the database use a sitemap? --> + <xsl:when test="$use.sitemap != 0" > + <xsl:choose> + <!-- Was current.docid parameter set? --> + <xsl:when test="$current.docid != ''"> + <!-- Was it found in the database? --> + <xsl:variable name="currentdoc.key" > + <xsl:for-each select="$target.database" > + <xsl:value-of select="key('targetdoc-key', + $current.docid)/@targetdoc" /> + </xsl:for-each> + </xsl:variable> + <xsl:choose> + <xsl:when test="$currentdoc.key != ''"> + <xsl:for-each select="$target.database" > + <xsl:call-template name="targetpath" > + <xsl:with-param name="dirnode" + select="key('targetdoc-key', $current.docid)/parent::dir"/> + <xsl:with-param name="targetdoc" select="$targetdoc"/> + </xsl:call-template> + </xsl:for-each > + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Olink error: cannot compute relative </xsl:text> + <xsl:text>sitemap path because $current.docid '</xsl:text> + <xsl:value-of select="$current.docid"/> + <xsl:text>' not found in target database.</xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Olink warning: cannot compute relative </xsl:text> + <xsl:text>sitemap path without $current.docid parameter</xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + <!-- In either case, add baseuri from its document entry--> + <xsl:variable name="docbaseuri"> + <xsl:for-each select="$target.database" > + <xsl:value-of select="key('targetdoc-key', $targetdoc)/@baseuri" /> + </xsl:for-each> + </xsl:variable> + <xsl:if test="$docbaseuri != ''" > + <xsl:value-of select="$docbaseuri"/> + </xsl:if> + </xsl:when> + <!-- No database sitemap in use --> + <xsl:otherwise> + <!-- compute a root-relative path if current page has a @dir --> + <xsl:variable name="root-rel"> + <xsl:call-template name="root-rel-path"/> + </xsl:variable> + <xsl:if test="$root-rel != ''"> + <xsl:value-of select="$root-rel"/> + </xsl:if> + <!-- Add the target's @dir to the path --> + <xsl:if test="$target.dir != ''"> + <xsl:value-of select="$target.dir"/> + </xsl:if> + <!-- Just use any baseuri from its document entry --> + <xsl:variable name="docbaseuri"> + <xsl:for-each select="$target.database" > + <xsl:value-of select="key('targetdoc-key', + $targetdoc)/@baseuri" /> + </xsl:for-each> + </xsl:variable> + <xsl:if test="$docbaseuri != ''" > + <xsl:value-of select="$docbaseuri"/> + </xsl:if> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <!-- Form the href information --> + <xsl:if test="$baseuri != ''"> + <xsl:value-of select="$baseuri"/> + <xsl:if test="substring($target.href,1,1) != '#'"> + <!--xsl:text>/</xsl:text--> + </xsl:if> + </xsl:if> + <xsl:choose> + <xsl:when test="$target.element = 'webpage' and + $targetdoc = $targetptr"> + <!-- Don't output #id because not needed --> + </xsl:when> + <!-- optionally turn off frag for PDF references --> + <xsl:when test="not($insert.olink.pdf.frag = 0 and + translate(substring($baseuri, string-length($baseuri) - 3), + 'PDF', 'pdf') = '.pdf' + and starts-with($target.href, '#') )"> + <xsl:value-of select="$target.href"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$target.href"/> + </xsl:otherwise> + </xsl:choose> + </xsl:if> +</xsl:template> + + +</xsl:stylesheet> diff --git a/website/param.xml b/website/param.xml new file mode 100644 index 0000000..0be62a8 --- /dev/null +++ b/website/param.xml @@ -0,0 +1,788 @@ +<?xml version="1.0" encoding="ASCII"?> +<book version="5.0"> +<info> +<title>Website Parameter Reference</title> +<releaseinfo role="meta"> +$Id: param.xweb 7076 2007-07-18 16:20:33Z xmldoc $ +</releaseinfo> +<author> + <personname> + <surname>Walsh</surname> + <firstname>Norman</firstname> + </personname> +</author> +<copyright> + <year>2002-2005</year> + <holder>Norman Walsh</holder> +</copyright> +<abstract> + <para>This is reference documentation for all user-configurable + parameters in the DocBook XSL Website stylesheet (for + generating websites from DocBook XML sources). Note that the + Website stylesheet is a customization layer of the DocBook XSL + HTML stylesheet. Therefore, in addition to the + Website-specific parameters listed in this section, you can + also use a number of <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../html/">HTML + stylesheet parameters</link> to control Website output.</para> +</abstract> +</info> +<reference xml:id="general"> +<title>General Parameters</title> +<refentry version="5.0" xml:id="autolayout-file"> +<refmeta> +<refentrytitle>autolayout-file</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">filename</refmiscinfo> +</refmeta> +<refnamediv> +<refname>autolayout-file</refname> +<refpurpose>Identifies the autolayout.xml file</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="autolayout-file.frag"> +<xsl:param name="autolayout-file">autolayout.xml</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>When the source pages are spread over several directories, this +parameter can be set (for example, from the command line of a batch-mode +XSLT processor) to indicate the location of the autolayout.xml file.</para> +<para>FIXME: for browser-based use, there needs to be a PI for this... +</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="body.attributes"> +<refmeta> +<refentrytitle>body.attributes</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">attribute set</refmiscinfo> +</refmeta> +<refnamediv> +<refname>body.attributes</refname> +<refpurpose>DEPRECATED</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="body.attributes.frag"> +<xsl:attribute-set name="body.attributes"> + <xsl:attribute name="bgcolor">white</xsl:attribute> + <xsl:attribute name="text">black</xsl:attribute> + <xsl:attribute name="link">#0000FF</xsl:attribute> + <xsl:attribute name="vlink">#840084</xsl:attribute> + <xsl:attribute name="alink">#0000FF</xsl:attribute> +</xsl:attribute-set> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>DEPRECATED</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="currentpage.marker"> +<refmeta> +<refentrytitle>currentpage.marker</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">string</refmiscinfo> +</refmeta> +<refnamediv> +<refname>currentpage.marker</refname> +<refpurpose>The text symbol used to mark the current page</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="currentpage.marker.frag"> +<xsl:param name="currentpage.marker">@</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>Character to use as identifying the current page in </para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="dry-run"> +<refmeta> +<refentrytitle>dry-run</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> +</refmeta> +<refnamediv> +<refname>dry-run</refname> +<refpurpose>Indicates that no files should be produced</refpurpose> +</refnamediv> +<refsynopsisdiv> + <programlisting xml:id="dry-run.frag"> + <xsl:param name="dry-run" select="0"></xsl:param> + </programlisting> +</refsynopsisdiv> +<refsection><info><title>Description</title></info> +<para>When using the XSLT processor to manage dependencies and construct +the website, this parameter can be used to suppress the generation of +new and updated files. Effectively, this allows you to see what the +stylesheet would do, without actually making any changes.</para> +<para>Only applies when XSLT-based chunking is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="feedback.href"> +<refmeta> +<refentrytitle>feedback.href</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">uri</refmiscinfo> +</refmeta> +<refnamediv> +<refname>feedback.href</refname> +<refpurpose>HREF (URI) for feedback link</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="feedback.href.frag"> +<xsl:param name="feedback.href"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>The <varname>feedback.href</varname> value is used as the value +for the <tag class="attribute">href</tag> attribute on the feedback +link. If <varname>feedback.href</varname> +is empty, no feedback link is generated.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="feedback.link.text"> +<refmeta> +<refentrytitle>feedback.link.text</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">string</refmiscinfo> +</refmeta> +<refnamediv> +<refname>feedback.link.text</refname> +<refpurpose>The text of the feedback link</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="feedback.link.text.frag"> +<xsl:param name="feedback.link.text">Feedback</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>The contents of this variable is used as the text of the feedback +link if <varname>feedback.href</varname> is not empty. If +<varname>feedback.href</varname> is empty, no feedback link is +generated.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="feedback.with.ids"> +<refmeta> +<refentrytitle>feedback.with.ids</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> +</refmeta> +<refnamediv> +<refname>feedback.with.ids</refname> +<refpurpose>Toggle use of IDs in feedback</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="feedback.with.ids.frag"> +<xsl:param name="feedback.with.ids" select="0"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If <varname>feedback.with.ids</varname> is non-zero, the ID of the +current page will be added to the feedback link. This can be used, for +example, if the <varname>feedback.href</varname> is a CGI script.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="filename-prefix"> +<refmeta> +<refentrytitle>filename-prefix</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">string</refmiscinfo> +</refmeta> +<refnamediv> +<refname>filename-prefix</refname> +<refpurpose>Prefix added to all filenames</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="filename-prefix.frag"> +<xsl:param name="filename-prefix"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>To produce the <quote>text-only</quote> (that is, non-tabular) layout +of a website simultaneously with the tabular layout, the filenames have to +be distinguished. That's accomplished by adding the +<varname>filename-prefix</varname> to the front of each filename.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="footer.hr"> +<refmeta> +<refentrytitle>footer.hr</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> +</refmeta> +<refnamediv> +<refname>footer.hr</refname> +<refpurpose>Toggle <HR> before footer</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="footer.hr.frag"> +<xsl:param name="footer.hr" select="1"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If non-zero, an <HR> is generated at the bottom of each web page, +before the footer.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="header.hr"> +<refmeta> +<refentrytitle>header.hr</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> +</refmeta> +<refnamediv> +<refname>header.hr</refname> +<refpurpose>Toggle <HR> after header</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="header.hr.frag"> +<xsl:param name="header.hr" select="1"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If non-zero, an <HR> is generated at the bottom of each web page, +before the footer.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="output-root"> +<refmeta> +<refentrytitle>output-root</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">filename</refmiscinfo> +</refmeta> +<refnamediv> +<refname>output-root</refname> +<refpurpose>Specifies the root directory of the website</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="output-root.frag"> +<xsl:param name="output-root">.</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>When using the XSLT processor to manage dependencies and construct +the website, this parameter can be used to indicate the root directory +where the resulting pages are placed.</para> +<para>Only applies when XSLT-based chunking is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="rebuild-all"> +<refmeta> +<refentrytitle>rebuild-all</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> +</refmeta> +<refnamediv> +<refname>rebuild-all</refname> +<refpurpose>Indicates that all files should be produced</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="rebuild-all.frag"> +<xsl:param name="rebuild-all" select="0"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>When using the XSLT processor to manage dependencies and construct +the website, this parameter can be used to regenerate the whole website, +updating even pages that don't appear to need to be updated.</para> +<para>The dependency extension only looks at the source documents. So +if you change something in the stylesheet, for example, that has a global +effect, you can use this parameter to force the stylesheet to rebuild the +whole website. +</para> +<para>Only applies when XSLT-based chunking is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="sequential.links"> +<refmeta> +<refentrytitle>sequential.links</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> +</refmeta> +<refnamediv> +<refname>sequential.links</refname> +<refpurpose>Make sequentional links?</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="sequential.links.frag"> +<xsl:param name="sequential.links" select="0"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>FIXME</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="suppress.homepage.title"> +<refmeta> +<refentrytitle>suppress.homepage.title</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> +</refmeta> +<refnamediv> +<refname>suppress.homepage.title</refname> +<refpurpose>Suppress title on homepage?</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="suppress.homepage.title.frag"> +<xsl:param name="suppress.homepage.title" select="1"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>FIXME:If non-zero, the title on the homepage is suppressed?</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="table.spacer.image"> +<refmeta> +<refentrytitle>table.spacer.image</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">filename</refmiscinfo> +</refmeta> +<refnamediv> +<refname>table.spacer.image</refname> +<refpurpose>Invisible pixel for tabular accessibility</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="table.spacer.image.frag"> +<xsl:param name="table.spacer.image">graphics/spacer.gif</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>This is the 1x1 pixel, transparent pixel used for <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://diveintoaccessibility.org/day_10_presenting_your_main_content_first.html">the table trick</link> to increase the accessibility of the tabular +website presentation.</para> +</refsection> +</refentry> + +</reference> +<reference xml:id="nav"> +<title>Navigation Parameters</title> +<refentry version="5.0" xml:id="banner.before.navigation"> +<refmeta> +<refentrytitle>banner.before.navigation</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> +</refmeta> +<refnamediv> +<refname>banner.before.navigation</refname> +<refpurpose>Put banner before navigation?</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="banner.before.navigation.frag"> +<xsl:param name="banner.before.navigation" select="1"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>FIXME</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="navbgcolor"> +<refmeta> +<refentrytitle>navbgcolor</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">color</refmiscinfo> +</refmeta> +<refnamediv> +<refname>navbgcolor</refname> +<refpurpose>The background color of the navigation TOC</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="navbgcolor.frag"> +<xsl:param name="navbgcolor">#4080FF</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>The background color of the navigation TOC.</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="navbodywidth"> +<refmeta> +<refentrytitle>navbodywidth</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">length</refmiscinfo> +</refmeta> +<refnamediv> +<refname>navbodywidth</refname> +<refpurpose>Specifies the width of the navigation table body</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="navbodywidth.frag"> +<xsl:param name="navbodywidth"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>The width of the body column.</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="nav.table.summary"> +<refmeta> +<refentrytitle>nav.table.summary</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">string</refmiscinfo> +</refmeta> +<refnamediv> +<refname>nav.table.summary</refname> +<refpurpose>HTML Table summary attribute value for navigation tables</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="nav.table.summary.frag"> +<xsl:param name="nav.table.summary">Navigation</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>The value of this parameter is used as the value of the table +summary attribute for the navigation table.</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="navtocwidth"> +<refmeta> +<refentrytitle>navtocwidth</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">length</refmiscinfo> +</refmeta> +<refnamediv> +<refname>navtocwidth</refname> +<refpurpose>Specifies the width of the navigation table TOC</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="navtocwidth.frag"> +<xsl:param name="navtocwidth">220</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>The width, in pixels, of the navigation column.</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="textbgcolor"> +<refmeta> +<refentrytitle>textbgcolor</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">color</refmiscinfo> +</refmeta> +<refnamediv> +<refname>textbgcolor</refname> +<refpurpose>The background color of the table body</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="textbgcolor.frag"> +<xsl:param name="textbgcolor">white</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>The background color of the table body.</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +</reference> +<reference xml:id="toc"> +<title>ToC Parameters</title> +<refentry version="5.0" xml:id="toc.blank.graphic"> +<refmeta> +<refentrytitle>toc.blank.graphic</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> +</refmeta> +<refnamediv> +<refname>toc.blank.graphic</refname> +<refpurpose>Use graphic for "blanks" in TOC?</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="toc.blank.graphic.frag"> +<xsl:param name="toc.blank.graphic" select="1"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If non-zero, "blanks" in the the TOC will be accomplished +with the graphic identified by <varname>toc.spacer.image</varname>. +</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="toc.blank.image"> +<refmeta> +<refentrytitle>toc.blank.image</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">filename</refmiscinfo> +</refmeta> +<refnamediv> +<refname>toc.blank.image</refname> +<refpurpose>The image for "blanks" in the TOC</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="toc.blank.image.frag"> +<xsl:param name="toc.blank.image">graphics/blank.gif</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If <varname>toc.blank.graphic</varname> is non-zero, this image +will be used to for "blanks" in the TOC.</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="toc.blank.text"> +<refmeta> +<refentrytitle>toc.blank.text</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">string</refmiscinfo> +</refmeta> +<refnamediv> +<refname>toc.blank.text</refname> +<refpurpose>The text for "blanks" in the TOC</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="toc.blank.text.frag"> +<xsl:param name="toc.blank.text">   </xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If <varname>toc.blank.graphic</varname> is zero, this text string +will be used for "blanks" in the TOC.</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="toc.pointer.graphic"> +<refmeta> +<refentrytitle>toc.pointer.graphic</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> +</refmeta> +<refnamediv> +<refname>toc.pointer.graphic</refname> +<refpurpose>Use graphic for TOC pointer?</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="toc.pointer.graphic.frag"> +<xsl:param name="toc.pointer.graphic" select="1"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If non-zero, the "pointer" in the TOC will be displayed +with the graphic identified by <varname>toc.pointer.image</varname>. +</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="toc.pointer.image"> +<refmeta> +<refentrytitle>toc.pointer.image</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">filename</refmiscinfo> +</refmeta> +<refnamediv> +<refname>toc.pointer.image</refname> +<refpurpose>The image for the "pointer" in the TOC</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="toc.pointer.image.frag"> +<xsl:param name="toc.pointer.image">graphics/arrow.gif</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If <varname>toc.pointer.graphic</varname> is non-zero, this image +will be used for the "pointer" in the TOC.</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="toc.pointer.text"> +<refmeta> +<refentrytitle>toc.pointer.text</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">string</refmiscinfo> +</refmeta> +<refnamediv> +<refname>toc.pointer.text</refname> +<refpurpose>The text for the "pointer" in the TOC</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="toc.pointer.text.frag"> +<xsl:param name="toc.pointer.text"> > </xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If <varname>toc.pointer.graphic</varname> is zero, this text string +will be used to display the "pointer" in the TOC.</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="toc.spacer.graphic"> +<refmeta> +<refentrytitle>toc.spacer.graphic</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> +</refmeta> +<refnamediv> +<refname>toc.spacer.graphic</refname> +<refpurpose>Use graphic for TOC spacer?</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="toc.spacer.graphic.frag"> +<xsl:param name="toc.spacer.graphic" select="1"></xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If non-zero, the indentation in the TOC will be accomplished +with the graphic identified by <varname>toc.spacer.image</varname>. +</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="toc.spacer.image"> +<refmeta> +<refentrytitle>toc.spacer.image</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">filename</refmiscinfo> +</refmeta> +<refnamediv> +<refname>toc.spacer.image</refname> +<refpurpose>The image for spacing the TOC</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="toc.spacer.image.frag"> +<xsl:param name="toc.spacer.image">graphics/blank.gif</xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If <varname>toc.spacer.graphic</varname> is non-zero, this image +will be used to indent the TOC.</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +<refentry version="5.0" xml:id="toc.spacer.text"> +<refmeta> +<refentrytitle>toc.spacer.text</refentrytitle> +<refmiscinfo class="other" otherclass="datatype">string</refmiscinfo> +</refmeta> +<refnamediv> +<refname>toc.spacer.text</refname> +<refpurpose>The text for spacing the TOC</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<programlisting xml:id="toc.spacer.text.frag"> +<xsl:param name="toc.spacer.text">   </xsl:param> +</programlisting> +</refsynopsisdiv> + +<refsection><info><title>Description</title></info> +<para>If <varname>toc.spacer.graphic</varname> is zero, this text string +will be used to indent the TOC.</para> +<para>Only applies with the tabular presentation is being used.</para> +</refsection> +</refentry> + +</reference> +<appendix xml:id="stylesheet"><title>The Stylesheet</title> + +<para>The <filename>param.xsl</filename> stylesheet is just a wrapper +around all these parameters.</para> + +<programlisting xml:id="top"> + +<!-- This file is generated from param.xweb --> + +<xsl:stylesheet exclude-result-prefixes="src" version="1.0"> + +<!-- ******************************************************************** + $Id: param.xweb 7076 2007-07-18 16:20:33Z xmldoc $ + ******************************************************************** + + This file is part of the DocBook XSL Stylesheets distribution. + See ../README or http://docbook.sf.net/release/xsl/current/ for + copyright and other information. + + ******************************************************************** --> + +<src:fragref linkend="autolayout-file.frag"></src:fragref> +<src:fragref linkend="header.hr.frag"></src:fragref> +<src:fragref linkend="footer.hr.frag"></src:fragref> +<src:fragref linkend="feedback.href.frag"></src:fragref> +<src:fragref linkend="feedback.with.ids.frag"></src:fragref> +<src:fragref linkend="feedback.link.text.frag"></src:fragref> +<src:fragref linkend="filename-prefix.frag"></src:fragref> +<src:fragref linkend="output-root.frag"></src:fragref> +<src:fragref linkend="dry-run.frag"></src:fragref> +<src:fragref linkend="rebuild-all.frag"></src:fragref> +<src:fragref linkend="nav.table.summary.frag"></src:fragref> +<src:fragref linkend="navtocwidth.frag"></src:fragref> +<src:fragref linkend="navbodywidth.frag"></src:fragref> +<src:fragref linkend="textbgcolor.frag"></src:fragref> +<src:fragref linkend="navbgcolor.frag"></src:fragref> +<src:fragref linkend="toc.spacer.graphic.frag"></src:fragref> +<src:fragref linkend="toc.spacer.text.frag"></src:fragref> +<src:fragref linkend="toc.spacer.image.frag"></src:fragref> +<src:fragref linkend="toc.pointer.graphic.frag"></src:fragref> +<src:fragref linkend="toc.pointer.text.frag"></src:fragref> +<src:fragref linkend="toc.pointer.image.frag"></src:fragref> +<src:fragref linkend="toc.blank.graphic.frag"></src:fragref> +<src:fragref linkend="toc.blank.text.frag"></src:fragref> +<src:fragref linkend="toc.blank.image.frag"></src:fragref> +<src:fragref linkend="suppress.homepage.title.frag"></src:fragref> +<src:fragref linkend="body.attributes.frag"></src:fragref> +<src:fragref linkend="sequential.links.frag"></src:fragref> +<src:fragref linkend="currentpage.marker.frag"></src:fragref> +<src:fragref linkend="banner.before.navigation.frag"></src:fragref> +<src:fragref linkend="table.spacer.image.frag"></src:fragref> + +</xsl:stylesheet> +</programlisting> + +</appendix> +</book> diff --git a/website/param.xsl b/website/param.xsl new file mode 100644 index 0000000..ccd1f20 --- /dev/null +++ b/website/param.xsl @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- This file is generated from param.xweb --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + +<!-- ******************************************************************** + $Id: param.xweb 7076 2007-07-18 16:20:33Z xmldoc $ + ******************************************************************** + + This file is part of the DocBook XSL Stylesheets distribution. + See ../README or http://docbook.sf.net/release/xsl/current/ for + copyright and other information. + + ******************************************************************** --> + +<xsl:param name="autolayout-file">autolayout.xml</xsl:param> +<xsl:param name="header.hr" select="1"/> +<xsl:param name="footer.hr" select="1"/> +<xsl:param name="feedback.href"/> +<xsl:param name="feedback.with.ids" select="0"/> +<xsl:param name="feedback.link.text">Feedback</xsl:param> +<xsl:param name="filename-prefix"/> +<xsl:param name="output-root">.</xsl:param> + <xsl:param name="dry-run" select="0"/> + +<xsl:param name="rebuild-all" select="0"/> +<xsl:param name="nav.table.summary">Navigation</xsl:param> +<xsl:param name="navtocwidth">220</xsl:param> +<xsl:param name="navbodywidth"/> +<xsl:param name="textbgcolor">white</xsl:param> +<xsl:param name="navbgcolor">#4080FF</xsl:param> +<xsl:param name="toc.spacer.graphic" select="1"/> +<xsl:param name="toc.spacer.text">   </xsl:param> +<xsl:param name="toc.spacer.image">graphics/blank.gif</xsl:param> +<xsl:param name="toc.pointer.graphic" select="1"/> +<xsl:param name="toc.pointer.text"> > </xsl:param> +<xsl:param name="toc.pointer.image">graphics/arrow.gif</xsl:param> +<xsl:param name="toc.blank.graphic" select="1"/> +<xsl:param name="toc.blank.text">   </xsl:param> +<xsl:param name="toc.blank.image">graphics/blank.gif</xsl:param> +<xsl:param name="suppress.homepage.title" select="1"/> +<xsl:attribute-set name="body.attributes"> + <xsl:attribute name="bgcolor">white</xsl:attribute> + <xsl:attribute name="text">black</xsl:attribute> + <xsl:attribute name="link">#0000FF</xsl:attribute> + <xsl:attribute name="vlink">#840084</xsl:attribute> + <xsl:attribute name="alink">#0000FF</xsl:attribute> +</xsl:attribute-set> +<xsl:param name="sequential.links" select="0"/> +<xsl:param name="currentpage.marker">@</xsl:param> +<xsl:param name="banner.before.navigation" select="1"/> +<xsl:param name="table.spacer.image">graphics/spacer.gif</xsl:param> + +</xsl:stylesheet> diff --git a/website/rss.xsl b/website/rss.xsl new file mode 100644 index 0000000..4f27a24 --- /dev/null +++ b/website/rss.xsl @@ -0,0 +1,143 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:rss="http://purl.org/rss/1.0/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cvsf="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.CVS" + xmlns:cvs="http://nwalsh.com/rdf/cvs#" + xmlns:dc="http://purl.org/dc/elements/1.1/" + exclude-result-prefixes="rss rdf cvs dc cvsf" + version="1.0"> + +<xsl:output method="html"/> + +<xsl:template match="rss"> + <xsl:variable name="rss" select="document(@feed, .)"/> + + <div class='rss'> + <xsl:choose> + <xsl:when test="not($rss)"> + <xsl:message>RSS Failed: <xsl:value-of select="@feed"/></xsl:message> + <xsl:text>[RSS Failed: </xsl:text> + <xsl:value-of select="@feed"/> + </xsl:when> + <xsl:when test="$rss/rdf:RDF"> + <xsl:apply-templates select="$rss/*/rss:channel"/> + </xsl:when> + <xsl:otherwise> + <!-- is there an otherwise case? --> + <xsl:apply-templates select="$rss//rss:channel"/> + </xsl:otherwise> + </xsl:choose> + </div> +</xsl:template> + +<xsl:template match="rss:channel"> + <xsl:variable name="image-resource" select="rss:image/@rdf:resource"/> + <xsl:variable name="image" select="//rss:image[@rdf:about = $image-resource]"/> + + <xsl:if test="$image"> + <xsl:choose> + <xsl:when test="$image/rss:link"> + <a href="{$image/rss:link}"> + <img src="{$image/rss:url}" alt="{$image/rss:title}" align="right" border="0"/> + </a> + </xsl:when> + <xsl:otherwise> + <img src="{$image/rss:url}" alt="{$image/rss:title}" align="right"/> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + + <xsl:apply-templates select="rss:title"/> + <xsl:apply-templates select="rss:description"/> + <xsl:apply-templates select="rss:items"/> + + <xsl:if test="$image"> + <br clear="right"/> + </xsl:if> +</xsl:template> + +<xsl:template match="rss:title"> + <xsl:param name="wrapper" select="'h3'"/> + + <xsl:element name="{$wrapper}"> + <xsl:choose> + <xsl:when test="../rss:link"> + <a href="{../rss:link[1]}"> + <xsl:apply-templates/> + </a> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + + <xsl:if test="../dc:date|../cvs:date"> + <xsl:choose> + <xsl:when test="../dc:date"> + <xsl:text> (</xsl:text> + <xsl:value-of select="../dc:date[1]"/> + <xsl:text>)</xsl:text> + </xsl:when> + <xsl:when test="function-available('cvsf:localTime')"> + <xsl:variable name="timeString" select="cvsf:localTime(../cvs:date[1])"/> + <xsl:text> (</xsl:text> + <xsl:value-of select="substring($timeString, 1, 3)"/> + <xsl:text>, </xsl:text> + <xsl:value-of select="substring($timeString, 9, 2)"/> + <xsl:text> </xsl:text> + <xsl:value-of select="substring($timeString, 5, 3)"/> + <xsl:text> </xsl:text> + <xsl:value-of select="substring($timeString, 25, 4)"/> + <xsl:text>)</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="../cvs:date[1]"/> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + </xsl:element> +</xsl:template> + +<xsl:template match="rss:description"> + <p> + <xsl:apply-templates/> + </p> +</xsl:template> + +<xsl:template match="rss:items"> + <dl> + <xsl:for-each select="rdf:Seq/rdf:li[@rdf:resource and @rdf:resource != '']"> + <xsl:variable name="resource" select="@rdf:resource"/> + <xsl:variable name="item" select="//rss:item[@rdf:about = $resource]"/> + <xsl:if test="not($item)"> + <xsl:message> + <xsl:text>RSS Warning: there is no item labelled: </xsl:text> + <xsl:value-of select="$resource"/> + </xsl:message> + </xsl:if> + <xsl:if test="count($item) > 1"> + <xsl:message> + <xsl:text>RSS Warning: there is more than one item labelled: </xsl:text> + <xsl:value-of select="$resource"/> + </xsl:message> + </xsl:if> + <xsl:apply-templates select="$item"/> + </xsl:for-each> + </dl> +</xsl:template> + +<xsl:template match="rss:item"> + <xsl:message>RSS item: <xsl:value-of select="rss:title"/></xsl:message> + + <xsl:apply-templates select="rss:title"> + <xsl:with-param name="wrapper" select="'dt'"/> + </xsl:apply-templates> + <xsl:if test="rss:description"> + <dd> + <xsl:apply-templates select="rss:description"/> + </dd> + </xsl:if> +</xsl:template> + +</xsl:stylesheet> diff --git a/website/tabular.xsl b/website/tabular.xsl new file mode 100644 index 0000000..14e597e --- /dev/null +++ b/website/tabular.xsl @@ -0,0 +1,213 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html='http://www.w3.org/1999/xhtml' + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + exclude-result-prefixes="html doc" + version="1.0"> + +<xsl:import href="website-common.xsl"/> +<xsl:include href="toc-tabular.xsl"/> + +<xsl:output method="html" + indent="no" + doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" + doctype-system="http://www.w3.org/TR/html4/loose.dtd" +/> + +<xsl:param name="autolayout" select="document($autolayout-file, /*)"/> + +<!-- ==================================================================== --> + +<!-- Netscape gets badly confused if it sees a CSS style... --> +<xsl:param name="admon.style" select="''"/> +<xsl:param name="admon.graphics" select="1"/> +<xsl:param name="admon.graphics.path">graphics/</xsl:param> +<xsl:param name="admon.graphics.extension">.gif</xsl:param> + +<xsl:attribute-set name="table.properties"> + <xsl:attribute name="border">0</xsl:attribute> + <xsl:attribute name="cellpadding">0</xsl:attribute> + <xsl:attribute name="cellspacing">0</xsl:attribute> + <xsl:attribute name="width">100%</xsl:attribute> +</xsl:attribute-set> + +<xsl:attribute-set name="table.navigation.cell.properties"> + <xsl:attribute name="valign">top</xsl:attribute> + <xsl:attribute name="align">left</xsl:attribute> + <!-- width is set with $navotocwidth --> + <xsl:attribute name="bgcolor"> + <xsl:choose> + <xsl:when test="/webpage/config[@param='navbgcolor']/@value[. != '']"> + <xsl:value-of select="/webpage/config[@param='navbgcolor']/@value"/> + </xsl:when> + <xsl:when test="$autolayout/autolayout/config[@param='navbgcolor']/@value[. != '']"> + <xsl:value-of select="$autolayout/autolayout/config[@param='navbgcolor']/@value"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$navbgcolor"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> +</xsl:attribute-set> + +<xsl:attribute-set name="table.body.cell.properties"> + <xsl:attribute name="valign">top</xsl:attribute> + <xsl:attribute name="align">left</xsl:attribute> + <!-- width is set with $navobodywidth --> + <xsl:attribute name="bgcolor"> + <xsl:value-of select="$textbgcolor"/> + </xsl:attribute> +</xsl:attribute-set> + +<xsl:param name="body.columns" select="2"/> + +<!-- ==================================================================== --> + +<xsl:template match="/"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template name="home.navhead"> + <xsl:text>Navhead</xsl:text> +</xsl:template> + +<xsl:template name="home.navhead.upperright"> + <xsl:text>Upper-right</xsl:text> +</xsl:template> + +<xsl:template name="home.navhead.cell"> + <td width="50%" valign="middle" align="left"> + <xsl:call-template name="home.navhead"/> + </td> +</xsl:template> + +<xsl:template name="home.navhead.upperright.cell"> + <td width="50%" valign="middle" align="right"> + <xsl:call-template name="home.navhead.upperright"/> + </td> +</xsl:template> + +<xsl:template name="home.navhead.separator"> + <hr/> +</xsl:template> + +<xsl:template match="webpage"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <xsl:variable name="relpath"> + <xsl:call-template name="root-rel-path"> + <xsl:with-param name="webpage" select="."/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="tocentry" select="$autolayout/autolayout//*[$id=@id]"/> + <xsl:variable name="toc" select="($tocentry/ancestor-or-self::toc + |$autolayout/autolayout/toc[1])[last()]"/> + + <html> + <xsl:apply-templates select="head" mode="head.mode"/> + <xsl:apply-templates select="config" mode="head.mode"/> + <body class="tabular"> + <xsl:call-template name="body.attributes"/> + + <div class="{name(.)}"> + <a name="{$id}"/> + + <xsl:call-template name="allpages.banner"/> + + <table xsl:use-attribute-sets="table.properties" border="0"> + <xsl:if test="$nav.table.summary!=''"> + <xsl:attribute name="summary"> + <xsl:value-of select="normalize-space($nav.table.summary)"/> + </xsl:attribute> + </xsl:if> + <tr> + <td xsl:use-attribute-sets="table.navigation.cell.properties"> + <img src="{$relpath}{$table.spacer.image}" alt=" " width="1" height="1"/> + </td> + <xsl:call-template name="hspacer"> + <xsl:with-param name="vspacer" select="1"/> + </xsl:call-template> + <td rowspan="2" xsl:use-attribute-sets="table.body.cell.properties"> + <xsl:if test="$navbodywidth != ''"> + <xsl:attribute name="width"> + <xsl:value-of select="$navbodywidth"/> + </xsl:attribute> + </xsl:if> + + <xsl:if test="$autolayout/autolayout/toc[1]/@id = $id"> + <table border="0" summary="home page extra headers" + cellpadding="0" cellspacing="0" width="100%"> + <tr> + <xsl:call-template name="home.navhead.cell"/> + <xsl:call-template name="home.navhead.upperright.cell"/> + </tr> + </table> + <xsl:call-template name="home.navhead.separator"/> + </xsl:if> + + <xsl:if test="$autolayout/autolayout/toc[1]/@id != $id + or $suppress.homepage.title = 0"> + <xsl:apply-templates select="./head/title" mode="title.mode"/> + </xsl:if> + + <xsl:apply-templates select="child::node()[not(self::webpage)]"/> + <xsl:call-template name="process.footnotes"/> + <br/> + </td> + </tr> + <tr> + <td xsl:use-attribute-sets="table.navigation.cell.properties"> + <xsl:if test="$navtocwidth != ''"> + <xsl:attribute name="width"> + <xsl:choose> + <xsl:when test="/webpage/config[@param='navtocwidth']/@value[. != '']"> + <xsl:value-of select="/webpage/config[@param='navtocwidth']/@value"/> + </xsl:when> + <xsl:when test="$autolayout/autolayout/config[@param='navtocwidth']/@value[. != '']"> + <xsl:value-of select="$autolayout/autolayout/config[@param='navtocwidth']/@value"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$navtocwidth"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + </xsl:if> + <xsl:choose> + <xsl:when test="$toc"> + <p class="navtoc"> + <xsl:apply-templates select="$toc"> + <xsl:with-param name="pageid" select="@id"/> + </xsl:apply-templates> + </p> + </xsl:when> + <xsl:otherwise> </xsl:otherwise> + </xsl:choose> + </td> + <xsl:call-template name="hspacer"/> + </tr> + <xsl:call-template name="webpage.table.footer"/> + </table> + + <xsl:call-template name="webpage.footer"/> + </div> + + </body> + </html> +</xsl:template> + +<xsl:template name="hspacer"> + <xsl:param name="vspacer" select="0"/> + <!-- nop --> +</xsl:template> + +<xsl:template match="config[@param='filename']" mode="head.mode"> +</xsl:template> + +<xsl:template match="webtoc"> + <!-- nop --> +</xsl:template> + +</xsl:stylesheet> diff --git a/website/toc-tabular.xsl b/website/toc-tabular.xsl new file mode 100644 index 0000000..4809840 --- /dev/null +++ b/website/toc-tabular.xsl @@ -0,0 +1,480 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + +<xsl:output method="html"/> + +<xsl:param name="nav.graphics" select="1"/> +<xsl:param name="nav.pointer" select="1"/> +<xsl:param name="nav.revisionflag" select="1"/> + +<xsl:param name="toc.spacer.text">   </xsl:param> +<xsl:param name="toc.spacer.image">graphics/blank.gif</xsl:param> + +<xsl:param name="nav.icon.path">graphics/navicons/</xsl:param> +<xsl:param name="nav.icon.extension">.gif</xsl:param> + +<!-- styles: folder, folder16, plusminus, triangle, arrow --> +<xsl:param name="nav.icon.style">triangle</xsl:param> + +<xsl:param name="nav.text.spacer"> </xsl:param> +<xsl:param name="nav.text.current.open">+</xsl:param> +<xsl:param name="nav.text.current.page">+</xsl:param> +<xsl:param name="nav.text.other.open"> </xsl:param> +<xsl:param name="nav.text.other.closed"> </xsl:param> +<xsl:param name="nav.text.other.page"> </xsl:param> +<xsl:param name="nav.text.revisionflag.added">New</xsl:param> +<xsl:param name="nav.text.revisionflag.changed">Changed</xsl:param> +<xsl:param name="nav.text.revisionflag.deleted"></xsl:param> +<xsl:param name="nav.text.revisionflag.off"></xsl:param> + +<xsl:param name="nav.text.pointer"><-</xsl:param> + +<xsl:param name="toc.expand.depth" select="1"/> + +<!-- ==================================================================== --> + +<xsl:template match="toc/title|tocentry/title|titleabbrev"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="toc"> + <xsl:param name="pageid" select="@id"/> + + <xsl:variable name="relpath"> + <xsl:call-template name="toc-rel-path"> + <xsl:with-param name="pageid" select="$pageid"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="homebanner" + select="/autolayout/config[@param='homebanner-tabular'][1]"/> + + <xsl:variable name="banner" + select="/autolayout/config[@param='banner-tabular'][1]"/> + + <xsl:choose> + <xsl:when test="$pageid = @id"> + <img align="left" border="0"> + <xsl:attribute name="src"> + <xsl:value-of select="$relpath"/> + <xsl:value-of select="$homebanner/@value"/> + </xsl:attribute> + <xsl:attribute name="alt"> + <xsl:value-of select="$homebanner/@altval"/> + </xsl:attribute> + </img> + <br clear="all"/> + <br/> + </xsl:when> + <xsl:otherwise> + <a href="{$relpath}{@dir}{$filename-prefix}{@filename}"> + <img align="left" border="0"> + <xsl:attribute name="src"> + <xsl:value-of select="$relpath"/> + <xsl:value-of select="$banner/@value"/> + </xsl:attribute> + <xsl:attribute name="alt"> + <xsl:value-of select="$banner/@altval"/> + </xsl:attribute> + </img> + </a> + <br clear="all"/> + <br/> + </xsl:otherwise> + </xsl:choose> + + <xsl:apply-templates select="tocentry"> + <xsl:with-param name="pageid" select="$pageid"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:apply-templates> + <br/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="tocentry"> + <xsl:param name="pageid" select="@id"/> + <xsl:param name="toclevel" select="count(ancestor::*)"/> + <xsl:param name="relpath" select="''"/> + <xsl:param name="revisionflag" select="@revisionflag"/> + + <xsl:variable name="page" select="."/> + <xsl:variable name="target" + select="($page/descendant-or-self::tocentry[not(@tocskip) or @tocskip = '0'] + |$page/following::tocentry[@tocskip and @tocskip='0'])[1]"/> + + <xsl:variable name="depth" select="count(ancestor::*)-1"/> + + <xsl:variable name="isdescendant"> + <xsl:choose> + <xsl:when test="ancestor::*[@id=$pageid]">1</xsl:when> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="hasdescendant"> + <xsl:choose> + <xsl:when test="descendant::tocentry != ''">1</xsl:when> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="isancestor"> + <xsl:choose> + <xsl:when test="descendant::*[@id=$pageid]">1</xsl:when> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="use.toc.expand.depth"> + <xsl:variable name="config-param" select="ancestor::autolayout/config[@param='toc.expand.depth']/@value"/> + <xsl:choose> + <!-- toc.expand.depth attribute is not in DTD --> + <xsl:when test="ancestor::toc/@toc.expand.depth"> + <xsl:value-of select="ancestor::toc/@toc.expand.depth"/> + </xsl:when> + <xsl:when test="floor($config-param) > 0"> + <xsl:value-of select="$config-param"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$toc.expand.depth"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="is.open"> + <xsl:choose> + <xsl:when test="$pageid = @id + or $isancestor='1' + or $depth < $use.toc.expand.depth">1</xsl:when> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <!-- For any entry in the TOC: + 1. It is the current page + a. it is a leaf current/leaf + b. it is an open page current/open + 2. It is not the current page + a. it is a leaf other/leaf + b. it is an open page other/open + c. it is a closed page other/closed + --> + + <xsl:variable name="preceding-icon"> + <xsl:value-of select="$relpath"/> + <xsl:value-of select="$nav.icon.path"/> + <xsl:value-of select="$nav.icon.style"/> + <xsl:choose> + <xsl:when test="$pageid=@id"> + <xsl:choose> + <xsl:when test="$hasdescendant != 0"> + <xsl:text>/current/open</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>/current/leaf</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="$hasdescendant = 0"> + <xsl:text>/other/leaf</xsl:text> + </xsl:when> + <xsl:when test="$is.open != 0"> + <xsl:text>/other/open</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>/other/closed</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$nav.icon.extension"/> + </xsl:variable> + + <xsl:variable name="preceding-text"> + <xsl:choose> + <xsl:when test="$pageid=@id"> + <xsl:choose> + <xsl:when test="$hasdescendant != 0"> + <xsl:value-of select="$nav.text.current.open"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$nav.text.current.page"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="$isancestor != 0"> + <xsl:value-of select="$nav.text.other.open"/> + </xsl:when> + <xsl:when test="$hasdescendant != 0"> + <xsl:value-of select="$nav.text.other.closed"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$nav.text.other.page"/> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="following-icon"> + <xsl:value-of select="$relpath"/> + <xsl:value-of select="$nav.icon.path"/> + <xsl:value-of select="$nav.icon.style"/> + <xsl:text>/current/pointer</xsl:text> + <xsl:value-of select="$nav.icon.extension"/> + </xsl:variable> + + <xsl:variable name="following-text"> + <xsl:value-of select="$nav.text.pointer"/> + </xsl:variable> + + <xsl:variable name="revisionflag-icon"> + <xsl:value-of select="$relpath"/> + <xsl:value-of select="$nav.icon.path"/> + <xsl:value-of select="$nav.icon.style"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="$revisionflag"/> + <xsl:value-of select="$nav.icon.extension"/> + </xsl:variable> + + <xsl:variable name="revisionflag-text"> + <xsl:choose> + <xsl:when test="$revisionflag = 'changed'"> + <xsl:value-of select="$nav.text.revisionflag.changed"/> + </xsl:when> + <xsl:when test="$revisionflag = 'added'"> + <xsl:value-of select="$nav.text.revisionflag.added"/> + </xsl:when> + <xsl:when test="$revisionflag = 'deleted'"> + <xsl:value-of select="$nav.text.revisionflag.deleted"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$nav.text.revisionflag.off"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <span> + <xsl:if test="$toclevel = 2"> + <xsl:attribute name="class"> + <xsl:text>toplevel</xsl:text> + </xsl:attribute> + </xsl:if> + + <xsl:if test="$toclevel > 2"> + <xsl:attribute name="class"> + <xsl:text>shrink</xsl:text> + <xsl:value-of select="$toclevel - 2"/> + </xsl:attribute> + </xsl:if> + + <xsl:call-template name="insert.spacers"> + <xsl:with-param name="count" select="$toclevel - 1"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:call-template> + + <xsl:choose> + <xsl:when test="$nav.graphics != 0"> + <xsl:call-template name="link.to.page"> + <xsl:with-param name="href" select="@href"/> + <xsl:with-param name="page" select="$target"/> + <xsl:with-param name="relpath" select="$relpath"/> + <xsl:with-param name="linktext"> + <img src="{$preceding-icon}" alt="{$preceding-text}" border="0"/> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$preceding-text"/> + </xsl:otherwise> + </xsl:choose> + + <xsl:choose> + <xsl:when test="$pageid = @id"> + <span class="curpage"> + <xsl:choose> + <xsl:when test="titleabbrev"> + <xsl:apply-templates select="titleabbrev"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="title"/> + </xsl:otherwise> + </xsl:choose> + + <xsl:if test="$nav.revisionflag != '0' and $revisionflag"> + <xsl:value-of select="$nav.text.spacer"/> + <xsl:choose> + <xsl:when test="$nav.graphics = '1'"> + <img src="{$revisionflag-icon}" alt="{$revisionflag-text}" align="bottom"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>(</xsl:text> + <xsl:value-of select="$revisionflag-text"/> + <xsl:text>)</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + + <xsl:if test="$nav.pointer != '0'"> + <xsl:value-of select="$nav.text.spacer"/> + <xsl:choose> + <xsl:when test="$nav.graphics = '1'"> + <img src="{$following-icon}" alt="{$following-text}"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$following-text"/> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + </span> + <br/> + </xsl:when> + <xsl:otherwise> + <span> + <xsl:choose> + <xsl:when test="$isdescendant='0'"> + <xsl:choose> + <xsl:when test="$isancestor='1'"> + <xsl:attribute name="class">ancestor</xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="class">otherpage</xsl:attribute> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <!-- IS a descendant of curpage --> + <xsl:attribute name="class">descendant</xsl:attribute> + </xsl:otherwise> + </xsl:choose> + + <xsl:call-template name="link.to.page"> + <xsl:with-param name="href" select="@href"/> + <xsl:with-param name="page" select="$target"/> + <xsl:with-param name="relpath" select="$relpath"/> + <xsl:with-param name="linktext"> + <xsl:choose> + <xsl:when test="titleabbrev"> + <xsl:apply-templates select="titleabbrev"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="title"/> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + + <xsl:if test="$nav.revisionflag != '0' and $revisionflag"> + <xsl:value-of select="$nav.text.spacer"/> + <xsl:choose> + <xsl:when test="$nav.graphics = '1'"> + <img src="{$revisionflag-icon}" alt="{$revisionflag-text}"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>(</xsl:text> + <xsl:value-of select="$revisionflag-text"/> + <xsl:text>)</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + + </span> + <br/> + </xsl:otherwise> + </xsl:choose> + </span> + + <xsl:if test="$is.open != 0"> + <xsl:apply-templates select="tocentry"> + <xsl:with-param name="pageid" select="$pageid"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:apply-templates> + </xsl:if> +</xsl:template> + +<xsl:template name="insert.spacers"> + <xsl:param name="count" select="0"/> + <xsl:param name="relpath"/> + <xsl:if test="$count>0"> + <xsl:choose> + <xsl:when test="$nav.graphics != 0"> + <img src="{$relpath}{$toc.spacer.image}" alt="{$toc.spacer.text}"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$toc.spacer.text"/> + </xsl:otherwise> + </xsl:choose> + <xsl:call-template name="insert.spacers"> + <xsl:with-param name="count" select="$count - 1"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<xsl:template match="toc|tocentry|notoc" mode="toc-rel-path"> + <xsl:call-template name="toc-rel-path"/> +</xsl:template> + +<xsl:template name="toc-rel-path"> + <xsl:param name="pageid" select="@id"/> + <xsl:variable name="entry" select="$autolayout//*[@id=$pageid]"/> + <xsl:variable name="filename" select="concat($entry/@dir,$entry/@filename)"/> + + <xsl:variable name="slash-count"> + <xsl:call-template name="toc-directory-depth"> + <xsl:with-param name="filename" select="$filename"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="depth"> + <xsl:choose> + <xsl:when test="starts-with($filename, '/')"> + <xsl:value-of select="$slash-count - 1"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$slash-count"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + +<!-- + <xsl:message> + <xsl:value-of select="$filename"/> + <xsl:text> depth=</xsl:text> + <xsl:value-of select="$depth"/> + </xsl:message> +--> + + <xsl:if test="$depth > 0"> + <xsl:call-template name="copy-string"> + <xsl:with-param name="string">../</xsl:with-param> + <xsl:with-param name="count" select="$depth"/> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<xsl:template name="toc-directory-depth"> + <xsl:param name="filename"></xsl:param> + <xsl:param name="count" select="0"/> + + <xsl:choose> + <xsl:when test='contains($filename,"/")'> + <xsl:call-template name="toc-directory-depth"> + <xsl:with-param name="filename" + select="substring-after($filename,'/')"/> + <xsl:with-param name="count" select="$count + 1"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$count"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> diff --git a/website/toc.xsl b/website/toc.xsl new file mode 100644 index 0000000..0252ea9 --- /dev/null +++ b/website/toc.xsl @@ -0,0 +1,286 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + +<xsl:output method="html"/> + +<xsl:param name="max.toc.width" select="7"/> + +<xsl:template match="toc/title|tocentry/title|titleabbrev"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="toc"> + <xsl:param name="pageid" select="@id"/> + + <xsl:variable name="relpath"> + <xsl:call-template name="toc-rel-path"> + <xsl:with-param name="pageid" select="$pageid"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="homebanner" + select="/autolayout/config[@param='homebanner'][1]"/> + + <xsl:variable name="banner" + select="/autolayout/config[@param='banner'][1]"/> + + <xsl:variable name="homebannertext" + select="/autolayout/config[@param='homebannertext'][1]"/> + + <xsl:variable name="bannertext" + select="/autolayout/config[@param='bannertext'][1]"/> + + <xsl:choose> + <xsl:when test="$pageid = @id"> + <xsl:choose> + <xsl:when test="$homebanner"> + <img border="0"> + <xsl:attribute name="src"> + <xsl:value-of select="$relpath"/> + <xsl:value-of select="$homebanner/@value"/> + </xsl:attribute> + <xsl:attribute name="alt"> + <xsl:value-of select="$homebanner/@altval"/> + </xsl:attribute> + </img> + <xsl:value-of select="$currentpage.marker"/> + </xsl:when> + <xsl:when test="$homebannertext"> + <xsl:value-of select="$homebannertext/@value"/> + <xsl:value-of select="$currentpage.marker"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="gentext.nav.home"/> + <xsl:value-of select="$currentpage.marker"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <a href="{$relpath}{@dir}{$filename-prefix}{@filename}"> + <xsl:choose> + <xsl:when test="$banner"> + <img border="0"> + <xsl:attribute name="src"> + <xsl:value-of select="$relpath"/> + <xsl:value-of select="$banner/@value"/> + </xsl:attribute> + <xsl:attribute name="alt"> + <xsl:value-of select="$banner/@altval"/> + </xsl:attribute> + </img> + </xsl:when> + <xsl:when test="$bannertext"> + <xsl:value-of select="$bannertext/@value"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="gentext.nav.home"/> + </xsl:otherwise> + </xsl:choose> + </a> + </xsl:otherwise> + </xsl:choose> + + <xsl:text> | </xsl:text> + + <xsl:call-template name="process-children"> + <xsl:with-param name="pageid" select="$pageid"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="tocentry"> + <xsl:param name="pageid" select="@id"/> + <xsl:param name="relpath" select="''"/> + + <xsl:if test="preceding-sibling::tocentry"> + <xsl:text> | </xsl:text> + </xsl:if> + + <xsl:choose> + <xsl:when test="$pageid = @id"> + <xsl:choose> + <xsl:when test="titleabbrev"> + <xsl:apply-templates select="titleabbrev"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="title"/> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$currentpage.marker"/> + </xsl:when> + <xsl:otherwise> + <a> + <xsl:attribute name="href"> + <xsl:choose> + <xsl:when test="@href"> + <xsl:value-of select="@href"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$relpath"/> + <xsl:value-of select="@dir"/> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="@filename"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:choose> + <xsl:when test="titleabbrev"> + <xsl:apply-templates select="titleabbrev"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="title"/> + </xsl:otherwise> + </xsl:choose> + </a> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="toc|tocentry|notoc" mode="toc-rel-path"> + <xsl:call-template name="toc-rel-path"/> +</xsl:template> + +<xsl:template name="toc-rel-path"> + <xsl:param name="pageid" select="@id"/> + <xsl:variable name="entry" select="$autolayout//*[@id=$pageid]"/> + <xsl:variable name="filename" select="concat($entry/@dir,$entry/@filename)"/> + + <xsl:variable name="depth"> + <xsl:call-template name="toc-directory-depth"> + <xsl:with-param name="filename" select="$filename"/> + </xsl:call-template> + </xsl:variable> + + <xsl:if test="$depth > 0"> + <xsl:call-template name="copy-string"> + <xsl:with-param name="string">../</xsl:with-param> + <xsl:with-param name="count" select="$depth"/> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<xsl:template name="toc-directory-depth"> + <xsl:param name="filename"></xsl:param> + <xsl:param name="count" select="0"/> + + <xsl:choose> + <xsl:when test='contains($filename,"/")'> + <xsl:call-template name="toc-directory-depth"> + <xsl:with-param name="filename" + select="substring-after($filename,'/')"/> + <xsl:with-param name="count" select="$count + 1"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$count"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="process-children"> + <xsl:param name="pageid" select="@id"/> + <xsl:param name="relpath" select="''"/> + + <xsl:choose> + <xsl:when test="tocentry[descendant-or-self::*[@id=$pageid]]"> + <xsl:call-template name="process-tocentry-children"> + <xsl:with-param name="pageid" select="$pageid"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="process-toc-children"> + <xsl:with-param name="pageid" select="$pageid"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="process-tocentry-children"> + <xsl:param name="pageid" select="@id"/> + <xsl:param name="relpath" select="''"/> + + <xsl:choose> + <xsl:when test="count(tocentry) > $max.toc.width"> + <xsl:variable name="cur" + select="tocentry[descendant-or-self::*[@id=$pageid]]"/> + + <xsl:variable name="half" select="$max.toc.width div 2"/> + + <xsl:variable name="all-nodes" + select="$cur/preceding-sibling::tocentry[position() < $half] + | $cur + | $cur/following-sibling::tocentry"/> + + <xsl:variable name="nodes" + select="$all-nodes[position() < $max.toc.width]"/> + + <xsl:if test="count($cur/preceding-sibling::tocentry) > $half"> + <xsl:text>...</xsl:text> + </xsl:if> + <xsl:apply-templates select="$nodes"> + <xsl:with-param name="pageid" select="$pageid"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:apply-templates> + <xsl:if test="count($all-nodes) > $max.toc.width"> + <xsl:text> | ...</xsl:text> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="tocentry"> + <xsl:with-param name="pageid" select="$pageid"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + + <br/> + + <!-- if the current page isn't in this list, keep digging... --> + <xsl:if test="not(tocentry[$pageid=@id])"> + <xsl:for-each select="tocentry"> + <xsl:if test="descendant::*[@id=$pageid]"> + <xsl:call-template name="process-children"> + <xsl:with-param name="pageid" select="$pageid"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:call-template> + </xsl:if> + </xsl:for-each> + </xsl:if> +</xsl:template> + +<xsl:template name="process-toc-children"> + <xsl:param name="pageid" select="@id"/> + <xsl:param name="relpath" select="''"/> + + <xsl:choose> + <xsl:when test="count(tocentry) > $max.toc.width"> + <xsl:variable name="half" select="$max.toc.width div 2"/> + + <xsl:variable name="all-nodes" select="tocentry"/> + <xsl:variable name="nodes" + select="$all-nodes[position() < $max.toc.width]"/> + + <xsl:apply-templates select="$nodes"> + <xsl:with-param name="pageid" select="$pageid"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:apply-templates> + + <xsl:if test="count($all-nodes) > $max.toc.width"> + <xsl:text> | ...</xsl:text> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="tocentry"> + <xsl:with-param name="pageid" select="$pageid"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + + <br/> +</xsl:template> + +</xsl:stylesheet> diff --git a/website/website-common.xsl b/website/website-common.xsl new file mode 100644 index 0000000..370062a --- /dev/null +++ b/website/website-common.xsl @@ -0,0 +1,821 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html='http://www.w3.org/1999/xhtml' + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + exclude-result-prefixes="doc html" + version='1.0'> + +<!-- ******************************************************************** + $Id: website-common.xsl 8100 2008-08-03 18:15:51Z mzjn $ + ******************************************************************** + + This file is part of the WebSite distribution. + See ../README or http://nwalsh.com/website/ for copyright + copyright and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:import href="../html/docbook.xsl"/> +<xsl:import href="xbel.xsl"/> +<xsl:include href="../VERSION"/> +<xsl:include href="param.xsl"/> +<xsl:include href="head.xsl"/> +<xsl:include href="rss.xsl"/> +<xsl:include href="olink.xsl"/> + +<xsl:preserve-space elements="*"/> +<xsl:strip-space elements="website webpage"/> + +<xsl:output method="html" + indent="no"/> + +<!-- ==================================================================== --> + +<xsl:template name="admon.graphic"> + <xsl:param name="node" select="."/> + <xsl:call-template name="root-rel-path"/> + <xsl:value-of select="$admon.graphics.path"/> + <xsl:choose> + <xsl:when test="name($node)='note'">note</xsl:when> + <xsl:when test="name($node)='warning'">warning</xsl:when> + <xsl:when test="name($node)='caution'">caution</xsl:when> + <xsl:when test="name($node)='tip'">tip</xsl:when> + <xsl:when test="name($node)='important'">important</xsl:when> + <xsl:otherwise>note</xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$admon.graphics.extension"/> +</xsl:template> + +<doc:template name="admon.graphic"> +<refpurpose>Select appropriate admonition graphic</refpurpose> +<refdescription> +<para>Selects the appropriate admonition graphic file and returns the +fully qualified path to it.</para> +</refdescription> +<refparam> +<variablelist> +<varlistentry><term>node</term> +<listitem> +<para>The source node to use for the purpose of selection. It should +be one of the admonition elements (<sgmltag>note</sgmltag>, +<sgmltag>warning</sgmltag>, etc.). The default node is the context +node.</para> +</listitem> +</varlistentry> +</variablelist> +</refparam> +<refreturns> +<para>The fully qualified path to the admonition graphic. If the +<varname>node</varname> is not an admonition element, the + <quote>note</quote> graphic is returned.</para> +</refreturns> +</doc:template> + +<!-- ==================================================================== --> + +<xsl:template match="/"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="allpages.banner"/> + +<!-- ==================================================================== --> + +<xsl:template name="webpage.table.footer"/> + +<xsl:template name="webpage.footer"> + <xsl:variable name="page" select="."/> + <xsl:variable name="footers" select="$page/config[@param='footer'] + |$page/config[@param='footlink'] + |$autolayout/autolayout/config[@param='footer'] + |$autolayout/autolayout/config[@param='footlink']"/> + + <xsl:variable name="tocentry" select="$autolayout//*[@id=$page/@id]"/> + <xsl:variable name="toc" select="($tocentry/ancestor-or-self::toc[1] + | $autolayout//toc[1])[last()]"/> + + <xsl:variable name="feedback"> + <xsl:choose> + <xsl:when test="$page/config[@param='feedback.href']"> + <xsl:value-of select="($page/config[@param='feedback.href'])[1]/@value"/> + </xsl:when> + <xsl:when test="$autolayout/autolayout/config[@param='feedback.href']"> + <xsl:value-of select="($autolayout/autolayout/config[@param='feedback.href'])[1]/@value"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$feedback.href"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <div class="navfoot"> + <xsl:if test="$footer.hr != 0"><hr/></xsl:if> + <table width="100%" border="0" summary="Footer navigation"> + <tr> + <td width="33%" align="left"> + <span class="footdate"> + <xsl:call-template name="rcsdate.format"> + <xsl:with-param name="rcsdate" + select="$page/config[@param='rcsdate']/@value"/> + </xsl:call-template> + </span> + </td> + <td width="34%" align="center"> + <xsl:choose> + <xsl:when test="not($toc)"> + <xsl:message> + <xsl:text>Cannot determine TOC for </xsl:text> + <xsl:value-of select="$page/@id"/> + </xsl:message> + </xsl:when> + <xsl:when test="$toc/@id = $page/@id"> + <!-- nop; this is the home page --> + </xsl:when> + <xsl:otherwise> + <span class="foothome"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="homeuri"/> + </xsl:attribute> + <xsl:call-template name="gentext.nav.home"/> + </a> + <xsl:if test="$footers"> + <xsl:text> | </xsl:text> + </xsl:if> + </span> + </xsl:otherwise> + </xsl:choose> + + <xsl:apply-templates select="$footers" mode="footer.link.mode"/> + </td> + <td width="33%" align="right"> + <xsl:choose> + <xsl:when test="$feedback != ''"> + <span class="footfeed"> + <a> + <xsl:choose> + <xsl:when test="$feedback.with.ids != 0"> + <xsl:attribute name="href"> + <xsl:value-of select="$feedback"/> + <xsl:value-of select="$page/@id"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="href"> + <xsl:value-of select="$feedback"/> + </xsl:attribute> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$feedback.link.text"/> + </a> + </span> + </xsl:when> + <xsl:otherwise> </xsl:otherwise> + </xsl:choose> + </td> + </tr> + <tr> + <td colspan="3" align="right"> + <span class="footcopy"> + <xsl:choose> + <xsl:when test="head/copyright"> + <xsl:apply-templates select="head/copyright" mode="footer.mode"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates mode="footer.mode" + select="$autolayout/autolayout/copyright"/> + </xsl:otherwise> + </xsl:choose> + </span> + </td> + </tr> + <xsl:if test="$sequential.links != 0"> + <tr> + <xsl:variable name="prev"> + <xsl:call-template name="prev.page"/> + </xsl:variable> + <xsl:variable name="next"> + <xsl:call-template name="next.page"/> + </xsl:variable> + <xsl:variable name="ptoc" + select="$autolayout/autolayout//*[$prev=@id]"/> + <xsl:variable name="ntoc" + select="$autolayout/autolayout//*[$next=@id]"/> + + <td align="left" valign="top"> + <xsl:choose> + <xsl:when test="$prev != ''"> + <xsl:call-template name="link.to.page"> + <xsl:with-param name="frompage" select="$tocentry"/> + <xsl:with-param name="page" select="$ptoc"/> + <xsl:with-param name="linktext" select="'Prev'"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> </xsl:otherwise> + </xsl:choose> + </td> + <td> </td> + <td align="right" valign="top"> + <xsl:choose> + <xsl:when test="$next != ''"> + <xsl:call-template name="link.to.page"> + <xsl:with-param name="frompage" select="$tocentry"/> + <xsl:with-param name="page" select="$ntoc"/> + <xsl:with-param name="linktext" select="'Next'"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> </xsl:otherwise> + </xsl:choose> + </td> + </tr> + </xsl:if> + </table> + </div> +</xsl:template> + +<xsl:template name="rcsdate.format"> + <xsl:param name="rcsdate" select="./config[@param='rcsdate']/@value"/> + <xsl:value-of select="$rcsdate"/> +</xsl:template> + +<xsl:template match="config" mode="footer.link.mode"> + <span class="foothome"> + <xsl:if test="position() > 1"> + <xsl:text> | </xsl:text> + </xsl:if> + <xsl:choose> + <xsl:when test="@param='footlink'"> + <xsl:variable name="id" select="@value"/> + <xsl:variable name="tocentry" + select="$autolayout//*[@id=$id]"/> + <xsl:if test="count($tocentry) != 1"> + <xsl:message> + <xsl:text>Footlink to </xsl:text> + <xsl:value-of select="$id"/> + <xsl:text> does not id a unique page.</xsl:text> + </xsl:message> + </xsl:if> + <xsl:variable name="dir"> + <xsl:choose> + <xsl:when test="starts-with($tocentry/@dir, '/')"> + <xsl:value-of select="substring($tocentry/@dir, 2)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$tocentry/@dir"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="root-rel-path"/> + <xsl:value-of select="$dir"/> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="$tocentry/@filename"/> + </xsl:attribute> + <xsl:value-of select="@altval"/> + </a> + </xsl:when> + <xsl:otherwise> + <a href="{@value}"> + <xsl:value-of select="@altval"/> + </a> + </xsl:otherwise> + </xsl:choose> + </span> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="homeuri"> + <xsl:param name="page" select="ancestor-or-self::webpage"/> + <xsl:variable name="id" select="$page/@id"/> + <xsl:variable name="tocentry" + select="$autolayout//*[@id=$id]"/> + <xsl:variable name="toc" select="$tocentry/ancestor::toc"/> + <xsl:variable name="first-toc" + select="$autolayout/autolayout/toc[1]"/> + + <xsl:call-template name="root-rel-path"/> + <xsl:choose> + <xsl:when test="$toc"> + <xsl:choose> + <xsl:when test="starts-with($toc/@dir, '/')"> + <xsl:value-of select="substring($toc/@dir, 2)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$toc/@dir"/> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="$toc/@filename"/> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="starts-with($first-toc/@dir, '/')"> + <xsl:value-of select="substring($first-toc/@dir, 2)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$first-toc/@dir"/> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="$first-toc/@filename"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="copyright" mode="footer.mode"> + <span class="{name(.)}"> + <xsl:call-template name="gentext.element.name"/> + <xsl:call-template name="gentext.space"/> + <xsl:call-template name="dingbat"> + <xsl:with-param name="dingbat">copyright</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="gentext.space"/> + <xsl:apply-templates select="year" mode="footer.mode"/> + <xsl:call-template name="gentext.space"/> + <xsl:apply-templates select="holder" mode="footer.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="year" mode="footer.mode"> + <xsl:apply-templates/><xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="year[position()=last()]" mode="footer.mode"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="holder" mode="footer.mode"> + <xsl:apply-templates/> + <xsl:if test="position() != last()">, </xsl:if> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="config"> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="head"> +</xsl:template> + +<xsl:template match="head/title" mode="title.mode"> + <h1><xsl:apply-templates/></h1> +</xsl:template> + +<xsl:template match="head/title"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="directory-depth"> + <xsl:param name="dir"></xsl:param> + <xsl:param name="count" select="0"/> + + <xsl:choose> + <xsl:when test='contains($dir,"/")'> + <xsl:call-template name="directory-depth"> + <xsl:with-param name="dir" select="substring-after($dir,'/')"/> + <xsl:with-param name="count" select="$count + 1"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test='$dir=""'> + <xsl:value-of select="$count"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$count + 1"/> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="root-rel-path"> + <xsl:param name="webpage" select="ancestor-or-self::webpage"/> + <xsl:variable name="tocentry" select="$autolayout//*[$webpage/@id=@id]"/> + <xsl:apply-templates select="$tocentry" mode="toc-rel-path"/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="footnote" mode="footnote.number"> + <xsl:choose> + <xsl:when test="ancestor::table|ancestor::informaltable"> + <xsl:number level="any" from="table|informaltable" format="a"/> + </xsl:when> + <xsl:otherwise> + <xsl:number level="any" from="webpage" format="1"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="process.footnotes"> + <!-- we're only interested in footnotes that occur on this page, not + on descendants of this page (which will be similarly processed) --> + <xsl:variable name="thispage" + select="ancestor-or-self::webpage"/> + <xsl:variable name="footnotes" + select=".//footnote[ancestor-or-self::webpage=$thispage]"/> + <xsl:variable name="table.footnotes" + select=".//table//footnote[ancestor-or-self::webpage=$thispage] + |.//informaltable//footnote[ancestor-or-self::webpage + =$thispage]"/> + + <!-- Only bother to do this if there's at least one non-table footnote --> + <xsl:if test="count($footnotes)>count($table.footnotes)"> + <div class="footnotes"> + <hr width="100" align="left"/> + <xsl:apply-templates select="$footnotes" mode="process.footnote.mode"/> + </div> + </xsl:if> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="@*" mode="copy"> + <xsl:attribute name="{local-name(.)}"> + <xsl:value-of select="."/> + </xsl:attribute> +</xsl:template> + +<xsl:template match="html:*"> + <xsl:element name="{local-name(.)}" namespace=""> + <xsl:apply-templates select="@*" mode="copy"/> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="processing-instruction('php')"> + <xsl:processing-instruction name="php"> + <xsl:value-of select="."/> + </xsl:processing-instruction> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="rddl:*" xmlns:rddl='http://www.rddl.org/'> + <xsl:element name="{name(.)}"> + <xsl:apply-templates select="@*" mode="copy"/> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="section[@rddl]" xmlns:rddl='http://www.rddl.org/'> + <xsl:variable name="rddl" select="id(@rddl)"/> + <xsl:choose> + <xsl:when test="local-name($rddl) != 'resource'"> + <xsl:message> + <xsl:text>Warning: section rddl isn't an rddl:resource: </xsl:text> + <xsl:value-of select="@rddl"/> + </xsl:message> + <xsl:apply-imports/> + </xsl:when> + <xsl:otherwise> + <xsl:element name="{name($rddl)}"> + <xsl:apply-templates select="$rddl/@*" mode="copy"/> + <xsl:apply-imports/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="page.uri"> + <xsl:param name="href" select="''"/> + <xsl:param name="page" select="ancestor-or-self::tocentry"/> + <xsl:param name="relpath"> + <xsl:call-template name="toc-rel-path"> + <xsl:with-param name="pageid" select="$page/@id"/> + </xsl:call-template> + </xsl:param> + +<!-- + <xsl:message><xsl:value-of select="$page/@id"/>: <xsl:value-of select="$relpath"/></xsl:message> +--> + + <xsl:variable name="dir"> + <xsl:choose> + <xsl:when test="starts-with($page/@dir, '/')"> + <xsl:value-of select="substring($page/@dir, 2)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$page/@dir"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="html.href"> + <xsl:choose> + <xsl:when test="$href != ''"> + <xsl:value-of select="$href"/> + </xsl:when> + <xsl:when test="$page/@href"> + <xsl:value-of select="$page/@href"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat($relpath,$dir,$filename-prefix)"/> + <xsl:value-of select="$page/@filename"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:value-of select="$html.href"/> +</xsl:template> + +<xsl:template name="link.to.page"> + <xsl:param name="href" select="''"/> + <xsl:param name="frompage"/> + <xsl:param name="page" select="ancestor-or-self::tocentry"/> + <xsl:param name="relpath"> + <xsl:choose> + <xsl:when test="$frompage"> + <xsl:call-template name="toc-rel-path"> + <xsl:with-param name="pageid" select="$frompage/@id"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="toc-rel-path"> + <xsl:with-param name="pageid" select="$page/@id"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + <xsl:param name="linktext" select="'???'"/> + + <a> + <xsl:attribute name="href"> + <xsl:call-template name="page.uri"> + <xsl:with-param name="href" select="$href"/> + <xsl:with-param name="page" select="$page"/> + <xsl:with-param name="relpath" select="$relpath"/> + </xsl:call-template> + </xsl:attribute> + <xsl:if test="summary"> + <xsl:attribute name="title"> + <xsl:value-of select="normalize-space(string(summary))"/> + </xsl:attribute> + </xsl:if> + <xsl:copy-of select="$linktext"/> + </a> +</xsl:template> + +<xsl:template name="next.page"> + <xsl:param name="page" select="ancestor-or-self::webpage"/> + <xsl:variable name="id" select="$page/@id"/> + <xsl:variable name="tocentry" + select="$autolayout//*[@id=$id]"/> + <xsl:variable name="next-following" + select="$tocentry/following::tocentry[1]"/> + <xsl:variable name="next-child" + select="$tocentry/descendant::tocentry[1]"/> + + <xsl:variable name="nextid"> + <xsl:choose> + <xsl:when test="$next-child"> + <xsl:value-of select="$next-child/@id"/> + </xsl:when> + <xsl:when test="$next-following"> + <xsl:value-of select="$next-following/@id"/> + </xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:value-of select="$nextid"/> +</xsl:template> + +<xsl:template name="prev.page"> + <xsl:param name="page" select="ancestor-or-self::webpage"/> + <xsl:variable name="id" select="$page/@id"/> + <xsl:variable name="tocentry" + select="$autolayout//*[@id=$id]"/> + <xsl:variable name="prev-ancestor" + select="($tocentry/ancestor::tocentry + |$tocentry/ancestor::toc)[last()]"/> + <xsl:variable name="prev-sibling" + select="$tocentry/preceding-sibling::tocentry[1]"/> + + <xsl:variable name="previd"> + <xsl:choose> + <xsl:when test="$prev-sibling"> + <xsl:value-of select="$prev-sibling/@id"/> + </xsl:when> + <xsl:when test="$prev-ancestor"> + <xsl:value-of select="$prev-ancestor/@id"/> + </xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:value-of select="$previd"/> +</xsl:template> + +<xsl:template name="top.page"> + <xsl:param name="page" select="ancestor-or-self::webpage"/> + <xsl:variable name="id" select="$page/@id"/> + <xsl:variable name="tocentry" + select="$autolayout//*[@id=$id]"/> + + <xsl:value-of select="$tocentry/ancestor::toc/@id"/> +</xsl:template> + +<xsl:template name="up.page"> + <xsl:param name="page" select="ancestor-or-self::webpage"/> + <xsl:variable name="id" select="$page/@id"/> + <xsl:variable name="tocentry" + select="$autolayout//*[@id=$id]"/> + + <xsl:choose> + <xsl:when test="$tocentry/ancestor::tocentry"> + <xsl:value-of select="$tocentry/ancestor::tocentry[1]/@id"/> + </xsl:when> + <xsl:when test="$tocentry/ancestor::toc"> + <xsl:value-of select="$tocentry/ancestor::toc[1]/@id"/> + </xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="first.page"> + <xsl:param name="page" select="ancestor-or-self::webpage"/> + <xsl:variable name="id" select="$page/@id"/> + <xsl:variable name="tocentry" + select="$autolayout//*[@id=$id]"/> + + <xsl:value-of select="$tocentry/preceding-sibling::tocentry[last()]/@id"/> +</xsl:template> + +<xsl:template name="last.page"> + <xsl:param name="page" select="ancestor-or-self::webpage"/> + <xsl:variable name="id" select="$page/@id"/> + <xsl:variable name="tocentry" + select="$autolayout//*[@id=$id]"/> + + <xsl:variable name="prev-sibling" + select="$tocentry/preceding-sibling::tocentry[1]"/> + + <xsl:value-of select="$tocentry/following-sibling::tocentry[last()]/@id"/> +</xsl:template> + +<xsl:template match="autolayout" mode="collect.targets"> + <targetset> + <xsl:apply-templates mode="olink.mode"/> + </targetset> +</xsl:template> + +<xsl:template match="toc|tocentry|notoc" mode="olink.mode"> + <xsl:text> </xsl:text> + <xsl:call-template name="tocentry"/> + <xsl:apply-templates select="tocentry" mode="olink.mode"/> +</xsl:template> + + +<xsl:template name="tocentry"> + <xsl:choose> + <xsl:when test="@href"> + <!-- no op --> + </xsl:when> + <xsl:otherwise> + <xsl:if test="not(@page)"> + <xsl:message terminate="yes"> + <xsl:text>All toc entries must have a page attribute.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:variable name="page" select="document(@page,.)"/> + + <xsl:if test="not($page/*[1]/@id)"> + <xsl:message terminate="yes"> + <xsl:value-of select="@page"/> + <xsl:text>: missing ID.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:variable name="id" select="$page/*[1]/@id"/> + + <xsl:variable name="filename"> + <xsl:choose> + <xsl:when test="@filename"> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="@filename"/> + </xsl:when> + <xsl:when test="/layout/config[@param='default-filename']"> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="(/layout/config[@param='default-filename'])[1]/@value"/> + </xsl:when> + <xsl:otherwise><xsl:value-of select="$filename-prefix"/>index.html</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="dir" select="@dir"/> + + <xsl:if test="$filename = ''"> + <xsl:message terminate="yes"> + <xsl:value-of select="@page"/> + <xsl:text>: missing filename.</xsl:text> + </xsl:message> + </xsl:if> + + <!-- + <xsl:message> + <xsl:value-of select="@page"/> + <xsl:text>: </xsl:text> + <xsl:if test="$dir != ''"> + <xsl:value-of select="$dir"/> + </xsl:if> + <xsl:value-of select="$filename"/> + </xsl:message> + --> + + <document> + <xsl:attribute name="targetdoc"> + <xsl:value-of select="$id"/> + </xsl:attribute> + <xsl:attribute name="baseuri"> + <xsl:value-of select="$filename"/> + </xsl:attribute> + <xsl:if test="$dir != ''"> + <xsl:attribute name="dir"> + <xsl:value-of select="$dir"/> + </xsl:attribute> + </xsl:if> + + <xsl:apply-templates select="$page" mode="olink.mode"/> + </document> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="webpage" mode="olink.mode"> + <xsl:call-template name="div"/> +</xsl:template> + +<xsl:template match="webpage" mode="xref-to" > + <xsl:param name="referrer"/> + <xsl:param name="xrefstyle"/> + + <xsl:apply-templates select="." mode="object.xref.markup"> + <xsl:with-param name="purpose" select="'xref'"/> + <xsl:with-param name="xrefstyle" select="$xrefstyle"/> + <xsl:with-param name="referrer" select="$referrer"/> + </xsl:apply-templates> + <!-- FIXME: What about "in Chapter X"? --> +</xsl:template> + +<xsl:template match="webpage" mode="title.markup"> + <xsl:param name="allow-anchors" select="0"/> + <xsl:apply-templates select="head/title" + mode="title.markup"> + <xsl:with-param name="allow-anchors" select="$allow-anchors"/> + </xsl:apply-templates> +</xsl:template> + +<xsl:param name="local.l10n.xml" select="document('')" /> +<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> + <l:l10n language="en"> + <l:context name="title"> + <l:template name="webpage" text="%t"/> + </l:context> + <l:context name="xref"> + <l:template name="webpage" text="%t"/> + </l:context> + </l:l10n> + <l:l10n language="de"> + <l:context name="title"> + <l:template name="webpage" text="%t"/> + </l:context> + <l:context name="xref"> + <l:template name="webpage" text="%t"/> + </l:context> + </l:l10n> + <l:l10n language="fr"> + <l:context name="title"> + <l:template name="webpage" text="%t"/> + </l:context> + <l:context name="xref"> + <l:template name="webpage" text="%t"/> + </l:context> + </l:l10n> + <l:l10n language="es"> + <l:context name="title"> + <l:template name="webpage" text="%t"/> + </l:context> + <l:context name="xref"> + <l:template name="webpage" text="%t"/> + </l:context> + </l:l10n> +</l:i18n> +</xsl:stylesheet> diff --git a/website/website-targets.xsl b/website/website-targets.xsl new file mode 100644 index 0000000..2cd0b25 --- /dev/null +++ b/website/website-targets.xsl @@ -0,0 +1,27 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + +<xsl:import href="tabular.xsl"/> + +<xsl:output method="xml" + indent="no" + encoding="utf-8" + doctype-public="-//Norman Walsh//DTD DocBook OLink Summary V2.0//EN" + doctype-system="http://docbook.sourceforge.net/release/xsl/current/common/targetdatabase.dtd"/> + + +<!-- Used only when processing autolayout.xml --> +<xsl:template match="/"> + <xsl:apply-templates mode="collect.targets"/> +</xsl:template> + +<xsl:template match="*"/> + +<xsl:template match="autolayout" mode="collect.targets"> + <targetset> + <xsl:apply-templates mode="olink.mode"/> + </targetset> +</xsl:template> + +</xsl:stylesheet> diff --git a/website/website.xsl b/website/website.xsl new file mode 100644 index 0000000..7364d9b --- /dev/null +++ b/website/website.xsl @@ -0,0 +1,132 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html='http://www.w3.org/1999/xhtml' + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + exclude-result-prefixes="doc html" + version='1.0'> + +<!-- ******************************************************************** + $Id: website.xsl 6910 2007-06-28 23:23:30Z xmldoc $ + ******************************************************************** + + This file is part of the WebSite distribution. + See ../README or http://nwalsh.com/website/ for copyright + copyright and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:include href="website-common.xsl"/> +<xsl:include href="toc.xsl"/> + +<xsl:output method="html" + indent="no"/> + +<xsl:param name="autolayout" select="document($autolayout-file,/*[1])"/> + +<xsl:attribute-set name="body.attributes"/> + +<xsl:template name="body.attributes"> + <!-- Turn off the template from the stock DocBook XSL --> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="webpage"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <xsl:variable name="tocentry" select="$autolayout/autolayout//*[$id=@id]"/> + <xsl:variable name="toc" select="$tocentry/ancestor-or-self::toc"/> + + <html> + <xsl:apply-templates select="head" mode="head.mode"/> + <xsl:apply-templates select="config" mode="head.mode"/> + <body class="website"> + <xsl:call-template name="body.attributes"/> + + <div class="{name(.)}"> + <a name="{$id}"/> + + <xsl:if test="$banner.before.navigation != 0"> + <xsl:call-template name="allpages.banner"/> + </xsl:if> + + <xsl:if test="$toc"> + <div class="navhead"> + <xsl:apply-templates select="$toc"> + <xsl:with-param name="pageid" select="@id"/> + </xsl:apply-templates> + <xsl:if test="$header.hr != 0"><hr/></xsl:if> + </div> + </xsl:if> + + <xsl:if test="$banner.before.navigation = 0"> + <xsl:call-template name="allpages.banner"/> + </xsl:if> + + <xsl:apply-templates select="./head/title" mode="title.mode"/> + + <xsl:apply-templates select="child::node()[not(self::webpage)]"/> + + <xsl:call-template name="process.footnotes"/> + + <xsl:call-template name="webpage.footer"/> + </div> + </body> + </html> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="webtoc"> + <xsl:variable name="webpage" select="ancestor::webpage"/> + <xsl:variable name="relpath"> + <xsl:call-template name="root-rel-path"> + <xsl:with-param name="webpage" select="$webpage"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="pageid" select="$webpage/@id"/> + + <xsl:variable name="pages" + select="$autolayout//*[$pageid=@id]/tocentry"/> + + <xsl:if test="count($pages) > 0"> + <ul class="toc"> + <xsl:for-each select="$pages"> + <li> + <a> + <xsl:attribute name="href"> + <xsl:choose> + <xsl:when test="@href"> + <xsl:value-of select="@href"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$relpath"/> + <xsl:value-of select="@dir"/> + <xsl:value-of select="$filename-prefix"/> + <xsl:value-of select="@filename"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:apply-templates select="title"/> + </a> + <xsl:if test="summary"> + <xsl:text>--</xsl:text> + <xsl:apply-templates select="summary"/> + </xsl:if> + </li> + </xsl:for-each> + </ul> + </xsl:if> +</xsl:template> + +<xsl:template match="toc/summary|tocentry/summary|notoc/summary"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/website/xbel.xsl b/website/xbel.xsl new file mode 100644 index 0000000..ec9873c --- /dev/null +++ b/website/xbel.xsl @@ -0,0 +1,114 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id: xbel.xsl 6910 2007-06-28 23:23:30Z xmldoc $ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://docbook.sf.net/release/xsl/current/ for + copyright and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:output method="xml"/> + +<!-- ==================================================================== --> + +<xsl:template match="xbel"> + <ul> + <xsl:apply-templates/> + </ul> +</xsl:template> + +<!-- Only partial support for xbel elements --> +<xsl:template match="xbel/info|xbel/title|xbel/desc| + xbel/alias|xbel/separator"> + <!-- No op --> +</xsl:template> + +<xsl:template match="folder"> + <li> + <xsl:apply-templates select="title"/> + <ul> + <xsl:apply-templates select="folder|bookmark"/> + </ul> + </li> +</xsl:template> + +<xsl:template match="folder/title"> + <b><xsl:apply-templates/></b> +</xsl:template> + +<xsl:template match="bookmark"> + <li> + <a href="{@href}" target="_top"> + <xsl:apply-templates select="title"/> + </a> + </li> +</xsl:template> + +<xsl:template match="bookmark/title"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="xbel" mode="dynamic"> + <ul> + <xsl:apply-templates mode="dynamic"/> + </ul> +</xsl:template> + +<xsl:template match="info" mode="dynamic"> +</xsl:template> + +<xsl:template match="folder" mode="dynamic"> + <li> + <xsl:apply-templates select="title" mode="dynamic"/> + <ul style="display:none" id="{@id}"> + <xsl:apply-templates select="folder|bookmark" mode="dynamic"/> + </ul> + </li> +</xsl:template> + +<xsl:template match="folder/title" mode="dynamic"> + <b> + <span> + <xsl:choose> + <xsl:when test="../@id"> + <xsl:attribute name="onClick"> + <xsl:text>toggleList('</xsl:text> + <xsl:value-of select="../@id"/> + <xsl:text>')</xsl:text> + </xsl:attribute> + <xsl:attribute name="class">exlist</xsl:attribute> + <xsl:attribute name="style">color: blue</xsl:attribute> + <xsl:apply-templates mode="dynamic"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates mode="dynamic"/> + </xsl:otherwise> + </xsl:choose> + </span> + </b> +</xsl:template> + +<xsl:template match="bookmark" mode="dynamic"> + <li> + <a href="{@href}" target="_top"> + <xsl:apply-templates select="title" mode="dynamic"/> + </a> + </li> +</xsl:template> + +<xsl:template match="bookmark/title" mode="dynamic"> + <xsl:apply-templates mode="dynamic"/> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> |