|
From: <smi...@us...> - 2004-01-02 00:25:50
|
Update of /cvsroot/devil-linux/build/docs/documentation/stylesheets/fo In directory sc8-pr-cvs1:/tmp/cvs-serv15092/fo Added Files: axf.xsl htmltbl.xsl task.xsl Log Message: new stylesheet --- NEW FILE: axf.xsl --- <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" version='1.0'> <!-- ******************************************************************** $Id: axf.xsl,v 1.1 2004/01/02 00:25:47 smiley73 Exp $ ******************************************************************** --> <xsl:template name="axf-document-information"> <xsl:if test="//author[1]"> <xsl:element name="axf:document-info"> <xsl:attribute name="name">author</xsl:attribute> <xsl:attribute name="value"> <xsl:call-template name="person.name"> <xsl:with-param name="node" select="//author[1]"/> </xsl:call-template> </xsl:attribute> </xsl:element> </xsl:if> <xsl:variable name="title"> <xsl:apply-templates select="/*[1]" mode="label.markup"/> <xsl:apply-templates select="/*[1]" mode="title.markup"/> </xsl:variable> <axf:document-info name="title" value="{$title}"/> <xsl:if test="//keyword"> <xsl:element name="axf:document-info"> <xsl:attribute name="name">keywords</xsl:attribute> <xsl:attribute name="value"> <xsl:for-each select="//keyword"> <xsl:value-of select="."/> <xsl:if test="position() != last()"> <xsl:text>, </xsl:text> </xsl:if> </xsl:for-each> </xsl:attribute> </xsl:element> </xsl:if> <xsl:if test="//subjectterm"> <xsl:element name="axf:document-info"> <xsl:attribute name="name">subject</xsl:attribute> <xsl:attribute name="value"> <xsl:for-each select="//subjectterm"> <xsl:value-of select="."/> <xsl:if test="position() != last()"> <xsl:text>, </xsl:text> </xsl:if> </xsl:for-each> </xsl:attribute> </xsl:element> </xsl:if> </xsl:template> </xsl:stylesheet> --- NEW FILE: htmltbl.xsl --- <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <!-- ******************************************************************** $Id: htmltbl.xsl,v 1.1 2004/01/02 00:25:47 smiley73 Exp $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://nwalsh.com/docbook/xsl/ for copyright and other information. ******************************************************************** --> <!-- ==================================================================== --> <xsl:attribute-set name="th.style"> <xsl:attribute name="font-weight">bold</xsl:attribute> </xsl:attribute-set> <xsl:template match="table|informaltable" mode="htmlTable"> <xsl:if test="tgroup/tbody/row |tgroup/thead/row |tgroup/tfoot/row"> <xsl:message terminate="yes">Broken table: row descendent of HTML table.</xsl:message> </xsl:if> <xsl:variable name="numcols"> <xsl:call-template name="widest-html-row"> <xsl:with-param name="rows" select=".//tr"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="caption"> <fo:table-and-caption> <xsl:apply-templates select="caption" mode="htmlTable"/> <fo:table table-layout="fixed"> <xsl:attribute name="width"> <xsl:choose> <xsl:when test="@width"> <xsl:value-of select="@width"/> </xsl:when> <xsl:otherwise>100%</xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:call-template name="make-html-table-columns"> <xsl:with-param name="count" select="$numcols"/> </xsl:call-template> <xsl:apply-templates select="tbody|thead|tfoot" mode="htmlTable"/> </fo:table> </fo:table-and-caption> </xsl:when> <xsl:otherwise> <fo:table table-layout="fixed"> <xsl:attribute name="width"> <xsl:choose> <xsl:when test="@width"> <xsl:value-of select="@width"/> </xsl:when> <xsl:otherwise>100%</xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:call-template name="make-html-table-columns"> <xsl:with-param name="count" select="$numcols"/> </xsl:call-template> <xsl:apply-templates mode="htmlTable"/> </fo:table> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="caption" mode="htmlTable"> <fo:table-caption> <fo:block> <xsl:apply-templates select=".." mode="object.title.markup"> <xsl:with-param name="allow-anchors" select="1"/> </xsl:apply-templates> </fo:block> </fo:table-caption> </xsl:template> <xsl:template name="widest-html-row"> <xsl:param name="rows" select="''"/> <xsl:param name="count" select="0"/> <xsl:choose> <xsl:when test="count($rows) = 0"> <xsl:value-of select="$count"/> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$count > count($rows[1]/*)"> <xsl:call-template name="widest-html-row"> <xsl:with-param name="rows" select="$rows[position() > 1]"/> <xsl:with-param name="count" select="$count"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="widest-html-row"> <xsl:with-param name="rows" select="$rows[position() > 1]"/> <xsl:with-param name="count" select="count($rows[1]/*)"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="make-html-table-columns"> <xsl:param name="count" select="0"/> <xsl:param name="number" select="1"/> <xsl:choose> <xsl:when test="col|colgroup/col"> <xsl:for-each select="col|colgroup/col"> <fo:table-column> <xsl:attribute name="column-number"> <xsl:number from="table" level="any" format="1"/> </xsl:attribute> <xsl:if test="@width"> <xsl:attribute name="column-width"> <xsl:value-of select="@width"/> </xsl:attribute> </xsl:if> </fo:table-column> </xsl:for-each> </xsl:when> <xsl:when test="$fop.extensions != 0"> <xsl:if test="$number <= $count"> <fo:table-column column-number="{$number}" column-width="{6.5 div $count}in"/> <xsl:call-template name="make-html-table-columns"> <xsl:with-param name="count" select="$count"/> <xsl:with-param name="number" select="$number + 1"/> </xsl:call-template> </xsl:if> </xsl:when> </xsl:choose> </xsl:template> <xsl:template match="tbody" mode="htmlTable"> <fo:table-body border-bottom-width="0.25pt" border-bottom-style="solid" border-bottom-color="black"> <xsl:apply-templates mode="htmlTable"/> </fo:table-body> </xsl:template> <xsl:template match="td" mode="htmlTable"> <fo:table-cell> <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> </xsl:template> <xsl:template match="tfoot" mode="htmlTable"> <fo:table-footer> <xsl:apply-templates mode="htmlTable"/> </fo:table-footer> </xsl:template> <xsl:template match="th" mode="htmlTable"> <fo:table-cell xsl:use-attribute-sets="th.style"> <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> </xsl:template> <xsl:template match="thead" mode="htmlTable"> <fo:table-header border-bottom-width="0.25pt" border-bottom-style="solid" border-bottom-color="black" font-weight="bold"> <xsl:apply-templates mode="htmlTable"/> </fo:table-header> </xsl:template> <xsl:template match="tr" mode="htmlTable"> <fo:table-row> <xsl:apply-templates mode="htmlTable"/> </fo:table-row> </xsl:template> </xsl:stylesheet> --- NEW FILE: task.xsl --- <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <!-- ******************************************************************** $Id: task.xsl,v 1.1 2004/01/02 00:25:47 smiley73 Exp $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://nwalsh.com/docbook/xsl/ for copyright and other information. ******************************************************************** --> <!-- ==================================================================== --> <xsl:template match="task"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="param.placement" select="substring-after(normalize-space($formal.title.placement), concat(local-name(.), ' '))"/> <xsl:variable name="placement"> <xsl:choose> <xsl:when test="contains($param.placement, ' ')"> <xsl:value-of select="substring-before($param.placement, ' ')"/> </xsl:when> <xsl:when test="$param.placement = ''">before</xsl:when> <xsl:otherwise> <xsl:value-of select="$param.placement"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="preamble" select="*[not(self::title or self::titleabbrev)]"/> <fo:block id="{$id}" xsl:use-attribute-sets="formal.object.properties"> <xsl:call-template name="anchor"/> <xsl:if test="title and $placement = 'before'"> <xsl:call-template name="formal.object.heading"/> </xsl:if> <xsl:apply-templates select="$preamble"/> <xsl:if test="title and $placement != 'before'"> <xsl:call-template name="formal.object.heading"/> </xsl:if> </fo:block> </xsl:template> <xsl:template match="task/title"> <!-- nop --> </xsl:template> <xsl:template match="tasksummary"> <xsl:call-template name="semiformal.object"/> </xsl:template> <xsl:template match="taskprerequisites"> <xsl:call-template name="semiformal.object"/> </xsl:template> <xsl:template match="taskrelated"> <xsl:call-template name="semiformal.object"/> </xsl:template> </xsl:stylesheet> |