mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
- Better names for some files
- Add the build system
This commit is contained in:
parent
9fb5bcb93e
commit
450386e3ed
@ -32,13 +32,14 @@ endif
|
||||
|
||||
# Paths
|
||||
OUTPUTDIR = output
|
||||
ARCHIVEDIR = output/archive
|
||||
SRCDIR = @srcdir@
|
||||
MANDIR=$(OUTPUTDIR)/manpages
|
||||
EPSTOPDF = @EPSTOPDF@
|
||||
MANPROJDOC = manpages
|
||||
PROJDOC = projdoc
|
||||
MANPAGEDIR = manpages
|
||||
HOWTODIR = howto
|
||||
MAKEINDEX = @MAKEINDEX@
|
||||
IMAGEPROJDIR = $(PROJDOC)/imagefiles
|
||||
IMAGEPROJDIR = $(HOWTODIR)/imagefiles
|
||||
GUIDEDOC = guide
|
||||
EXAMPLESDIR = examples
|
||||
DEVDOC = devdoc
|
||||
@ -47,21 +48,21 @@ PSDIR = $(OUTPUTDIR)
|
||||
PDFDIR = $(OUTPUTDIR)
|
||||
DVIDIR = $(OUTPUTDIR)
|
||||
TXTDIR = $(OUTPUTDIR)/textdocs
|
||||
FAQPROJDOC = faq
|
||||
FAQHOWTODIR = faq
|
||||
FAQDIR = $(OUTPUTDIR)/faq
|
||||
HTMLDIR=$(OUTPUTDIR)/htmldocs
|
||||
PLUCKERDIR=$(OUTPUTDIR)/plucker
|
||||
|
||||
# Lists of files to process
|
||||
LATEX_FIGURES = xslt/figures/caution.pdf xslt/figures/important.pdf xslt/figures/note.pdf xslt/figures/tip.pdf xslt/figures/warning.pdf
|
||||
MANPAGES_SOURCES = $(wildcard $(MANPROJDOC)/*.?.xml)
|
||||
MANPAGES = $(patsubst $(MANPROJDOC)/%.xml,$(MANDIR)/%,$(MANPAGES_SOURCES)) $(MANDIR)/smb.conf.5
|
||||
MANPAGES_HTML = $(patsubst $(MANPROJDOC)/%.xml,$(HTMLDIR)/%.html,$(MANPAGES_SOURCES)) $(HTMLDIR)/smb.conf.5.html
|
||||
MANPAGES_PLUCKER = $(patsubst $(MANPROJDOC)/%.xml,$(PLUCKERDIR)/%.pdb,$(MANPAGES_SOURCES)) $(PLUCKERDIR)/smb.conf.5.pdb
|
||||
MANPAGES_SOURCES = $(wildcard $(MANPAGEDIR)/*.?.xml)
|
||||
MANPAGES = $(patsubst $(MANPAGEDIR)/%.xml,$(MANDIR)/%,$(MANPAGES_SOURCES)) $(MANDIR)/smb.conf.5
|
||||
MANPAGES_HTML = $(patsubst $(MANPAGEDIR)/%.xml,$(HTMLDIR)/%.html,$(MANPAGES_SOURCES)) $(HTMLDIR)/smb.conf.5.html
|
||||
MANPAGES_PLUCKER = $(patsubst $(MANPAGEDIR)/%.xml,$(PLUCKERDIR)/%.pdb,$(MANPAGES_SOURCES)) $(PLUCKERDIR)/smb.conf.5.pdb
|
||||
|
||||
PROJDOC_IMAGES_PNG = $(wildcard $(IMAGEPROJDIR)/*.png)
|
||||
PROJDOC_IMAGES_EPS=$(patsubst %.png,%.eps,$(wildcard $(IMAGEPROJDIR)/*.png))
|
||||
PROJDOC_DEPS = $(PROJDOC)/*.xml $(PROJDOC)/attributions.xml $(MANPROJDOC)/*.xml $(SMBDOTCONFDOC)/smb.conf.5.xml $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/parameters.global.xml $(SMBDOTCONFDOC)/parameters.service.xml
|
||||
HOWTODIR_IMAGES_PNG = $(wildcard $(IMAGEPROJDIR)/*.png)
|
||||
HOWTODIR_IMAGES_EPS=$(patsubst %.png,%.eps,$(wildcard $(IMAGEPROJDIR)/*.png))
|
||||
HOWTODIR_DEPS = $(HOWTODIR)/*.xml $(HOWTODIR)/attributions.xml $(MANPAGEDIR)/*.xml $(SMBDOTCONFDOC)/smb.conf.5.xml $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/parameters.global.xml $(SMBDOTCONFDOC)/parameters.service.xml
|
||||
DEVDOC_DEPS = $(DEVDOC)/*.xml $(DEVDOC)/attributions.xml
|
||||
|
||||
all:
|
||||
@ -101,7 +102,7 @@ txt: $(TXTDIR) $(TXTDIR)/Samba-HOWTO-Collection.txt $(TXTDIR)/Samba-Developers-G
|
||||
htmlman: $(HTMLDIR) $(MANPAGES_HTML) CSS
|
||||
|
||||
htmlfaq: $(HTMLDIR) CSS
|
||||
$(XSLTPROC) --stringparam base.dir "$(FAQDIR)/" --stringparam root.filename samba-faq xslt/html-chunk.xsl $(FAQPROJDOC)/sambafaq.xml
|
||||
$(XSLTPROC) --stringparam base.dir "$(FAQDIR)/" --stringparam root.filename samba-faq xslt/html-chunk.xsl $(FAQHOWTODIR)/sambafaq.xml
|
||||
html-single: $(HTMLDIR) CSS $(HTMLDIR)/Samba-HOWTO-Collection.html $(HTMLDIR)/Samba-Developers-Guide.html
|
||||
@if [ ! -d $(HTMLDIR)/images/ ]; then \
|
||||
mkdir $(HTMLDIR)/images/; \
|
||||
@ -122,7 +123,7 @@ tex: Samba-HOWTO-Collection.tex Samba-Developers-Guide.tex gpl.tex
|
||||
plucker: html-single htmlman htmlfaq $(PLUCKERDIR) $(MANPAGES_PLUCKER) $(PLUCKERDIR)/Samba-Developers-Guide.pdb $(PLUCKERDIR)/Samba-HOWTO-Collection.pdb
|
||||
$(PLUCKERBUILD) -v -M2 --stayonhost --noimages --zlib-compression -H file:$(FAQDIR)/samba-faq.html -f samba-faq -p $(PLUCKERDIR)
|
||||
|
||||
Samba-HOWTO-Collection.xml: $(PROJDOC)/samba-doc.xml $(PROJDOC_DEPS)
|
||||
Samba-HOWTO-Collection.xml: $(HOWTODIR)/index.xml $(HOWTODIR_DEPS)
|
||||
$(XSLTPROC) --stringparam noreference 1 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
|
||||
|
||||
Samba-Guide.xml: $(GUIDEDOC)/guide-main.xml
|
||||
@ -131,7 +132,7 @@ Samba-Guide.xml: $(GUIDEDOC)/guide-main.xml
|
||||
Samba-Developers-Guide.xml: $(DEVDOC)/dev-doc.xml $(DEVDOC_DEPS)
|
||||
$(XSLTPROC) --stringparam noreference 1 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
|
||||
|
||||
$(PROJDOC)/attributions.xml: $(PROJDOC)/samba-doc.xml
|
||||
$(HOWTODIR)/attributions.xml: $(HOWTODIR)/index.xml
|
||||
@echo > $@ # Make sure we don't get recursive dependencies, etc!
|
||||
$(XSLTPROC) --output $@ xslt/generate-attributions.xsl $<
|
||||
|
||||
@ -144,11 +145,11 @@ clean:
|
||||
$(PDFDIR)/*.pdf $(FAQDIR)/*.html $(HTMLDIR)/*html $(HTMLDIR)/samba.css
|
||||
rm -f xslt/figures/*pdf
|
||||
rm -f $(SMBDOTCONFDOC)/parameters.*.xml $(DVIDIR)/*.dvi
|
||||
rm -f samba-doc.* dev-doc.* $(PROJDOC)/changelog.xml $(PROJDOC)/attributions.xml $(DEVDOC)/attributions.xml
|
||||
rm -f samba-doc.* dev-doc.* $(HOWTODIR)/changelog.xml $(HOWTODIR)/attributions.xml $(DEVDOC)/attributions.xml
|
||||
rm -f Samba-HOWTO-Collection.*
|
||||
rm -f Samba-Developers-Guide.*
|
||||
rm -f Samba-Guide.*
|
||||
rm -f $(IMAGEPROJDIR)/*.eps $(MANPROJDOC)/smb.conf.5.xml
|
||||
rm -f $(IMAGEPROJDIR)/*.eps $(MANPAGEDIR)/smb.conf.5.xml
|
||||
rm -f $(PLUCKERDIR)/*.pdb
|
||||
|
||||
# Text files
|
||||
@ -175,7 +176,7 @@ $(PDFDIR)/%.pdf: %.tex latexfigures gpl.tex
|
||||
-$(PDFLATEX) $<
|
||||
mv $(patsubst %.tex,%.pdf,$<) $@
|
||||
|
||||
epsimages: $(PROJDOC_IMAGES_EPS)
|
||||
epsimages: $(HOWTODIR_IMAGES_EPS)
|
||||
|
||||
# DVI files
|
||||
$(DVIDIR)/%.dvi: %.tex epsimages gpl.tex
|
||||
@ -206,7 +207,7 @@ $(PLUCKERDIR):
|
||||
CSS: $(HTMLDIR) xslt/html/samba.css
|
||||
cp xslt/html/samba.css $(HTMLDIR)/
|
||||
|
||||
$(HTMLDIR)/Samba-HOWTO-Collection.html: Samba-HOWTO-Collection.xml $(PROJDOC_DEPS) $(PROJDOC_IMAGES_PNG)
|
||||
$(HTMLDIR)/Samba-HOWTO-Collection.html: Samba-HOWTO-Collection.xml $(HOWTODIR_DEPS) $(HOWTODIR_IMAGES_PNG)
|
||||
$(XSLTPROC) --output $@ xslt/html.xsl $<
|
||||
|
||||
$(HTMLDIR)/Samba-Developers-Guide.html: Samba-Developers-Guide.xml $(DEVDOC_DEPS)
|
||||
@ -218,7 +219,7 @@ $(HTMLDIR)/%.html: %.xml
|
||||
$(PLUCKERDIR)/%.pdb: $(HTMLDIR)/%.html
|
||||
$(PLUCKERBUILD) -v -M1 --stayonhost --noimages --zlib-compression -H file:$< -f $(patsubst $(PLUCKERDIR)/%.pdb,%,$@) -p $(PLUCKERDIR)
|
||||
|
||||
%.xml: $(MANPROJDOC)/%.xml
|
||||
%.xml: $(MANPAGEDIR)/%.xml
|
||||
$(XSLTPROC) --stringparam noreference 1 --output $@ xslt/expand-sambadoc.xsl $<
|
||||
|
||||
# Manpages
|
||||
@ -263,7 +264,7 @@ undocumented: $(SMBDOTCONFDOC)/parameters.all.xml
|
||||
$(EXAMPLESDIR):
|
||||
mkdir $(EXAMPLESDIR)
|
||||
|
||||
files: $(PROJDOC)/samba-doc.xml $(PROJDOC)/attributions.xml $(EXAMPLESDIR)
|
||||
files: $(HOWTODIR)/index.xml $(HOWTODIR)/attributions.xml $(EXAMPLESDIR)
|
||||
$(XSLTPROC) xslt/extract-smbfiles.xsl $< > /dev/null
|
||||
|
||||
samples: $(EXAMPLESDIR) Samba-HOWTO-Collection.xml
|
||||
@ -275,3 +276,10 @@ guide: $(PDFDIR)/Samba-Guide.pdf
|
||||
|
||||
%/changelog.xml: % $(wildcard %/CVS/*)
|
||||
$(CVS2CL) --stdout --xml $< | $(XSLTPROC) --output $@ xslt/genchangelog.xsl -
|
||||
|
||||
$(ARCHIVEDIR):
|
||||
mkdir $(ARCHIVEDIR)
|
||||
|
||||
archive: $(ARCHIVEDIR) guide howto
|
||||
cp $(PDFDIR)/Samba-HOWTO-Collection.pdf $(ARCHIVEDIR)/TOSHARG-`date +%Y%m%d`.pdf
|
||||
cp $(PDFDIR)/Samba-Guide.pdf $(ARCHIVEDIR)/S3bE-`date +%Y%m%d`.pdf
|
||||
|
154
docs/xslt/docbook.xsl
Normal file
154
docs/xslt/docbook.xsl
Normal file
@ -0,0 +1,154 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--#############################################################################
|
||||
| PURPOSE:
|
||||
| This is the "parent" stylesheet. The used "modules" are included here.
|
||||
| output encoding text in ISO-8859-1 indented.
|
||||
+ ############################################################################## -->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
|
||||
xmlns:exsl="http://exslt.org/common"
|
||||
extension-element-prefixes="exsl"
|
||||
exclude-result-prefixes="doc" version='1.0'>
|
||||
|
||||
<xsl:output method="text" encoding="ISO-8859-1" indent="yes"/>
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/common/l10n.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/common/common.xsl"/>
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/VERSION.xml"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/vars.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/latex.mapping.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/preamble.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/font.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/labelid.mod.xsl"/>
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/book-article.mod.xsl"/>
|
||||
|
||||
<!--
|
||||
## commented out to prevent breaking the build - jerry
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/dedication.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/preface.mod.xsl"/>
|
||||
-->
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/part-chap-app.mod.xsl"/>
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/sections.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/bridgehead.mod.xsl"/>
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/abstract.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/biblio.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/revision.mod.xsl"/>
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/admonition.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/verbatim.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/email.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/sgmltag.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/citation.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/qandaset.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/procedure.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/lists.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/callout.mod.xsl"/>
|
||||
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/figure.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/graphic.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/mediaobject.mod.xsl"/>
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/index.mod.xsl"/>
|
||||
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/xref.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/formal.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/example.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/table.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/inline.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/authorgroup.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/dingbat.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/info.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/keywords.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/refentry.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/component.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/glossary.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/block.mod.xsl"/>
|
||||
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/synop-oop.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/synop-struct.mod.xsl"/>
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/pi.mod.xsl"/>
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/footnote.mod.xsl"/>
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/texmath.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/mathelem.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/mathml/mathml.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/mathml/mathml.presentation.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/mathml/mathml.content.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/mathml/mathml.content.token.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/mathml/mathml.content.functions.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/mathml/mathml.content.constsymb.mod.xsl"/>
|
||||
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/para.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/msgset.mod.xsl"/>
|
||||
<xsl:include href="http://db2latex.sourceforge.net/xsl/errors.mod.xsl"/>
|
||||
|
||||
<xsl:include href="normalize-scape.mod.xsl"/>
|
||||
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:variable name="xsl-vendor" select="system-property('xsl:vendor')"/>
|
||||
<xsl:message>################################################################################</xsl:message>
|
||||
<xsl:message> XSLT stylesheets DocBook - LaTeX 2e </xsl:message>
|
||||
<xsl:message> Reqs: LaTeX 2e installation common packages </xsl:message>
|
||||
<xsl:message>################################################################################</xsl:message>
|
||||
<xsl:message> RELEASE : <xsl:value-of select="$VERSION"/> </xsl:message>
|
||||
<xsl:message> VERSION : <xsl:value-of select="$CVSVERSION"/> </xsl:message>
|
||||
<xsl:message> TAG : <xsl:value-of select="$TAG"/> </xsl:message>
|
||||
<xsl:message> WWW : http://db2latex.sourceforge.net </xsl:message>
|
||||
<xsl:message> SUMMARY : http://www.sourceforge.net/projects/db2latex </xsl:message>
|
||||
<xsl:message> AUTHOR : Ramon Casellas casellas@infres.enst.fr </xsl:message>
|
||||
<xsl:message> AUTHOR : James Devenish j-devenish@users.sf.net </xsl:message>
|
||||
<xsl:message> USING : <xsl:call-template name="set-vendor"/> </xsl:message>
|
||||
<xsl:message>################################################################################</xsl:message>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!--############################################################################# -->
|
||||
<!-- XSL Processor Vendor -->
|
||||
<!-- XSL Mailing Lists http://www.dpawson.co.uk/xsl/N10378.html -->
|
||||
<!--############################################################################# -->
|
||||
<xsl:template name="set-vendor">
|
||||
<xsl:variable name="xsl-vendor" select="system-property('xsl:vendor')"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($xsl-vendor, 'SAXON 6.4')">
|
||||
<xsl:text>SAXON 6.4.X</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($xsl-vendor, 'SAXON 6.2')">
|
||||
<xsl:text>SAXON 6.2.X</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="starts-with($xsl-vendor,'SAXON')">
|
||||
<xsl:text>SAXON</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($xsl-vendor,'Apache')">
|
||||
<xsl:text>XALAN</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($xsl-vendor,'Xalan')">
|
||||
<xsl:text>XALAN</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($xsl-vendor,'libxslt')">
|
||||
<xsl:text>libxslt/xsltproc</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($xsl-vendor,'Clark')">
|
||||
<xsl:text>XT</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>UNKNOWN</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
486
docs/xslt/expand-sambadoc.xsl
Normal file
486
docs/xslt/expand-sambadoc.xsl
Normal file
@ -0,0 +1,486 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--
|
||||
Samba-documentation specific stylesheets
|
||||
Published under the GNU GPL
|
||||
|
||||
(C) Jelmer Vernooij 2002-2004
|
||||
(C) Alexander Bokovoy 2002-2004
|
||||
-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:exsl="http://exslt.org/common"
|
||||
xmlns:samba="http://samba.org/common"
|
||||
version="1.1"
|
||||
extension-element-prefixes="exsl">
|
||||
|
||||
<xsl:import href="../settings.xsl"/>
|
||||
|
||||
<xsl:output method="xml"/>
|
||||
|
||||
<xsl:param name="xmlSambaNsUri" select="'http://samba.org/common'"/>
|
||||
|
||||
<xsl:template match="reference/refentry/refsect1">
|
||||
<xsl:if test="title!='VERSION' and title!='AUTHOR'">
|
||||
<xsl:element name="refsect1">
|
||||
<xsl:if test="@id!=''">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="translator">
|
||||
<xsl:element name="othercredit">
|
||||
<xsl:element name="author">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:element name="contrib">
|
||||
<xsl:text>Translation to </xsl:text><xsl:value-of select="@lang"/>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="reference/refentry">
|
||||
<xsl:element name="section">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="title">
|
||||
<xsl:value-of select="refmeta/refentrytitle"/>
|
||||
<!-- <xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="refnamediv/refpurpose"/>
|
||||
<xsl:text>)</xsl:text>-->
|
||||
</xsl:element>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="reference/refentry/refmeta"/>
|
||||
|
||||
<xsl:template match="reference/refentry/refnamediv"/>
|
||||
|
||||
<xsl:template match="reference">
|
||||
<xsl:element name="appendix">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="/node()">
|
||||
<xsl:text disable-output-escaping="yes">
|
||||
<!DOCTYPE </xsl:text><xsl:value-of select="name(.)"/><xsl:text disable-output-escaping="yes"> PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
|
||||
|
||||
<!ENTITY % globalentities SYSTEM 'global.ent'> %globalentities;
|
||||
]>
|
||||
</xsl:text>
|
||||
<xsl:copy>
|
||||
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- This is needed to copy content unchanged -->
|
||||
<xsl:template match="@*|node()">
|
||||
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="smbconfexample/smbconfoption|smbconfblock/smbconfoption">
|
||||
|
||||
<xsl:element name="member">
|
||||
<xsl:element name="indexterm">
|
||||
<xsl:element name="primary">
|
||||
<xsl:value-of select="name"/>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
<xsl:element name="parameter">
|
||||
<xsl:text disable-output-escaping="yes">
|
||||
<?latex \hspace{1cm} ?>
|
||||
</xsl:text>
|
||||
<xsl:value-of select="name"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="value != ''">
|
||||
<xsl:text> = </xsl:text>
|
||||
<xsl:value-of select="value"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="smbconfexample/smbconfcomment|smbconfblock/smbconfcomment">
|
||||
<xsl:text disable-output-escaping="yes">
|
||||
<?latex \hspace{1cm} ?>
|
||||
</xsl:text>
|
||||
<xsl:element name="member">
|
||||
<xsl:text># </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="smbconfexample/smbconfsection|smbconfblock/smbconfsection">
|
||||
<xsl:element name="member">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:element>
|
||||
<xsl:element name="member">
|
||||
<xsl:element name="parameter">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="smbconfoption">
|
||||
<!-- Include an index term -->
|
||||
<xsl:element name="indexterm">
|
||||
<xsl:element name="primary">
|
||||
<xsl:value-of select="name"/>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
|
||||
<xsl:variable name="linkcontent">
|
||||
<xsl:element name="parameter">
|
||||
<xsl:attribute name="moreinfo">
|
||||
<xsl:text>none</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="name"/>
|
||||
</xsl:element>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="value != ''">
|
||||
<xsl:text> = </xsl:text>
|
||||
<xsl:value-of select="value"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$noreference = 1">
|
||||
<xsl:value-of select="$linkcontent"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:element name="link">
|
||||
<xsl:attribute name="linkend">
|
||||
<xsl:value-of select="translate(translate(string(name),' ',''),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="$linkcontent"/>
|
||||
</xsl:element>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!-- FIXME: Needs extension sometime -->
|
||||
<xsl:template match="ntgroup|ntuser">
|
||||
<xsl:element name="emphasis">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="smbconfexample">
|
||||
<xsl:choose>
|
||||
<xsl:when test="title = ''">
|
||||
<xsl:message>
|
||||
<xsl:text>Warning: smbconfexample does not have title!</xsl:text>
|
||||
</xsl:message>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:element name="example">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@id != ''">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:attribute>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:element name="title">
|
||||
<xsl:value-of select="title"/>
|
||||
</xsl:element>
|
||||
<xsl:element name="simplelist">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="smbconfexample/title">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="smbconfblock">
|
||||
<xsl:element name="simplelist">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="smbconfsection">
|
||||
<xsl:element name="parameter">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="smbconfcomment">
|
||||
<xsl:text># </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="smbfile">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="image">
|
||||
<xsl:element name="figure">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@id != ''">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="imagefile"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:element name="title">
|
||||
<xsl:value-of select="imagedescription"/>
|
||||
</xsl:element>
|
||||
<xsl:element name="mediaobject">
|
||||
<xsl:element name="imageobject">
|
||||
<xsl:attribute name="role"><xsl:text>latex</xsl:text></xsl:attribute>
|
||||
<xsl:element name="imagedata">
|
||||
<xsl:attribute name="fileref">
|
||||
<xsl:text>projdoc/imagefiles/</xsl:text><xsl:value-of select="imagefile"/></xsl:attribute>
|
||||
<xsl:attribute name="scale">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@scale != ''">
|
||||
<xsl:value-of select="@scale"/>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<xsl:text>50</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="scalefit"><xsl:text>1</xsl:text></xsl:attribute>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
<xsl:element name="imageobject">
|
||||
<xsl:element name="imagedata">
|
||||
<xsl:attribute name="fileref">
|
||||
<xsl:text>projdoc/imagefiles/</xsl:text><xsl:value-of select="imagefile"/><xsl:text>.png</xsl:text></xsl:attribute>
|
||||
<xsl:attribute name="scale"><xsl:text>50</xsl:text></xsl:attribute>
|
||||
<xsl:attribute name="scalefit"><xsl:text>1</xsl:text></xsl:attribute>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="description"><xsl:apply-templates/></xsl:template>
|
||||
|
||||
<xsl:template match="value"><xsl:apply-templates/></xsl:template>
|
||||
|
||||
<xsl:template match="synonym"><xsl:apply-templates/></xsl:template>
|
||||
|
||||
<xsl:template match="related"><xsl:apply-templates/></xsl:template>
|
||||
|
||||
<xsl:template match="filterline">
|
||||
<xsl:element name="programlisting">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//samba:parameterlist">
|
||||
<xsl:apply-templates>
|
||||
<xsl:sort select="varlistentry/term/anchor"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="value/comment">
|
||||
<xsl:text> # </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//samba:parameter">
|
||||
<!-- reconstruct varlistentry - not all of them will go into separate files
|
||||
and also we must repair the main varlistentry itself.
|
||||
-->
|
||||
<xsl:variable name="cname"><xsl:value-of select="translate(translate(string(@name),' ',''),
|
||||
'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
|
||||
|
||||
<xsl:variable name="anchor">
|
||||
<xsl:element name="anchor">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="$cname"/>
|
||||
</xsl:attribute>
|
||||
</xsl:element>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="context">
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="@context"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="term">
|
||||
<xsl:element name="term">
|
||||
<xsl:copy-of select="$anchor"/>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:value-of select="$context"/>
|
||||
</xsl:element>
|
||||
</xsl:variable>
|
||||
|
||||
|
||||
<!-- Generate list of examples -->
|
||||
<xsl:variable name="examples">
|
||||
<xsl:for-each select="value">
|
||||
<xsl:if test="@type = 'example'">
|
||||
<xsl:element name="para">
|
||||
<xsl:text>Example: </xsl:text>
|
||||
<xsl:element name="emphasis">
|
||||
<xsl:element name="parameter">
|
||||
<xsl:copy-of select="$name"/>
|
||||
</xsl:element>
|
||||
<xsl:text> = </xsl:text>
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:element>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="tdefault">
|
||||
<xsl:for-each select="value">
|
||||
<xsl:if test="@type = 'default'">
|
||||
<xsl:element name="para">
|
||||
<xsl:text>Default: </xsl:text>
|
||||
<xsl:element name="emphasis">
|
||||
<xsl:element name="parameter">
|
||||
<xsl:copy-of select="$name"/>
|
||||
</xsl:element>
|
||||
<xsl:text> = </xsl:text>
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:element>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="default">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$tdefault = ''">
|
||||
<xsl:element name="para">
|
||||
<xsl:element name="emphasis">
|
||||
<xsl:text>No default</xsl:text>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:copy-of select="$tdefault"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="content">
|
||||
<xsl:apply-templates select="description"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:for-each select="synonym">
|
||||
<xsl:element name="varlistentry">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:element name="indexterm">
|
||||
<xsl:attribute name="significance">
|
||||
<xsl:text>preferred</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="primary">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:element>
|
||||
<xsl:element name="see">
|
||||
<xsl:value-of select="$name"/>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
|
||||
<xsl:element name="term">
|
||||
<xsl:element name="anchor">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="translate(translate(string(.),' ',''), 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
|
||||
</xsl:attribute>
|
||||
</xsl:element>
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:element>
|
||||
|
||||
<xsl:element name="listitem">
|
||||
<xsl:element name="para"><xsl:text>This parameter is a synonym for </xsl:text><xsl:copy-of select="$name"/><xsl:text>.</xsl:text></xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:element name="varlistentry">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:element name="indexterm">
|
||||
<xsl:attribute name="significance">
|
||||
<xsl:text>preferred</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="primary">
|
||||
<xsl:value-of select="@name"/>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
<xsl:copy-of select="$term"/>
|
||||
<xsl:element name="listitem">
|
||||
<xsl:copy-of select="$content"/> <xsl:text> </xsl:text>
|
||||
<xsl:copy-of select="$default"/> <xsl:text> </xsl:text>
|
||||
<xsl:copy-of select="$examples"/> <xsl:text> </xsl:text>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ulink">
|
||||
<xsl:element name="ulink">
|
||||
<xsl:attribute name="url">
|
||||
<xsl:value-of select="@url"/>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:apply-templates/>
|
||||
<xsl:if test="contains(@url,'http://') or contains(@url,'ftp://')">
|
||||
<xsl:if test="$duplicate_ulinks='brackets'">
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="@url"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="$duplicate_ulinks='footnote'">
|
||||
<xsl:element name="footnote">
|
||||
<xsl:element name="para">
|
||||
<xsl:value-of select="@url"/>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Just ignore these -->
|
||||
<xsl:template match="smbfile">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="quote">
|
||||
<xsl:element name="quote">
|
||||
<xsl:element name="emphasis">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
50
docs/xslt/extract-examples.xsl
Normal file
50
docs/xslt/extract-examples.xsl
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--
|
||||
Extract examples out of XML file
|
||||
(C) Jelmer Vernooij 2003
|
||||
-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:exsl="http://exslt.org/common"
|
||||
xmlns:samba="http://samba.org/common"
|
||||
version="1.1"
|
||||
extension-element-prefixes="exsl">
|
||||
|
||||
<xsl:output method="xml"/>
|
||||
|
||||
<xsl:template match="example/title"></xsl:template>
|
||||
|
||||
<xsl:template match="example/simplelist/title"></xsl:template>
|
||||
|
||||
<!-- Parse all varlistentries and extract those of them which are descriptions of smb.conf
|
||||
parameters. We determine them by existence of <anchor> element inside <term> element.
|
||||
If <anchor> is there, then its 'id' attribute is translated to lower case and is used
|
||||
as basis for file name for that parameter.
|
||||
-->
|
||||
<xsl:template match="example">
|
||||
<!-- reconstruct varlistentry - not all of them will go into separate files
|
||||
and also we must repair the main varlistentry itself.
|
||||
-->
|
||||
<xsl:variable name="content">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:variable>
|
||||
<!-- Now put varlistentry into separate file _if_ it has anchor associated with it -->
|
||||
<xsl:variable name="filename"><xsl:text>examples/</xsl:text><xsl:value-of select="@id"/>.conf</xsl:variable>
|
||||
<!-- Debug message for an operator, just to show progress of processing :) -->
|
||||
<xsl:message>
|
||||
<xsl:text>Writing </xsl:text>
|
||||
<xsl:value-of select="$filename"/>
|
||||
<xsl:text> for </xsl:text>
|
||||
<xsl:value-of select="title"/>
|
||||
</xsl:message>
|
||||
<!-- Write finally varlistentry to a separate file -->
|
||||
<exsl:document href="{$filename}"
|
||||
method="xml"
|
||||
encoding="UTF-8"
|
||||
indent="yes"
|
||||
omit-xml-declaration="yes">
|
||||
<xsl:copy-of select="$content"/>
|
||||
</exsl:document>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
1
docs/xslt/figures/caution.eps
Normal file
1
docs/xslt/figures/caution.eps
Normal file
File diff suppressed because one or more lines are too long
1
docs/xslt/figures/important.eps
Normal file
1
docs/xslt/figures/important.eps
Normal file
File diff suppressed because one or more lines are too long
1387
docs/xslt/figures/note.eps
Normal file
1387
docs/xslt/figures/note.eps
Normal file
File diff suppressed because it is too large
Load Diff
1503
docs/xslt/figures/tip.eps
Normal file
1503
docs/xslt/figures/tip.eps
Normal file
File diff suppressed because it is too large
Load Diff
1
docs/xslt/figures/warning.eps
Normal file
1
docs/xslt/figures/warning.eps
Normal file
File diff suppressed because one or more lines are too long
81
docs/xslt/generate-attributions.xsl
Normal file
81
docs/xslt/generate-attributions.xsl
Normal file
@ -0,0 +1,81 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--
|
||||
Generate Docbook/XML file with attributions based on chapter/author tags
|
||||
(C) Jelmer Vernooij 2003
|
||||
-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:exsl="http://exslt.org/common"
|
||||
xmlns:samba="http://samba.org/common"
|
||||
version="1.1"
|
||||
extension-element-prefixes="exsl">
|
||||
|
||||
<xsl:output method="xml" omit-xml-declaration="yes"/>
|
||||
|
||||
<!-- Remove all character data -->
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="chapter">
|
||||
<xsl:choose>
|
||||
<xsl:when test="chapterinfo/author != ''">
|
||||
<xsl:element name="para">
|
||||
<xsl:element name="link">
|
||||
<xsl:attribute name="linkend"><xsl:value-of select="@id"/></xsl:attribute>
|
||||
<xsl:value-of select="title"/>
|
||||
</xsl:element>
|
||||
<xsl:text> 	</xsl:text>
|
||||
<xsl:element name="itemizedlist">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>	</xsl:text>
|
||||
</xsl:element>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:element>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="author">
|
||||
<xsl:choose>
|
||||
<xsl:when test="firstname != ''">
|
||||
<xsl:text>	</xsl:text>
|
||||
<xsl:element name="listitem">
|
||||
<xsl:element name="para">
|
||||
<xsl:value-of select="firstname"/>
|
||||
<xsl:if test="othername != ''">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="othername"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text> </xsl:text><xsl:value-of select="surname"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="affiliation/address/email != ''">
|
||||
<xsl:text> <</xsl:text>
|
||||
<xsl:element name="ulink">
|
||||
<xsl:attribute name="noescape">
|
||||
<xsl:text>1</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="url">
|
||||
<xsl:text>mailto:</xsl:text>
|
||||
<xsl:value-of select="affiliation/address/email"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="affiliation/address/email"/>
|
||||
</xsl:element>
|
||||
<xsl:text>></xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contrib != ''">
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="contrib"/>
|
||||
<xsl:text>) </xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
16
docs/xslt/html-chunk.xsl
Normal file
16
docs/xslt/html-chunk.xsl
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This file is generated from param.xweb; do not edit this file! -->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:import href="../settings.xsl"/>
|
||||
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
|
||||
<xsl:import href="html-common.xsl"/>
|
||||
<xsl:param name="chunk.first.sections" select="1"/>
|
||||
<xsl:param name="chunk.quietly" select="0"/>
|
||||
<xsl:param name="chunk.section.depth" select="0"/>
|
||||
<xsl:param name="chunk.toc" select="''"/>
|
||||
<xsl:param name="chunk.tocs.and.lots" select="0"/>
|
||||
|
||||
</xsl:stylesheet>
|
25
docs/xslt/html-common.xsl
Normal file
25
docs/xslt/html-common.xsl
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This file is generated from param.xweb; do not edit this file! -->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:param name="base.dir" select="'../htmldocs/'"/>
|
||||
<xsl:param name="bridgehead.in.toc" select="1"/>
|
||||
<xsl:param name="citerefentry.link" select="'1'"/>
|
||||
<xsl:param name="css.decoration" select="1"/>
|
||||
<xsl:param name="html.stylesheet" select="'samba.css'"/>
|
||||
<xsl:param name="html.stylesheet.type">text/css</xsl:param>
|
||||
<xsl:param name="use.extensions" select="'0'"/>
|
||||
<xsl:param name="use.id.as.filename" select="'1'"/>
|
||||
<xsl:param name="use.local.olink.style" select="1"/>
|
||||
<xsl:param name="use.role.as.xrefstyle" select="1"/>
|
||||
<xsl:param name="use.role.for.mediaobject" select="1"/>
|
||||
|
||||
<xsl:template name="generate.citerefentry.link">
|
||||
<xsl:value-of select="refentrytitle"/><xsl:text>.</xsl:text><xsl:value-of select="manvolnum"/><xsl:text>.html</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="author">
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
11
docs/xslt/html.xsl
Normal file
11
docs/xslt/html.xsl
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This file is generated from param.xweb; do not edit this file! -->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:import href="../settings.xsl"/>
|
||||
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
|
||||
<xsl:import href="html-common.xsl"/>
|
||||
|
||||
</xsl:stylesheet>
|
80
docs/xslt/html/samba.css
Normal file
80
docs/xslt/html/samba.css
Normal file
@ -0,0 +1,80 @@
|
||||
BODY {
|
||||
font-family: helvetica, arial, lucida sans, sans-serif;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
H1, H2, H3 {
|
||||
color: blue;
|
||||
font-size: 120%;
|
||||
padding: 2px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
H1 {
|
||||
background-color: #EEEEFF;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
H2 {
|
||||
background-color: #DDDDFF;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
H3 {
|
||||
background-color: #CCCCFF;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
H4 {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
TR.qandadiv TD {
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
DIV.navhead {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
A:link {
|
||||
color: #36F;
|
||||
}
|
||||
|
||||
A:visited {
|
||||
color: #96C;
|
||||
}
|
||||
|
||||
A:active {
|
||||
color: #F63;
|
||||
}
|
||||
|
||||
TR.question {
|
||||
color: #33C;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
TR.question TD {
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
DIV.variablelist {
|
||||
padding-left: 2em;
|
||||
color: #33C;
|
||||
}
|
||||
|
||||
P {
|
||||
color: black;
|
||||
}
|
||||
|
||||
DIV.note, DIV.warning, DIV.caution, DIV.tip, DIV.important {
|
||||
border: dashed 1px;
|
||||
background-color: #EEEEFF;
|
||||
width: 40em;
|
||||
}
|
||||
|
||||
PRE.programlisting, PRE.screen {
|
||||
border: #630 1px dashed;
|
||||
color: #630;
|
||||
}
|
||||
|
107
docs/xslt/latex.xsl
Normal file
107
docs/xslt/latex.xsl
Normal file
@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
|
||||
<xsl:import href="../settings.xsl"/>
|
||||
<!--<xsl:import href="docbook.xsl"/>-->
|
||||
<xsl:import href="http://db2latex.sourceforge.net/xsl/docbook.xsl"/>
|
||||
|
||||
<xsl:output method="text" encoding="ISO-8859-1" indent="yes"/>
|
||||
<xsl:param name="l10n.gentext.default.language" select="'en'"/>
|
||||
<xsl:param name="latex.example.caption.style"></xsl:param>
|
||||
<xsl:variable name="latex.documentclass">sambadoc</xsl:variable>
|
||||
<xsl:variable name="latex.documentclass.common">twoside,11pt,letterpaper</xsl:variable>
|
||||
<xsl:variable name="latex.documentclass.book"></xsl:variable>
|
||||
<xsl:variable name="latex.hyperref.param.pdftex">hyperfigures,hyperindex,citecolor=black,urlcolor=black,filecolor=black,linkcolor=black,menucolor=red,pagecolor=black</xsl:variable>
|
||||
<xsl:variable name="latex.document.font">default</xsl:variable>
|
||||
<xsl:variable name="latex.admonition.path">xslt/figures</xsl:variable>
|
||||
<xsl:variable name="latex.use.tabularx">1</xsl:variable>
|
||||
<xsl:variable name="latex.fancyhdr.lh"></xsl:variable>
|
||||
<xsl:variable name="latex.use.fancyhdr"></xsl:variable>
|
||||
<xsl:variable name="latex.use.parskip">1</xsl:variable>
|
||||
<!--<xsl:variable name="latex.use.ltxtable">1</xsl:variable>-->
|
||||
<xsl:variable name="latex.hyphenation.tttricks">1</xsl:variable>
|
||||
<xsl:variable name="latex.book.varsets"></xsl:variable>
|
||||
<xsl:variable name="latex.titlepage.file"></xsl:variable>
|
||||
<!--<xsl:variable name="formal.title.placement">
|
||||
figure not_before
|
||||
example not_before
|
||||
equation not_before
|
||||
table not_before
|
||||
procedure before
|
||||
</xsl:variable>-->
|
||||
<!--<xsl:variable name="latex.procedure.title.style"><xsl:text>\subsubsection</xsl:text></xsl:variable>-->
|
||||
<xsl:template name="latex.thead.row.entry">
|
||||
<xsl:text>{\bfseries </xsl:text><xsl:apply-templates/><xsl:text>}</xsl:text>
|
||||
</xsl:template>
|
||||
<xsl:variable name="latex.book.preamblestart">
|
||||
\documentclass[twoside,openright,<xsl:value-of select="$fontsize"/>pt]{xslt/latex/sambadoc}
|
||||
|
||||
\usepackage[twoside,dvips]{geometry}
|
||||
|
||||
%\usepackage[section]{placeins}
|
||||
|
||||
\geometry{%
|
||||
paperwidth=7in,
|
||||
paperheight=9.25in,
|
||||
lmargin=.75in,
|
||||
rmargin=.75in,
|
||||
bmargin=.625in,
|
||||
tmargin=.625in,
|
||||
width=5.5in,
|
||||
height=7.525in, %7.3
|
||||
marginparwidth=0.35in,
|
||||
headheight=0.2in,
|
||||
headsep=.25in,
|
||||
footskip=.025in}
|
||||
|
||||
\setlength{\headwidth}{\textwidth}
|
||||
|
||||
<xsl:if test="$docrop != '0'">
|
||||
\usepackage[letter,center,dvips]{crop}
|
||||
</xsl:if>
|
||||
\usepackage{amsmath}%
|
||||
\usepackage{amsfonts}%
|
||||
\usepackage{amssymb}
|
||||
|
||||
<xsl:if test="$docrop != '0'">
|
||||
\special{papersize=11in,8.5in}
|
||||
|
||||
%\crop[frame]
|
||||
\crop
|
||||
</xsl:if>
|
||||
|
||||
\makeindex
|
||||
|
||||
%% Preamble:
|
||||
|
||||
% New commands and/or command redefinitions
|
||||
%
|
||||
% Added for the samba book
|
||||
%----------------------- paragraph ----------------------------------
|
||||
\cleardoublepage
|
||||
\pagenumbering{roman}
|
||||
|
||||
\setcounter{page}{2}
|
||||
\setcounter{totalnumber}{8}
|
||||
\setcounter{bottomnumber}{3}
|
||||
\setcounter{topnumber}{3}
|
||||
\renewcommand{\textfraction}{0.1}
|
||||
\renewcommand{\topfraction}{1.0}
|
||||
\renewcommand{\bottomfraction}{1.0}
|
||||
|
||||
%% Document Parts
|
||||
</xsl:variable>
|
||||
<xsl:param name="latex.babel.language">english</xsl:param>
|
||||
<xsl:param name="ulink.url">1</xsl:param>
|
||||
|
||||
<xsl:template match="//title/filename|//title/command|//title/parameter|//title/constant">
|
||||
<xsl:variable name="content">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:variable>
|
||||
<xsl:if test="$content != ''">
|
||||
<xsl:value-of select="$content" />
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
466
docs/xslt/latex/sambadoc.cls
Normal file
466
docs/xslt/latex/sambadoc.cls
Normal file
@ -0,0 +1,466 @@
|
||||
%
|
||||
% $Id: sambadoc.cls,v 1.4 2003/12/11 19:30:50 jelmer Exp $
|
||||
%
|
||||
|
||||
% phstyle.cls -- Macros for formatting Prentice-Hall Books
|
||||
% -- Compiled by J.K. Shultis, Dec. 1993
|
||||
% -- Modified and enhanced for LaTeX2e mdh/rlm 1997/02
|
||||
% -- Style Modifications Lori Hughes June 2002
|
||||
|
||||
\NeedsTeXFormat{LaTeX2e}%
|
||||
\ProvidesClass{sambadoc}[1997/02/20 Prentice Hall Book Class, February 1997]
|
||||
|
||||
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
|
||||
|
||||
\ProcessOptions%
|
||||
|
||||
% Base everything on the default class 'article'.
|
||||
\LoadClass{report}%
|
||||
|
||||
|
||||
%================================================================================
|
||||
% 1. Page layout dimensions
|
||||
% 3. Define new fonts for headings
|
||||
% 4. Define LaTeX logos (usually ot needed)
|
||||
% 5. Redefines the way "figure" amd "table" are formated in a \caption
|
||||
% 6. Defines a \capt macro which defines (1) \captwidth, (2) \captsize
|
||||
% and \beforetableskip.
|
||||
% 7. New Environemnts: Eqnarray, reflist, exerlist
|
||||
% 8. Defines and modifies FANCYHDS.STY for headers and foots
|
||||
% 9. Change sectioning headings to bold sans serif fonts
|
||||
%10. Turn off leader dots in Table of Contents
|
||||
%======================================================================
|
||||
|
||||
%====================== Page Layout
|
||||
% \oddsidemargin 0.750in \evensidemargin 0.750in \textwidth 5.00in
|
||||
% \topmargin 0.625in \headheight 0.3in \headsep 0.2in
|
||||
% \textheight 7.3in %\footheight .2in
|
||||
% \footskip 0.3in
|
||||
% \parskip 0ex \marginparwidth 1.00in \marginparsep 0.5in
|
||||
%\setlength\arraycolsep{1pt}
|
||||
|
||||
\textwidth 5.00in
|
||||
|
||||
%====================== Define special fonts
|
||||
\newfont{\BIG}{cminch} %--- One-inch font
|
||||
\newfont{\sfbHuge}{cmssbx10 scaled\magstep5} %-- 25pt sans serif bold
|
||||
\newfont{\sfblarge}{cmssbx10 scaled\magstep1} %-- 12pt sans serif bold
|
||||
\newfont{\sfbeleven}{cmssbx10 scaled\magstephalf} %-- 11pt sans serif bold
|
||||
\newfont{\sfb}{cmssbx10} %-- 10pt sans serif bold
|
||||
\newfont{\sfeight}{cmss8} %-- 8pt sans serif
|
||||
\newfont{\sfnine}{cmss8 at 9pt} %-- 9pt sans serif
|
||||
|
||||
\newfont{\defnem}{cmbxti10} %-- 10pt sans serif bold
|
||||
\def\spacingset#1{\def\baselinestretch{#1}\small\normalsize}
|
||||
|
||||
%-----------Change section heading font sizes here----
|
||||
\newfont{\sfbsection}{cmssbx10 at 13pt}
|
||||
\newfont{\sfbsubsec}{cmssbx10 at 12pt}
|
||||
\newfont{\sfbsubsub}{cmssbx10 at 11pt}
|
||||
\newfont{\sfbpara}{cmssbx10}
|
||||
%---------------------------------------------------
|
||||
|
||||
|
||||
%===================== LaTeX and TeX type logos
|
||||
\newcount\TestCount
|
||||
\def\La{\TestCount=\the\fam \leavevmode L\raise.42ex
|
||||
\hbox{$\fam\TestCount\scriptstyle\kern-.3em A$}}
|
||||
\def\LaTeX{\La\kern-.15em\TeX}
|
||||
\def\AllTeX{{(\La)\TeX}}
|
||||
|
||||
%
|
||||
% Theorem hack
|
||||
%
|
||||
|
||||
\def\@begintheorem#1#2{\trivlist
|
||||
\item[\hskip \labelsep{\bfseries #1\ #2:}]\itshape}
|
||||
|
||||
%===================== Redefine the \@makecaption command
|
||||
\long\def\@makecaption#1#2{\vskip 10\p@
|
||||
%% \setbox\@tempboxa\hbox{#1: #2}% %% original label definition
|
||||
\setbox\@tempboxa\hbox{\textbf{ \small #1.} \small #2}% %% bold and . instead of :
|
||||
\ifdim \wd\@tempboxa >\hsize
|
||||
%% #1: #2\par %% original definition
|
||||
\textbf{ \small #1.} \small #2\par %% bold and . instead of :
|
||||
\else
|
||||
\hbox to\hsize{\hfil\box\@tempboxa\hfil}% %% original
|
||||
%% \hbox to\hsize{\box\@tempboxa\hfil}% %% no centering
|
||||
\fi}
|
||||
|
||||
%===================== New caption macro
|
||||
\newlength{\captsize} \let\captsize=\footnotesize
|
||||
\newlength{\captwidth} \setlength{\captwidth}{\textwidth}
|
||||
\newlength{\beforetableskip} \setlength{\beforetableskip}{.5\baselineskip}
|
||||
\newcommand{\capt}[1]{\begin{minipage}{\captwidth}
|
||||
\let\normalsize=\captsize
|
||||
\caption[#1]{#1}
|
||||
\end{minipage}\\ \vspace{\beforetableskip}}
|
||||
|
||||
|
||||
%---------- Change Figure Label
|
||||
\newcommand{\thefigurename}{Figure} %-- set default: Figure
|
||||
\def\fnum@figure{\thefigurename\ \thefigure}
|
||||
|
||||
% This is to get the equation numbers in the form (section.equation),
|
||||
% and to have the equation counter reset every time the section
|
||||
% counter is incremented.
|
||||
|
||||
\def\theequation{\thechapter.\arabic{equation}}
|
||||
\@addtoreset{equation}{chapter}
|
||||
|
||||
|
||||
%===================== New Environments
|
||||
|
||||
%------ Reference List Macro
|
||||
\newenvironment{reflist}{\begin{list}{}{\leftmargin 1em \labelwidth 0in
|
||||
\labelsep 0in \itemsep 0ex \rightmargin 0in}}{\end{list}}
|
||||
\newcommand{\refitem}{\item \hspace*{-1em}} %--- item for ref list
|
||||
\newcommand{\SC}{\scriptsize} %--- small capitals for reference lists
|
||||
|
||||
|
||||
%------ New environment for better spacing in Eqnarray
|
||||
\def\eqnarray{%
|
||||
\stepcounter{equation}%
|
||||
\def\@currentlabel{\p@equation\theequation}%
|
||||
\global\@eqnswtrue
|
||||
\m@th
|
||||
\global\@eqcnt\z@
|
||||
\tabskip\@centering
|
||||
\let\\\@eqncr
|
||||
$$\everycr{}\halign to\displaywidth\bgroup
|
||||
\hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel
|
||||
&\global\@eqcnt\@ne\hskip \arraycolsep \hfil${##}$\hfil
|
||||
&\global\@eqcnt\tw@ \hskip \arraycolsep
|
||||
$\displaystyle{##}$\hfil\tabskip\@centering
|
||||
&\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup
|
||||
\tabskip\z@skip
|
||||
\cr
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
%\newenvironment{Eqnarray}{\arraycolsep 0.14em\begin{eqnarray}}{\end{eqnarray}}
|
||||
|
||||
% The hangitem environment -- like description, but text lines up with
|
||||
% the item descriptor. You give an additional argument containing text
|
||||
% of the width that you want indentations.
|
||||
%
|
||||
\def\hangitem#1{\list{}{\settowidth\labelwidth{#1}
|
||||
\leftmargin\labelwidth\advance\leftmargin\labelsep }}
|
||||
\let\endhangitem\endlist
|
||||
|
||||
%------ Problem List Macro
|
||||
\newcounter{probnum}
|
||||
\newenvironment{exerlist}%
|
||||
{\begin{list}{\bf \theprobnum.}%
|
||||
{\usecounter{probnum} \itemsep 1ex \leftmargin 2.0em \labelsep 0.5em
|
||||
\rightmargin 0in}}{\end{list}}
|
||||
|
||||
|
||||
|
||||
|
||||
%===================== Define FANCYHDS.STY
|
||||
% fancyheadings.sty version 1.1
|
||||
% Fancy headers and footers.
|
||||
% Piet van Oostrum, Dept of Computer Science, University of Utrecht
|
||||
% Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands
|
||||
% Telephone: +31-30-531806. piet@cs.ruu.nl (mcvax!hp4nl!ruuinf!piet)
|
||||
% Sep 23, 1992.
|
||||
|
||||
\def\lhead{\@ifnextchar[{\@xlhead}{\@ylhead}}
|
||||
\def\@xlhead[#1]#2{\gdef\@elhead{#1}\gdef\@olhead{#2}}
|
||||
\def\@ylhead#1{\gdef\@elhead{#1}\gdef\@olhead{#1}}
|
||||
|
||||
\def\chead{\@ifnextchar[{\@xchead}{\@ychead}}
|
||||
\def\@xchead[#1]#2{\gdef\@echead{#1}\gdef\@ochead{#2}}
|
||||
\def\@ychead#1{\gdef\@echead{#1}\gdef\@ochead{#1}}
|
||||
|
||||
\def\rhead{\@ifnextchar[{\@xrhead}{\@yrhead}}
|
||||
\def\@xrhead[#1]#2{\gdef\@erhead{#1}\gdef\@orhead{#2}}
|
||||
\def\@yrhead#1{\gdef\@erhead{#1}\gdef\@orhead{#1}}
|
||||
|
||||
\def\lfoot{\@ifnextchar[{\@xlfoot}{\@ylfoot}}
|
||||
\def\@xlfoot[#1]#2{\gdef\@elfoot{#1}\gdef\@olfoot{#2}}
|
||||
\def\@ylfoot#1{\gdef\@elfoot{#1}\gdef\@olfoot{#1}}
|
||||
|
||||
\def\cfoot{\@ifnextchar[{\@xcfoot}{\@ycfoot}}
|
||||
\def\@xcfoot[#1]#2{\gdef\@ecfoot{#1}\gdef\@ocfoot{#2}}
|
||||
\def\@ycfoot#1{\gdef\@ecfoot{#1}\gdef\@ocfoot{#1}}
|
||||
|
||||
\def\rfoot{\@ifnextchar[{\@xrfoot}{\@yrfoot}}
|
||||
\def\@xrfoot[#1]#2{\gdef\@erfoot{#1}\gdef\@orfoot{#2}}
|
||||
\def\@yrfoot#1{\gdef\@erfoot{#1}\gdef\@orfoot{#1}}
|
||||
|
||||
\newdimen\headrulewidth
|
||||
\newdimen\footrulewidth
|
||||
\newdimen\plainheadrulewidth
|
||||
\newdimen\plainfootrulewidth
|
||||
\newdimen\headwidth
|
||||
\newif\if@fancyplain \@fancyplainfalse
|
||||
\def\fancyplain#1#2{\if@fancyplain#1\else#2\fi}
|
||||
|
||||
% Initialization of the head and foot text.
|
||||
|
||||
\headrulewidth 0.4pt
|
||||
\footrulewidth\z@
|
||||
\plainheadrulewidth\z@
|
||||
\plainfootrulewidth\z@
|
||||
|
||||
\lhead[\fancyplain{}{\sl\rightmark}]{\fancyplain{}{\sl\leftmark}}
|
||||
% i.e. empty on ``plain'' pages \rightmark on even, \leftmark on odd pages
|
||||
\chead{}
|
||||
\rhead[\fancyplain{}{\sl\leftmark}]{\fancyplain{}{\sl\rightmark}}
|
||||
% i.e. empty on ``plain'' pages \leftmark on even, \rightmark on odd pages
|
||||
\lfoot{}
|
||||
\cfoot{\rm\thepage} % page number
|
||||
\rfoot{}
|
||||
|
||||
% Put together a header or footer given the left, center and
|
||||
% right text, fillers at left and right and a rule.
|
||||
% The \lap commands put the text into an hbox of zero size,
|
||||
% so overlapping text does not generate an errormessage.
|
||||
|
||||
\def\@fancyhead#1#2#3#4#5{#1\hbox to\headwidth{\vbox{\hbox
|
||||
{\rlap{\parbox[b]{\headwidth}{\raggedright#2\strut}}\hfill
|
||||
\parbox[b]{\headwidth}{\centering#3\strut}\hfill
|
||||
\llap{\parbox[b]{\headwidth}{\raggedleft#4\strut}}}\headrule}}#5}
|
||||
|
||||
|
||||
\def\@fancyfoot#1#2#3#4#5{#1\hbox to\headwidth{\vbox{\footrule
|
||||
\hbox{\rlap{\parbox[t]{\headwidth}{\raggedright#2\strut}}\hfill
|
||||
\parbox[t]{\headwidth}{\centering#3\strut}\hfill
|
||||
\llap{\parbox[t]{\headwidth}{\raggedleft#4\strut}}}}}#5}
|
||||
|
||||
\def\headrule{{\if@fancyplain\headrulewidth\plainheadrulewidth\fi
|
||||
\hrule\@height\headrulewidth\@width\headwidth \vskip-\headrulewidth}}
|
||||
|
||||
\def\footrule{{\if@fancyplain\footrulewidth\plainfootrulewidth\fi
|
||||
\vskip-0.3\normalbaselineskip\vskip-\footrulewidth
|
||||
\hrule\@width\headwidth\@height\footrulewidth\vskip-0.3\normalbaselineskip}}
|
||||
|
||||
\def\ps@fancy{
|
||||
\let\@mkboth\markboth
|
||||
\@ifundefined{chapter}{\def\sectionmark##1{\markboth
|
||||
{{\ifnum \c@secnumdepth>\z@ %MEUH
|
||||
\thesection\hskip 1em\relax \fi ##1}}{}}
|
||||
\def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne
|
||||
\thesubsection\hskip 1em\relax \fi ##1}}}
|
||||
%
|
||||
{\def\chaptermark##1{\markboth {{\ifnum \c@secnumdepth>\m@ne %MEUH
|
||||
\@chapapp\ \thechapter. \ \fi ##1}}{}}
|
||||
\def\sectionmark##1{\markright{{\ifnum \c@secnumdepth >\z@ %MEUH
|
||||
\thesection. \ \fi ##1}}}}
|
||||
\ps@@fancy
|
||||
\headwidth\textwidth}
|
||||
\def\ps@fancyplain{\ps@fancy \let\ps@plain\ps@plain@fancy}
|
||||
\def\ps@plain@fancy{\@fancyplaintrue\ps@@fancy}
|
||||
\def\ps@@fancy{
|
||||
\def\@oddhead{\@fancyhead\relax\@olhead\@ochead\@orhead\hss}
|
||||
\def\@oddfoot{\@fancyfoot\relax\@olfoot\@ocfoot\@orfoot\hss}
|
||||
\def\@evenhead{\@fancyhead\hss\@elhead\@echead\@erhead\relax}
|
||||
\def\@evenfoot{\@fancyfoot\hss\@elfoot\@ecfoot\@erfoot\relax}
|
||||
}
|
||||
%------------------- Modify Headers for Prentice-Hall Book Style
|
||||
%---------- Setup headers and footers
|
||||
\pagestyle{fancyplain}
|
||||
\plainfootrulewidth 0pt %---- no foot rule for chapter page
|
||||
\footrulewidth 0pt %---- no rule for foot
|
||||
|
||||
%--- Redefine Headers
|
||||
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
|
||||
%
|
||||
\lhead[\fancyplain{}{\bf\thepage}]{\fancyplain{}{\sfnine\rightmark}}
|
||||
%
|
||||
%\rhead[\fancyplain{}{\footnotesize\sf\CHHEAD}]{\fancyplain{}{\bf\thepage}}
|
||||
\rhead[\fancyplain{}{\sfnine \leftmark}]{\fancyplain{}{\bf\thepage}}
|
||||
%--- Empty footers on every page (except initial chapter page which has
|
||||
%--- page number) and optionally a small date stamp
|
||||
\cfoot[\fancyplain{}{}]{\fancyplain{}{}}
|
||||
\rfoot[\fancyplain{}{}]{\fancyplain{\hspace{\fill}\\ \bf\thepage}{}}
|
||||
\lfoot[\fancyplain{\hspace{\fill}\\ \bf\thepage}{}]{\fancyplain{}{}}
|
||||
%-- replace the two lines above with the two below for a date stamp footer
|
||||
%\rfoot[\fancyplain{\scriptsize \today}{\scriptsize \today}]{\fancyplain{\bf\thepage}{}}
|
||||
%\lfoot[\fancyplain{\bf\thepage}{}]{\fancyplain{\scriptsize \today}{\scriptsize \today}}
|
||||
%--- Change format of section header
|
||||
%
|
||||
% rlm added chaptermark 10/11/96
|
||||
\def\sectionmark#1{\markright{\ifnum \c@secnumdepth >\z@
|
||||
{\sfeight Section}~\thesection.\quad \fi #1}}
|
||||
\def\sectionsmark#1{\markright{#1}{#1}}
|
||||
%
|
||||
\def\chaptermark#1{\markboth{#1 \quad \@chapapp{}~\thechapter}{}}
|
||||
\def\chaptersmark#1{\markboth{#1}{#1}}
|
||||
|
||||
|
||||
|
||||
|
||||
%===================== Change Section Heads to Bold Sans Serif
|
||||
% Create bolds sans serif sectioning headings. Also the headings have
|
||||
% been reduced in size with less space before and after the heading.
|
||||
% Modified from macros given in BK10.STY
|
||||
%
|
||||
%----------------------------- part ---------------------------------
|
||||
\def\@part[#1]#2{%
|
||||
\thispagestyle{empty}
|
||||
\ifodd\c@page\hbox{}\else\clearpage\fi
|
||||
\addtocounter{page}{-2}
|
||||
\thispagestyle{empty}
|
||||
\ifnum \c@secnumdepth >-2\relax
|
||||
\refstepcounter{part}%
|
||||
\addcontentsline{toc}{part}{Part \thepart\hspace{1em}#1}%
|
||||
\else
|
||||
\addcontentsline{toc}{part}{Part #1}%
|
||||
\fi
|
||||
{\centering
|
||||
\interlinepenalty \@M
|
||||
\normalfont
|
||||
\ifnum \c@secnumdepth >-2\relax
|
||||
\huge\bfseries \partname\nobreakspace\thepart
|
||||
\par
|
||||
\vskip 20\p@
|
||||
\fi
|
||||
\Huge \bfseries #2\par}%
|
||||
\@endpart}
|
||||
|
||||
%------------------------- appendix -----------------------------------
|
||||
|
||||
\let\oldappendix\appendix
|
||||
\def\appendix{\oldappendix\def\addchaptertoloe{}}
|
||||
|
||||
%------------------------- chapter -----------------------------------
|
||||
\def\addchaptertoloe{%
|
||||
\addtocontents{loe}{\protect\addvspace{14pt}}%
|
||||
\addtocontents{loe}{\noindent {\bfseries Chapter~\thechapter}\protect\par}%
|
||||
\addtocontents{loe}{\protect\addvspace{10pt}}%
|
||||
}
|
||||
|
||||
\def\chapter{\clearpage \thispagestyle{plain} \global\@topnum\z@
|
||||
\@afterindentfalse \secdef\@chapter\@schapter}
|
||||
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
|
||||
\refstepcounter{chapter}
|
||||
\typeout{\@chapapp\space\thechapter.}
|
||||
\addcontentsline{toc}{chapter}{Chapter~\protect
|
||||
\numberline{\thechapter}\uppercase{#1}}\else
|
||||
\addcontentsline{toc}{chapter}{Chapter~\uppercase{#1}}\fi
|
||||
\chaptermark{#1}
|
||||
\addchaptertoloe
|
||||
\addtocontents{lof}{\protect\addvspace{10pt}}
|
||||
\addtocontents{lot}{\protect\addvspace{10pt}} \if@twocolumn
|
||||
\@topnewpage[\@makechapterhead{#2}]
|
||||
\else \@makechapterhead{#2}
|
||||
\@afterheading \fi}
|
||||
%
|
||||
\def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}]
|
||||
\else \@makeschapterhead{#1}\chaptersmark{#1}
|
||||
\@afterheading\fi\addcontentsline{toc}{chapter}{\uppercase{#1}}}
|
||||
|
||||
|
||||
|
||||
\def\@makechapterhead#1{\vspace*{-20pt}{\parindent0pt\raggedright
|
||||
\ifnum\c@secnumdepth>\m@ne\LARGE\sf\@chapapp{}~\thechapter\par
|
||||
\vskip3pt\hrule\vskip3pt\hrule
|
||||
\vskip30pt\fi\raggedright\Huge\sfbHuge\uppercase{#1}\par
|
||||
\nobreak\vskip70pt}}%\chaptermark{#1}}
|
||||
|
||||
\def\@makeschapterhead#1{\vspace*{4pt}{\parindent0pt
|
||||
\vskip3pt\hrule\vskip3pt\hrule
|
||||
\vskip36pt\raggedright\Huge\sfbHuge\uppercase{#1}\par
|
||||
\nobreak\vskip70pt}}%\chaptersmark{#1}}
|
||||
|
||||
%------------------------ section -----------------------------------
|
||||
\def\section{\@startsection{section}{1}{\z@}{-3.5ex plus-1ex
|
||||
minus -.2ex}{1.8ex}{\sfbsection}}
|
||||
|
||||
%--------------------- subsection -----------------------------------
|
||||
\def\subsection{\@startsection{subsection}{2}{\z@}{-2.75ex plus -1ex
|
||||
minus -.2ex}{1.2ex}{\sfbsubsec}}
|
||||
|
||||
%-------------------- subsubsection --------------------------------
|
||||
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-2.75ex
|
||||
plus -1ex minus -.2ex}{1.2ex}{\sfbsubsub}}
|
||||
|
||||
%----------------------- paragraph ----------------------------------
|
||||
\def\paragraph{\@startsection{paragraph}{4}{\z@}{1.25ex plus
|
||||
1ex minus .2ex}{-1em}{\sfbpara}}
|
||||
|
||||
%---------------------- subparagraph --------------------------------
|
||||
\def\subparagraph{\@startsection{subparagraph}{4}{\parindent}{1.25ex
|
||||
plus 1ex minus .2ex}{-1em}{\normalsize\sfb}}
|
||||
|
||||
|
||||
|
||||
%====================== Turn off leader dots in Table of Contents
|
||||
\renewcommand{\@dotsep}{500}
|
||||
|
||||
\def\tableofcontents{\markboth{}{}\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
|
||||
\fi\thispagestyle{plain} \@makeschapterhead{Contents}
|
||||
\@afterheading
|
||||
\chaptersmark{Contents}
|
||||
\sectionsmark{Contents}
|
||||
\@starttoc{toc}\if@restonecol\twocolumn\fi}
|
||||
|
||||
|
||||
\def\thebibliography#1{\chapter*{Bibliography}\list
|
||||
% \addcontentsline{toc}{chapter}{Bibliography}
|
||||
{[\arabic{enumi}]}{\settowidth\labelwidth{2em}\leftmargin\labelwidth
|
||||
% \advance\leftmargin\labelsep
|
||||
\usecounter{enumi}}
|
||||
\def\newblock{\hskip .11em plus .33em minus .07em}
|
||||
\sloppy\clubpenalty4000\widowpenalty4000
|
||||
\sfcode`\.=1000\relax}
|
||||
\let\endthebibliography=\endlist
|
||||
|
||||
|
||||
%% BIBLIOGRAPHY
|
||||
%
|
||||
%% separate citations with "], ["
|
||||
\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
|
||||
\def\@citea{}\@cite{\@for\@citeb:=#2\do {\@citea\def\@citea{],
|
||||
[}\@ifundefined {b@\@citeb}{{\bf ?}\@warning {Citation `\@citeb' on
|
||||
page \thepage \space undefined}}%
|
||||
{\csname b@\@citeb\endcsname}}}{#1}}
|
||||
|
||||
\def\@cite#1#2{[{#1\if@tempswa, #2\fi}]}
|
||||
|
||||
|
||||
%% index
|
||||
|
||||
%\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
|
||||
%\columnseprule \z@
|
||||
%\columnsep 35pt\twocolumn[\@makeschapterhead{Subject Index}]
|
||||
% \addcontentsline{toc}{chapter}{SUBJECT INDEX}
|
||||
% \thispagestyle{plain}\parindent\z@
|
||||
% \parskip\z@ plus .3pt\relax\let\item\@idxitem}
|
||||
|
||||
\def\theindex{\cleardoublepage\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
|
||||
\columnseprule \z@
|
||||
\columnsep 35pt\twocolumn[\@makeschapterhead{Subject Index}]
|
||||
\chaptersmark{Subject Index}%
|
||||
\addcontentsline{toc}{chapter}{SUBJECT INDEX}
|
||||
\thispagestyle{plain}\parindent\z@
|
||||
\parskip\z@ plus .3pt\relax\let\item\@idxitem}
|
||||
|
||||
|
||||
\renewcommand{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
|
||||
\hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
|
||||
|
||||
\renewcommand{\numberline}[1]{\sbox\@tempboxa{#1\hspace{2pt}}%
|
||||
\ifdim\wd\@tempboxa>\@tempdima \else \wd\@tempboxa\@tempdima\fi
|
||||
\box\@tempboxa}
|
||||
|
||||
\def\listofexamples{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
|
||||
\fi\chapter*{List of Examples}
|
||||
\renewcommand\@pnumwidth{0em}
|
||||
\@starttoc{loe}\if@restonecol
|
||||
\twocolumn\fi}
|
||||
|
||||
\def\l@example{\noindent\@dottedtocline{1}{0em}{3.5em}}
|
||||
|
||||
\parskip 1.5ex
|
||||
\parindent 0pt
|
||||
|
||||
\renewcommand\listfigurename{\uppercase{List Of Figures}}
|
||||
\renewcommand\listtablename{\uppercase{List Of Tables}}
|
||||
|
29
docs/xslt/lists.mod.xsl
Normal file
29
docs/xslt/lists.mod.xsl
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--#############################################################################
|
||||
|- #############################################################################
|
||||
|
|
||||
| PURPOSE:
|
||||
+ ############################################################################## -->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
|
||||
exclude-result-prefixes="doc" version='1.0'>
|
||||
|
||||
|
||||
<xsl:template match="simplelist">
|
||||
<xsl:if test="title"> <xsl:apply-templates select="title"/></xsl:if>
|
||||
<xsl:text> \begin{itemize} </xsl:text>
|
||||
<xsl:apply-templates select="member"/>
|
||||
<xsl:text> \end{itemize} </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="member">
|
||||
<xsl:text> %--- Item </xsl:text>
|
||||
<xsl:text>\item[] </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
169
docs/xslt/man.xsl
Normal file
169
docs/xslt/man.xsl
Normal file
@ -0,0 +1,169 @@
|
||||
<?xml version='1.0'?>
|
||||
<!-- vim:set sts=2 shiftwidth=2 syntax=xml: -->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version='1.0'>
|
||||
|
||||
<xsl:import href="../settings.xsl"/>
|
||||
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
|
||||
|
||||
<xsl:param name="chunk.section.depth" select="0"/>
|
||||
<xsl:param name="chunk.first.sections" select="1"/>
|
||||
<xsl:param name="use.id.as.filename" select="1"/>
|
||||
<xsl:param name="base.dir" select="'../manpages/'"/>
|
||||
|
||||
<!--
|
||||
Our ulink stylesheet omits @url part if content was specified
|
||||
-->
|
||||
<xsl:template match="ulink">
|
||||
<xsl:variable name="content">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:variable>
|
||||
<xsl:if test="$content = ''">
|
||||
<xsl:text>: </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="$content != ''">
|
||||
<xsl:value-of select="$content" />
|
||||
</xsl:if>
|
||||
<xsl:if test="$content = ''">
|
||||
<xsl:apply-templates mode="italic" select="@url" />
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="refentry">
|
||||
|
||||
<xsl:variable name="section" select="refmeta/manvolnum"/>
|
||||
<xsl:variable name="name" select="refnamediv/refname[1]"/>
|
||||
<xsl:variable name="base.dir" select="$base.dir"/>
|
||||
<!-- standard man page width is 64 chars; 6 chars needed for the two
|
||||
(x) volume numbers, and 2 spaces, leaves 56 -->
|
||||
<xsl:variable name="twidth" select="(74 - string-length(refmeta/refentrytitle)) div 2"/>
|
||||
|
||||
<xsl:variable name="reftitle"
|
||||
select="substring(refmeta/refentrytitle, 1, $twidth)"/>
|
||||
|
||||
<xsl:variable name="title">
|
||||
<xsl:choose>
|
||||
<xsl:when test="refentryinfo/title">
|
||||
<xsl:value-of select="refentryinfo/title"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="../referenceinfo/title">
|
||||
<xsl:value-of select="../referenceinfo/title"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="date">
|
||||
<xsl:choose>
|
||||
<xsl:when test="refentryinfo/date">
|
||||
<xsl:value-of select="refentryinfo/date"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="../referenceinfo/date">
|
||||
<xsl:value-of select="../referenceinfo/date"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="productname">
|
||||
<xsl:choose>
|
||||
<xsl:when test="refentryinfo/productname">
|
||||
<xsl:value-of select="refentryinfo/productname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="../referenceinfo/productname">
|
||||
<xsl:value-of select="../referenceinfo/productname"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:call-template name="write.text.chunk">
|
||||
<xsl:with-param name="filename"
|
||||
select="concat($base.dir, normalize-space ($name), '.', $section)"/>
|
||||
<xsl:with-param name="content">
|
||||
<xsl:text>.\"Generated by db2man.xsl. Don't modify this, modify the source.
|
||||
.de Sh \" Subsection
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Ip \" List item
|
||||
.br
|
||||
.ie \\n(.$>=3 .ne \\$3
|
||||
.el .ne 3
|
||||
.IP "\\$1" \\$2
|
||||
..
|
||||
.TH "</xsl:text>
|
||||
<xsl:value-of select="translate($reftitle,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
|
||||
<xsl:text>" </xsl:text>
|
||||
<xsl:value-of select="refmeta/manvolnum[1]"/>
|
||||
<xsl:text> "</xsl:text>
|
||||
<xsl:value-of select="normalize-space($date)"/>
|
||||
<xsl:text>" "</xsl:text>
|
||||
<xsl:value-of select="normalize-space($productname)"/>
|
||||
<xsl:text>" "</xsl:text>
|
||||
<xsl:value-of select="$title"/>
|
||||
<xsl:text>"
|
||||
</xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<!-- Author section -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="refentryinfo//author">
|
||||
<xsl:apply-templates select="refentryinfo" mode="authorsect"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="informalexample|screen|programlisting">
|
||||
<xsl:text>.nf </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>.fi </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//emphasis">
|
||||
<xsl:text>\fB</xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>\fR</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="para|simpara|remark" mode="list">
|
||||
<xsl:variable name="foo">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:variable>
|
||||
<xsl:choose match="node()">
|
||||
<!-- Don't normalize-space() for verbatim paragraphs -->
|
||||
<xsl:when test="informalexample|screen|programlisting">
|
||||
<xsl:value-of select="$foo"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="normalize-space($foo)"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:if test="following-sibling::para or following-sibling::simpara or
|
||||
following-sibling::remark">
|
||||
<!-- Make sure multiple paragraphs within a list item don't -->
|
||||
<!-- merge together. -->
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="refsect3">
|
||||
<xsl:text> .SS "</xsl:text>
|
||||
<xsl:value-of select="title[1]"/>
|
||||
<xsl:text>" </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
395
docs/xslt/normalize-scape.mod.xsl
Normal file
395
docs/xslt/normalize-scape.mod.xsl
Normal file
@ -0,0 +1,395 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--#############################################################################
|
||||
| $Id: normalize-scape.mod.xsl,v 1.1 2003/12/05 06:53:48 ab Exp $
|
||||
|- #############################################################################
|
||||
| $Author: ab $
|
||||
|
|
||||
| PURPOSE:
|
||||
| Escape LaTeX and normalize-space templates.
|
||||
| < > # $ % & ~ _ ^ \ { } |
|
||||
+ ############################################################################## -->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
|
||||
xmlns:exsl="http://exslt.org/common"
|
||||
exclude-result-prefixes="doc"
|
||||
extension-element-prefixes="exsl"
|
||||
version='1.0'>
|
||||
|
||||
|
||||
<!--############################################################################# -->
|
||||
<!-- DOCUMENTATION -->
|
||||
<doc:reference id="normalize-scape" xmlns="">
|
||||
<referenceinfo>
|
||||
<releaseinfo role="meta">
|
||||
$Id: normalize-scape.mod.xsl,v 1.1 2003/12/05 06:53:48 ab Exp $
|
||||
</releaseinfo>
|
||||
<authorgroup>
|
||||
<author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
|
||||
<author> <firstname>James</firstname> <surname>Devenish</surname> </author>
|
||||
</authorgroup>
|
||||
<copyright><year>2000</year><year>2001</year><year>2002</year><year>2003</year>
|
||||
<holder>Ramon Casellas</holder>
|
||||
</copyright>
|
||||
</referenceinfo>
|
||||
<title>Normalize and Scape strings.</title>
|
||||
<partintro>
|
||||
<section><title>Introduction</title>
|
||||
<para></para>
|
||||
</section>
|
||||
</partintro>
|
||||
</doc:reference>
|
||||
<!--############################################################################# -->
|
||||
|
||||
<xsl:key name="character" match="character" use="unicode"/>
|
||||
<xsl:param name="unicode.mapping.local" select="''"/>
|
||||
<xsl:param name="unicode.mapping.default" select="'unicode.mapping.xml'"/>
|
||||
<xsl:param name="unicode.mapping.languages" select="''"/>
|
||||
<xsl:variable name="unicode.mapping.sources">
|
||||
<xsl:if test="not(function-available('exsl:node-set'))">
|
||||
<xsl:message terminate="yes">
|
||||
<xsl:text>Error: this style requires support for extension 'exsl:node-set()'</xsl:text>
|
||||
</xsl:message>
|
||||
</xsl:if>
|
||||
<file><xsl:value-of select="$unicode.mapping.local"/></file>
|
||||
<xsl:call-template name="parse.unicode.mapping.languages">
|
||||
<xsl:with-param name="languages" select="$unicode.mapping.languages"/>
|
||||
</xsl:call-template>
|
||||
<file><xsl:value-of select="$unicode.mapping.default"/></file>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="unicode.mapping.database" select="document(exsl:node-set($unicode.mapping.sources)/file,document(''))/mapping"/>
|
||||
|
||||
<xsl:template name="parse.unicode.mapping.languages">
|
||||
<xsl:param name="languages"/>
|
||||
<xsl:if test="contains($languages,' ')">
|
||||
<xsl:variable name="unicode.mapping.lang.file" select="concat('unicode.mapping.',substring-before($languages,' '),'.xml')"/>
|
||||
<xsl:if test="document($unicode.mapping.lang.file)">
|
||||
<file><xsl:value-of select="$unicode.mapping.lang.file"/></file>
|
||||
</xsl:if>
|
||||
<xsl:call-template name="parse.unicode.mapping.languages">
|
||||
<xsl:with-param name="languages" select="substring-after($languages,' ')"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
<xsl:if test="not(string-length($languages)=0)">
|
||||
<xsl:variable name="unicode.mapping.lang.file" select="concat('unicode.mapping.',$languages,'.xml')"/>
|
||||
<xsl:if test="document($unicode.mapping.lang.file)">
|
||||
<file><xsl:value-of select="$unicode.mapping.lang.file"/></file>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="scape">
|
||||
<xsl:param name="string"/>
|
||||
<xsl:if test="not(string-length($string)=0)">
|
||||
<xsl:variable name="char" select="substring($string,1,1)"/>
|
||||
<xsl:variable name="preferred">
|
||||
<xsl:for-each select="$unicode.mapping.database">
|
||||
<preferred><xsl:value-of select="key('character',$char)/preferred"/></preferred>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<!-- Do not optimize it to variable calculation. I already test it for speed with xsltproc :) -->
|
||||
<xsl:when test="exsl:node-set($preferred)/preferred[not(string-length(.)=0)][1]">
|
||||
<xsl:value-of select="exsl:node-set($preferred)/preferred[not(string-length(.)=0)][1]"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$char"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:call-template name="scape">
|
||||
<xsl:with-param name="string" select="substring($string,2)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="scape-href">
|
||||
<xsl:param name="string"/>
|
||||
<xsl:call-template name="scape">
|
||||
<xsl:with-param name="string" select="$string"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="scape-verbatim">
|
||||
<xsl:param name="string"/>
|
||||
<xsl:call-template name="scape">
|
||||
<xsl:with-param name="string" select="$string"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="scape.slash.hyphen">
|
||||
<xsl:param name="string"/>
|
||||
<xsl:call-template name="scape">
|
||||
<xsl:with-param name="string" select="$string"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="scape-url">
|
||||
<xsl:param name="string"/>
|
||||
<xsl:call-template name="scape">
|
||||
<xsl:with-param name="string" select="$string"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="example">
|
||||
<xsl:variable name="placement">
|
||||
<xsl:call-template name="generate.formal.title.placement">
|
||||
<xsl:with-param name="object" select="local-name(.)" />
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="caption">
|
||||
<xsl:text>{</xsl:text>
|
||||
<xsl:value-of select="$latex.example.caption.style"/>
|
||||
<xsl:text>{\caption{</xsl:text>
|
||||
<!-- WARNING: do not scape if title output already scaped by original title parsing -->
|
||||
<xsl:call-template name="scape">
|
||||
<xsl:with-param name="string">
|
||||
<xsl:apply-templates select="title" mode="caption.mode"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:text>}</xsl:text>
|
||||
<xsl:text>}} </xsl:text>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="map.begin"/>
|
||||
<xsl:if test="$placement='before'">
|
||||
<xsl:text>\captionswapskip{}</xsl:text>
|
||||
<xsl:value-of select="$caption"/>
|
||||
<xsl:text>\captionswapskip{}</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates />
|
||||
<xsl:if test="$placement!='before'">
|
||||
<xsl:value-of select="$caption"/>
|
||||
</xsl:if>
|
||||
<xsl:call-template name="map.end"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!--############################################################################# -->
|
||||
<!-- DOCUMENTATION -->
|
||||
<doc:template name="normalize-scape" xmlns="">
|
||||
<refpurpose> Abstract XSL template. </refpurpose>
|
||||
<refdescription>
|
||||
</refdescription>
|
||||
</doc:template>
|
||||
<!--############################################################################# -->
|
||||
|
||||
<xsl:template match="text()" name="text">
|
||||
<xsl:call-template name="trim-outer">
|
||||
<xsl:with-param name="string">
|
||||
<xsl:choose>
|
||||
<xsl:when test="ancestor::literal|ancestor::filename|ancestor::userinput|ancestor::systemitem|ancestor::prompt|ancestor::email|ancestor::sgmltag">
|
||||
<xsl:call-template name="scape-verbatim">
|
||||
<xsl:with-param name="string" select="."/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="scape">
|
||||
<xsl:with-param name="string" select="."/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
<xsl:template match="abbrev/text()">
|
||||
<xsl:variable name="string">
|
||||
<xsl:call-template name="text()"/>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="to">.\ </xsl:with-param>
|
||||
<xsl:with-param name="from">. </xsl:with-param>
|
||||
<xsl:with-param name="string" select="$string"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
-->
|
||||
|
||||
<xsl:template match="text()" mode="xref.text">
|
||||
<xsl:call-template name="trim-outer">
|
||||
<xsl:with-param name="string">
|
||||
<xsl:call-template name="scape">
|
||||
<xsl:with-param name="string" select="."/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="text()" mode="xref-to">
|
||||
<xsl:call-template name="trim-outer">
|
||||
<xsl:with-param name="string">
|
||||
<xsl:call-template name="scape">
|
||||
<xsl:with-param name="string" select="."/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="text()" mode="latex.verbatim">
|
||||
<!--
|
||||
<xsl:call-template name="trim-outer">
|
||||
<xsl:with-param name="string">
|
||||
-->
|
||||
<xsl:value-of select="."/>
|
||||
<!--
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
-->
|
||||
</xsl:template>
|
||||
|
||||
<!-- this template is noly used by xref.mod.xsl and only when
|
||||
$latex.hyphenation.tttricks != 1. -->
|
||||
<xsl:template match="text()" mode="slash.hyphen">
|
||||
<xsl:call-template name="trim-outer">
|
||||
<xsl:with-param name="string">
|
||||
<xsl:call-template name="scape.slash.hyphen">
|
||||
<xsl:with-param name="string" select="." />
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="trim-outer">
|
||||
<xsl:param name="string"/>
|
||||
<xsl:variable name="trimleft" select="position()=1"/>
|
||||
<xsl:variable name="trimright" select="position()=last()"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$trimleft and not($trimright)">
|
||||
<xsl:value-of select="substring-before(normalize-space(concat($string,'$$')),'$$')"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$trimright and not($trimleft)">
|
||||
<xsl:value-of select="substring-after(normalize-space(concat('$$',$string)),'$$')"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$trimleft and $trimright">
|
||||
<xsl:value-of select="normalize-space($string)"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$string"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="scape.slash.hyphen">
|
||||
<xsl:param name="string" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($string,'://')">
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="to">/\dbz{}</xsl:with-param>
|
||||
<xsl:with-param name="from">/</xsl:with-param>
|
||||
<xsl:with-param name="string">
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="to">.\dbz{}</xsl:with-param>
|
||||
<xsl:with-param name="from">.</xsl:with-param>
|
||||
<xsl:with-param name="string">
|
||||
<xsl:value-of select="substring-before($string,'://')"/>
|
||||
<xsl:value-of select="'://'"/>
|
||||
<xsl:call-template name="scape">
|
||||
<xsl:with-param name="string" select="substring-after($string,'://')"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="to">/\dbz{}</xsl:with-param>
|
||||
<xsl:with-param name="from">/</xsl:with-param>
|
||||
<xsl:with-param name="string">
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="to">.\dbz{}</xsl:with-param>
|
||||
<xsl:with-param name="from">.</xsl:with-param>
|
||||
<xsl:with-param name="string">
|
||||
<xsl:call-template name="scape">
|
||||
<xsl:with-param name="string" select="$string"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="normalize-scape" >
|
||||
<xsl:param name="string"/>
|
||||
<xsl:variable name="result">
|
||||
<xsl:call-template name="scape"><xsl:with-param name="string" select="$string"/></xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="normalize-space($result)"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<doc:template name="scape-optionalarg" xmlns="">
|
||||
<refpurpose> Escape the ] character in LaTeX optional arguments (experimental) </refpurpose>
|
||||
<refdescription>
|
||||
</refdescription>
|
||||
</doc:template>
|
||||
<xsl:template name="scape-optionalarg" >
|
||||
<xsl:param name="string"/>
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="to">{\rbrack}</xsl:with-param>
|
||||
<xsl:with-param name="from">]</xsl:with-param>
|
||||
<xsl:with-param name="string" select="$string"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
<xsl:template name="string-replace">
|
||||
<xsl:param name="string"/>
|
||||
<xsl:param name="from"/>
|
||||
<xsl:param name="to"/>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($string, $from)">
|
||||
|
||||
<xsl:variable name="before" select="substring-before($string, $from)"/>
|
||||
<xsl:variable name="after" select="substring-after($string, $from)"/>
|
||||
<xsl:variable name="prefix" select="concat($before, $to)"/>
|
||||
|
||||
<xsl:value-of select="$before"/>
|
||||
<xsl:value-of select="$to"/>
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="string" select="$after"/>
|
||||
<xsl:with-param name="from" select="$from"/>
|
||||
<xsl:with-param name="to" select="$to"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$string"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
(c) David Carlisle
|
||||
replace all occurences of the character(s) `from'
|
||||
by the string `to' in the string `string'.
|
||||
<xsl:template name="string-replace" >
|
||||
<xsl:param name="string"/>
|
||||
<xsl:param name="from"/>
|
||||
<xsl:param name="to"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($string,$from)">
|
||||
<xsl:value-of select="substring-before($string,$from)"/>
|
||||
<xsl:value-of select="$to"/>
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="string" select="substring-after($string,$from)"/>
|
||||
<xsl:with-param name="from" select="$from"/>
|
||||
<xsl:with-param name="to" select="$to"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$string"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
-->
|
||||
|
||||
</xsl:stylesheet>
|
743
docs/xslt/table.mod.xsl
Normal file
743
docs/xslt/table.mod.xsl
Normal file
@ -0,0 +1,743 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--#############################################################################
|
||||
|- #############################################################################
|
||||
|
|
||||
| PURPOSE:
|
||||
+ ############################################################################## -->
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
|
||||
exclude-result-prefixes="doc" version='1.0'>
|
||||
|
||||
|
||||
|
||||
<!--############################################################################# -->
|
||||
<!-- DOCUMENTATION -->
|
||||
<doc:reference id="table" xmlns="">
|
||||
<referenceinfo>
|
||||
<releaseinfo role="meta">
|
||||
</releaseinfo>
|
||||
<authorgroup>
|
||||
<firstname>Ramon</firstname> <surname>Casellas</surname>
|
||||
<firstname>James</firstname> <surname>Devenish</surname>
|
||||
</authorgroup>
|
||||
<copyright>
|
||||
<year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
|
||||
<holder>Ramon Casellas</holder>
|
||||
</copyright>
|
||||
</referenceinfo>
|
||||
|
||||
<title>Tables <filename>table.mod.xsl</filename></title>
|
||||
<partintro>
|
||||
<section><title>Introduction</title>
|
||||
<para></para>
|
||||
</section>
|
||||
</partintro>
|
||||
</doc:reference>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--############################################################################# -->
|
||||
<!-- DOCUMENTATION -->
|
||||
<doc:template match="table|informaltable" xmlns="">
|
||||
<refpurpose>XSL template for docbook tables. </refpurpose>
|
||||
<refdescription>
|
||||
<para></para>
|
||||
<formalpara><title>Remarks and Bugs</title>
|
||||
<itemizedlist>
|
||||
</itemizedlist>
|
||||
</formalpara>
|
||||
<formalpara><title>Default Behaviour</title>
|
||||
<screen></screen>
|
||||
</formalpara>
|
||||
</refdescription>
|
||||
</doc:template>
|
||||
<!--############################################################################# -->
|
||||
|
||||
<xsl:template match="table">
|
||||
<xsl:variable name="placement">
|
||||
<xsl:call-template name="generate.formal.title.placement">
|
||||
<xsl:with-param name="object" select="local-name(.)" />
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="caption">
|
||||
<xsl:text>\caption{</xsl:text>
|
||||
<xsl:apply-templates select="title" mode="caption.mode"/>
|
||||
<xsl:text>} </xsl:text>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="map.begin"/>
|
||||
<xsl:if test="$placement='before'">
|
||||
<xsl:text>\captionswapskip{}</xsl:text>
|
||||
<xsl:value-of select="$caption" />
|
||||
<xsl:text>\captionswapskip{}</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:if test="$placement!='before'"><xsl:value-of select="$caption" /></xsl:if>
|
||||
<xsl:call-template name="map.end"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="table/title"/>
|
||||
<xsl:template match="table/title" mode="caption.mode"><xsl:apply-templates /></xsl:template>
|
||||
|
||||
<xsl:template match="informaltable">
|
||||
<xsl:call-template name="map.begin"/>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:call-template name="map.end"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="table.format.tabularx">
|
||||
<xsl:param name="cols" select="1"/>
|
||||
<xsl:param name="i" select="1"/>
|
||||
<xsl:param name="colsep" select="1"/>
|
||||
<!-- sum of numeric portions in 1*-like colwidths -->
|
||||
<xsl:param name="starfactor" select="0"/>
|
||||
<xsl:choose>
|
||||
<!-- Out of the recursive iteration -->
|
||||
<xsl:when test="$i > $cols"></xsl:when>
|
||||
<!-- There are still columns to count -->
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="width">
|
||||
<xsl:variable name="userchoice" select="colspec[@colnum=$i]/@colwidth"/>
|
||||
<xsl:variable name="cells" select="thead/row/entry[$i]|tbody/row/entry[$i]"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($userchoice)=0 and count($cells//itemizedlist|$cells//orderedlist|$cells//variablelist)>0">
|
||||
<!-- In these specific circumstances, we MUST use a line-wrapped column
|
||||
and yet the user hasn't specified one. -->
|
||||
<xsl:value-of select="'1*'"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- In the general case, we just do what the user wants (may even
|
||||
have no pre-specified width). -->
|
||||
<xsl:value-of select="$userchoice"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<!-- Try to take heed of colspecs -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$width!=''">
|
||||
<xsl:text>>{</xsl:text>
|
||||
<xsl:if test="contains($width,'*')">
|
||||
<!-- see tabularx documentation -->
|
||||
<xsl:text>\hsize=</xsl:text>
|
||||
<xsl:value-of select="substring-before($width,'*') * $starfactor" />
|
||||
<xsl:text>\hsize</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='left'"><xsl:text>\RaggedRight</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='right'"><xsl:text>\RaggedLeft</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='center'"><xsl:text>\Centering</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='char'"><xsl:message>Table column char alignment is not supported.</xsl:message></xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:text>}</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($width,'*')">
|
||||
<xsl:text>X</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>p{</xsl:text><xsl:value-of select="$width" /><xsl:text>}</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="$i<$cols and $colsep='1'">
|
||||
<xsl:text>|</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='left'"><xsl:text>l</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='right'"><xsl:text>r</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='center'"><xsl:text>c</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='justify'"><xsl:text>X</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='char'"><xsl:text>c</xsl:text><xsl:message>Table column char alignment is not supported.</xsl:message></xsl:when>
|
||||
<xsl:otherwise><xsl:text>X</xsl:text></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="$i<$cols and $colsep='1'">
|
||||
<xsl:text>|</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!-- Recursive for next column -->
|
||||
<xsl:call-template name="table.format.tabularx">
|
||||
<xsl:with-param name="i" select="$i+1"/>
|
||||
<xsl:with-param name="cols" select="$cols"/>
|
||||
<xsl:with-param name="starfactor" select="$starfactor"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- FIX THIS -->
|
||||
<xsl:template name="table.format.tabular">
|
||||
<xsl:param name="cols" select="1"/>
|
||||
<xsl:param name="i" select="1"/>
|
||||
<xsl:param name="colsep" select="1"/>
|
||||
<xsl:choose>
|
||||
<!-- Out of the recursive iteration -->
|
||||
<xsl:when test="$i > $cols"></xsl:when>
|
||||
<!-- There are still columns to count -->
|
||||
<xsl:otherwise>
|
||||
<!-- Try to take heed of colspecs -->
|
||||
<xsl:choose>
|
||||
<!-- RC 2003/03/19 : Added first 'test' : colspec[@colnum=$i] for xsltproc
|
||||
Before this patch, parsing the doc with xsltproc the xsl:when clause
|
||||
was evaluated to 'true' even if there was no colspec for the column
|
||||
-->
|
||||
<xsl:when test="colspec[@colnum=$i] and colspec[@colnum=$i]/@colwidth!='' and not(contains(colspec[@colnum=$i]/@colwidth,'*'))">
|
||||
<xsl:choose>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='left'"><xsl:text>>{\RaggedRight}</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='right'"><xsl:text>>{\RaggedLeft}</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='center'"><xsl:text>>{\Centering}</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='char'"><xsl:message>Table column char alignment is not supported.</xsl:message></xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:text>p{</xsl:text><xsl:value-of select="colspec[@colnum=$i]/@colwidth" /><xsl:text>}</xsl:text>
|
||||
<xsl:if test="$i<$cols and $colsep='1'">
|
||||
<xsl:text>|</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='left'"><xsl:text>l</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='right'"><xsl:text>r</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='center'"><xsl:text>c</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='justify'"><xsl:text>l</xsl:text></xsl:when>
|
||||
<xsl:when test="colspec[@colnum=$i]/@align='char'"><xsl:text>c</xsl:text><xsl:message>Table column char alignment is not supported.</xsl:message></xsl:when>
|
||||
<xsl:otherwise><xsl:text>c</xsl:text></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="$i<$cols and $colsep='1'">
|
||||
<xsl:text>|</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!-- Recursive for next column -->
|
||||
<xsl:call-template name="table.format.tabular">
|
||||
<xsl:with-param name="i" select="$i+1"/>
|
||||
<xsl:with-param name="cols" select="$cols"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<!-- See tabularx documentation. -->
|
||||
<!-- For example, if we have a 1* column and a 3* column, then the
|
||||
the hsizes for each column are (1/(1+3)*2) and (3/(1+3)*2).
|
||||
The ratio of these to the star values (star values being 1 and 3)
|
||||
is 2/(1+3).
|
||||
BUT it is now very complicated because it takes into account columns
|
||||
where the user has not specified a width but LaTeX requires a
|
||||
fixed-width column (i.e. specialcols may vary).
|
||||
Relies on there being (a) colspecs for every column or (b) no
|
||||
colspecs.
|
||||
-->
|
||||
<xsl:template name="generate.starfactor">
|
||||
<xsl:param name="i" select="1"/>
|
||||
<xsl:param name="cols" select="count(colspec)"/>
|
||||
<xsl:param name="sum" select="0"/>
|
||||
<xsl:param name="specialcols" select="count(colspec[contains(@colwidth,'*')])"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$i<=$cols and colspec[position()=$i and contains(@colwidth,'*')]">
|
||||
<!-- a * column -->
|
||||
<xsl:call-template name="generate.starfactor">
|
||||
<xsl:with-param name="i" select="$i+1"/>
|
||||
<xsl:with-param name="cols" select="$cols"/>
|
||||
<xsl:with-param name="sum" select="$sum+substring-before(colspec[$i]/@colwidth,'*')"/>
|
||||
<xsl:with-param name="specialcols" select="$specialcols"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="$i<=$cols">
|
||||
<!-- not a * column, but we are going to pretend that it is -->
|
||||
<xsl:variable name="cells" select="thead/row/entry[$i]|tbody/row/entry[$i]"/>
|
||||
<xsl:variable name="problems" select="count($cells//itemizedlist|$cells//orderedlist|$cells//variablelist)"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$problems > 0">
|
||||
<xsl:call-template name="generate.starfactor">
|
||||
<xsl:with-param name="i" select="$i+1"/>
|
||||
<xsl:with-param name="cols" select="$cols"/>
|
||||
<xsl:with-param name="sum" select="$sum+1"/>
|
||||
<xsl:with-param name="specialcols" select="$specialcols+1"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="generate.starfactor">
|
||||
<xsl:with-param name="i" select="$i+1"/>
|
||||
<xsl:with-param name="cols" select="$cols"/>
|
||||
<xsl:with-param name="sum" select="$sum"/>
|
||||
<xsl:with-param name="specialcols" select="$specialcols"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$specialcols div $sum"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="tgroup">
|
||||
<xsl:variable name="align" select="@align"/>
|
||||
<xsl:variable name="frame">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(../@frame)<1">all</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="../@frame"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="colspecs" select="./colspec"/>
|
||||
<xsl:variable name="usex">
|
||||
<xsl:choose>
|
||||
<!-- if there are lists within cells, we need tabularx -->
|
||||
<xsl:when test="$latex.use.tabularx=1 and (descendant::itemizedlist|descendant::orderedlist|descendant::variablelist)">
|
||||
<xsl:text>1</xsl:text>
|
||||
</xsl:when>
|
||||
<!-- if there are instances of 1*-style colwidths, we need tabularx -->
|
||||
<xsl:when test="$latex.use.tabularx=1 and contains(colspec/@colwidth,'*')">
|
||||
<xsl:text>1</xsl:text>
|
||||
</xsl:when>
|
||||
<!-- if there are colspecs with 'justify' alignment and no explicit width, we need tabularx -->
|
||||
<xsl:when test="$latex.use.tabularx=1 and count(colspec[@align='justify'])>0">
|
||||
<xsl:text>1</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>1</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="useminipage">
|
||||
<!-- Hack to get around LaTeX issue with tabular (not necessary with tabularx).
|
||||
This is NOT a good solution, and has problems of its own, but at least the footnotes
|
||||
do not actually disappear (which is what would otherwise happen). -->
|
||||
<xsl:if test="count(.//footnote)!=0">1</xsl:if>
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$usex='1'">
|
||||
<xsl:text>\begin{tabularx}{\linewidth}{</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="$useminipage='1'"><xsl:text>\begin{minipage}{\linewidth} </xsl:text></xsl:if>
|
||||
<xsl:text>\begin{tabular}{</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="$frame='all' or $frame='sides'">
|
||||
<xsl:text>|</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$usex=1">
|
||||
<xsl:call-template name="table.format.tabularx">
|
||||
<xsl:with-param name="cols" select="@cols"/>
|
||||
<xsl:with-param name="starfactor">
|
||||
<xsl:call-template name="generate.starfactor">
|
||||
<xsl:with-param name="cols" select="@cols"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="table.format.tabular">
|
||||
<xsl:with-param name="cols" select="@cols"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="$frame='all' or $frame='sides'">
|
||||
<xsl:text>|</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text>} </xsl:text>
|
||||
<xsl:if test="$frame!='sides' and $frame!='none' and $frame!='bottom'">
|
||||
<xsl:text>\hline </xsl:text>
|
||||
</xsl:if>
|
||||
<!-- APPLY TEMPLATES -->
|
||||
<xsl:apply-templates/>
|
||||
<!-- -->
|
||||
<xsl:if test="$frame!='sides' and $frame!='none' and $frame!='top'">
|
||||
<xsl:text>\hline </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$usex=1">
|
||||
<xsl:text>\end{tabularx} </xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>\end{tabular} </xsl:text>
|
||||
<xsl:if test="$useminipage='1'"><xsl:text>\end{minipage} </xsl:text></xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
<xsl:template name="generate.col">
|
||||
<xsl:param name="countcol">1</xsl:param>
|
||||
</xsl:template>
|
||||
-->
|
||||
|
||||
<xsl:template match="colspec"></xsl:template>
|
||||
<xsl:template match="spanspec"></xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
<xsl:template match="thead|tfoot">
|
||||
<xsl:if test="@align">
|
||||
<xsl:attribute name="align">
|
||||
<xsl:value-of select="@align"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="@char">
|
||||
<xsl:attribute name="char">
|
||||
<xsl:value-of select="@char"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="@charoff">
|
||||
<xsl:attribute name="charoff">
|
||||
<xsl:value-of select="@charoff"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="@valign">
|
||||
<xsl:attribute name="valign">
|
||||
<xsl:value-of select="@valign"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="thead/row/entry|tfoot/row/entry">
|
||||
<xsl:call-template name="latex.entry.prealign"/>
|
||||
<xsl:call-template name="latex.thead.row.entry"/>
|
||||
<xsl:call-template name="latex.entry.postalign"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="position()=last()"><xsl:text> \tabularnewline </xsl:text></xsl:when>
|
||||
<xsl:otherwise><xsl:call-template name="generate.latex.cell.separator"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tbody">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="row">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tbody/row|thead/row|tfoot/row">
|
||||
<xsl:apply-templates/>
|
||||
<!-- The rule below the last row in the table is controlled by the
|
||||
Frame attribute of the enclosing Table or InformalTable and the RowSep
|
||||
of the last row is ignored. If unspecified, this attribute is
|
||||
inherited from enclosing elements, rowsep=1 by default. -->
|
||||
<xsl:variable name="parent_position" select="count(../preceding-sibling::node())+1"/>
|
||||
<xsl:variable name="grandparent_children" select="count(../../child::node())"/>
|
||||
<xsl:if test="(count(@rowsep)=0 or @rowsep='1') and (position() != last() or $parent_position < $grandparent_children)">
|
||||
<xsl:text> \hline </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="tbody/row/entry">
|
||||
<xsl:call-template name="latex.entry.prealign"/>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:call-template name="latex.entry.postalign"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="position()=last()"><xsl:text> \tabularnewline </xsl:text></xsl:when>
|
||||
<xsl:otherwise><xsl:call-template name="generate.latex.cell.separator"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="latex.entry.prealign">
|
||||
<xsl:variable name="span">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@spanname!=''">
|
||||
<xsl:call-template name="calculate.colspan">
|
||||
<xsl:with-param name="namest" select="../../../spanspec[@spanname=@spanname]/@namest"/>
|
||||
<xsl:with-param name="nameend" select="../../../spanspec[@spanname=@spanname]/@nameend"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="@namest!=''">
|
||||
<xsl:call-template name="calculate.colspan"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>-1</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:if test="$span > 1">
|
||||
<xsl:text>\multicolumn{</xsl:text>
|
||||
<xsl:value-of select="$span"/>
|
||||
<xsl:text>|}{</xsl:text><!-- TODO take heed of @colsep -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="@align='left'"><xsl:text>l</xsl:text></xsl:when>
|
||||
<xsl:when test="@align='right'"><xsl:text>r</xsl:text></xsl:when>
|
||||
<xsl:when test="@align='center'"><xsl:text>c</xsl:text></xsl:when>
|
||||
<xsl:when test="@align='char'">c<xsl:message>Table entry char alignment is not supported.</xsl:message></xsl:when>
|
||||
<xsl:otherwise>c</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!-- use this as a hook for some general warnings -->
|
||||
<xsl:text>}</xsl:text>
|
||||
</xsl:if>
|
||||
<!-- this is used when the entry's align spec wants to override the column default -->
|
||||
<xsl:if test="$span < 1">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@align='left'"><xsl:text>\docbooktolatexalignll </xsl:text></xsl:when>
|
||||
<xsl:when test="@align='right'"><xsl:text>\docbooktolatexalignrl </xsl:text></xsl:when>
|
||||
<xsl:when test="@align='center'"><xsl:text>\docbooktolatexaligncl </xsl:text></xsl:when>
|
||||
<xsl:when test="@align='char'"><xsl:message>Table entry char alignment is not supported.</xsl:message></xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
<xsl:text>{</xsl:text>
|
||||
<xsl:if test="@rotate='1'">
|
||||
<xsl:text>\rotatebox{90}</xsl:text>
|
||||
<xsl:if test="@align!=''"><xsl:message>entry[@rotate='1' and @align!=''] probably doesn't work.</xsl:message></xsl:if>
|
||||
</xsl:if>
|
||||
<xsl:text>{</xsl:text>
|
||||
<!-- use this as a hook for some general warnings -->
|
||||
<xsl:if test="@morerows!=''"><xsl:message>The morerows attribute is not supported.</xsl:message></xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="latex.entry.postalign">
|
||||
<xsl:text>}}</xsl:text>
|
||||
<!-- this is used when the entry's align spec wants to override the column default -->
|
||||
<xsl:if test="@namest='' and @spanspec=''"><!-- TODO improve -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="@align='left'"><xsl:text>\docbooktolatexalignlr </xsl:text></xsl:when>
|
||||
<xsl:when test="@align='right'"><xsl:text>\docbooktolatexalignrr </xsl:text></xsl:when>
|
||||
<xsl:when test="@align='center'"><xsl:text>\docbooktolatexaligncr </xsl:text></xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<xsl:template name="process.cell">
|
||||
<xsl:param name="cellgi">td</xsl:param>
|
||||
<xsl:variable name="empty.cell" select="count(node()) = 0"/>
|
||||
|
||||
<xsl:element name="{$cellgi}">
|
||||
<xsl:if test="@morerows">
|
||||
<xsl:attribute name="rowspan">
|
||||
<xsl:value-of select="@morerows+1"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="@namest">
|
||||
<xsl:attribute name="colspan">
|
||||
<xsl:call-template name="calculate.colspan"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="@align">
|
||||
<xsl:attribute name="align">
|
||||
<xsl:value-of select="@align"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="@char">
|
||||
<xsl:attribute name="char">
|
||||
<xsl:value-of select="@char"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="@charoff">
|
||||
<xsl:attribute name="charoff">
|
||||
<xsl:value-of select="@charoff"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="@valign">
|
||||
<xsl:attribute name="valign">
|
||||
<xsl:value-of select="@valign"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$empty.cell">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="generate.colgroup">
|
||||
<xsl:param name="cols" select="1"/>
|
||||
<xsl:param name="count" select="1"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$count>$cols"></xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="generate.col">
|
||||
<xsl:with-param name="countcol" select="$count"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="generate.colgroup">
|
||||
<xsl:with-param name="cols" select="$cols"/>
|
||||
<xsl:with-param name="count" select="$count+1"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="generate.col">
|
||||
<xsl:param name="countcol">1</xsl:param>
|
||||
<xsl:param name="colspecs" select="./colspec"/>
|
||||
<xsl:param name="count">1</xsl:param>
|
||||
<xsl:param name="colnum">1</xsl:param>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$count>count($colspecs)">
|
||||
<col/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
|
||||
<xsl:variable name="colspec.colnum">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$colspec/@colnum">
|
||||
<xsl:value-of select="$colspec/@colnum"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$colnum"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$colspec.colnum=$countcol">
|
||||
<col>
|
||||
<xsl:if test="$colspec/@align">
|
||||
<xsl:attribute name="align">
|
||||
<xsl:value-of select="$colspec/@align"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="$colspec/@char">
|
||||
<xsl:attribute name="char">
|
||||
<xsl:value-of select="$colspec/@char"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="$colspec/@charoff">
|
||||
<xsl:attribute name="charoff">
|
||||
<xsl:value-of select="$colspec/@charoff"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</col>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="generate.col">
|
||||
<xsl:with-param name="countcol" select="$countcol"/>
|
||||
<xsl:with-param name="colspecs" select="$colspecs"/>
|
||||
<xsl:with-param name="count" select="$count+1"/>
|
||||
<xsl:with-param name="colnum">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$colspec/@colnum">
|
||||
<xsl:value-of select="$colspec/@colnum + 1"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$colnum + 1"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="colspec.colnum">
|
||||
<!-- when this macro is called, the current context must be an entry -->
|
||||
<xsl:param name="colname"></xsl:param>
|
||||
<!-- .. = row, ../.. = thead|tbody, ../../.. = tgroup -->
|
||||
<xsl:param name="colspecs" select="../../../../tgroup/colspec"/>
|
||||
<xsl:param name="count">1</xsl:param>
|
||||
<xsl:param name="colnum">1</xsl:param>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$count>count($colspecs)"></xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
|
||||
<!--
|
||||
<xsl:value-of select="$count"/>:
|
||||
<xsl:value-of select="$colspec/@colname"/>=
|
||||
<xsl:value-of select="$colnum"/>
|
||||
-->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$colspec/@colname=$colname">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$colspec/@colnum">
|
||||
<xsl:value-of select="$colspec/@colnum"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$colnum"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="colspec.colnum">
|
||||
<xsl:with-param name="colname" select="$colname"/>
|
||||
<xsl:with-param name="colspecs" select="$colspecs"/>
|
||||
<xsl:with-param name="count" select="$count+1"/>
|
||||
<xsl:with-param name="colnum">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$colspec/@colnum">
|
||||
<xsl:value-of select="$colspec/@colnum + 1"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$colnum + 1"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="colspec.colwidth">
|
||||
<!-- when this macro is called, the current context must be an entry -->
|
||||
<xsl:param name="colname"></xsl:param>
|
||||
<!-- .. = row, ../.. = thead|tbody, ../../.. = tgroup -->
|
||||
<xsl:param name="colspecs" select="../../../../tgroup/colspec"/>
|
||||
<xsl:param name="count">1</xsl:param>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$count>count($colspecs)"></xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$colspec/@colname=$colname">
|
||||
<xsl:value-of select="$colspec/@colwidth"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="colspec.colwidth">
|
||||
<xsl:with-param name="colname" select="$colname"/>
|
||||
<xsl:with-param name="colspecs" select="$colspecs"/>
|
||||
<xsl:with-param name="count" select="$count+1"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="calculate.colspan">
|
||||
<xsl:param name="namest" select="@namest"/>
|
||||
<xsl:param name="nameend" select="@nameend"/>
|
||||
<xsl:variable name="scol">
|
||||
<xsl:call-template name="colspec.colnum">
|
||||
<xsl:with-param name="colname" select="$namest"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="ecol">
|
||||
<xsl:call-template name="colspec.colnum">
|
||||
<xsl:with-param name="colname" select="$nameend"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="$ecol - $scol + 1"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
16
docs/xslt/unicode.mapping.dtd
Normal file
16
docs/xslt/unicode.mapping.dtd
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: unicode.mapping.dtd,v 1.1 2003/12/05 06:53:48 ab Exp $ -->
|
||||
<!-- DTD for XML with mapping Unicode entities to LaTeX commands -->
|
||||
<!-- Author: Vitaly Ostanin <vyt@altlinux.ru> -->
|
||||
|
||||
<!ELEMENT mapping (character+)>
|
||||
|
||||
<!ELEMENT character (unicode, latex?, mathlatex?, preferred)>
|
||||
|
||||
<!ELEMENT unicode (#PCDATA)>
|
||||
|
||||
<!ELEMENT latex (#PCDATA)>
|
||||
|
||||
<!ELEMENT mathlatex (#PCDATA)>
|
||||
|
||||
<!ELEMENT preferred (#PCDATA)>
|
72
docs/xslt/unicode.mapping.xml
Normal file
72
docs/xslt/unicode.mapping.xml
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- $Id: unicode.mapping.xml,v 1.1 2003/12/05 06:53:48 ab Exp $ -->
|
||||
<!DOCTYPE mapping SYSTEM "unicode.mapping.dtd">
|
||||
<mapping>
|
||||
<character>
|
||||
<unicode><</unicode>
|
||||
<latex>\guilsinglleft{}</latex>
|
||||
<preferred>\guilsinglleft{}</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>></unicode>
|
||||
<latex>\guilsinglright{}</latex>
|
||||
<preferred>\guilsinglright{}</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>#</unicode>
|
||||
<latex>\#</latex>
|
||||
<preferred>\#</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>$</unicode>
|
||||
<latex>\textdollar{}</latex>
|
||||
<mathlatex>\$</mathlatex>
|
||||
<preferred>\textdollar{}</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>%</unicode>
|
||||
<latex>\%</latex>
|
||||
<preferred>\%</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>&</unicode>
|
||||
<latex>\&</latex>
|
||||
<preferred>\&</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>~</unicode>
|
||||
<latex>\textasciitilde{}</latex>
|
||||
<preferred>\textasciitilde{}</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>_</unicode>
|
||||
<latex>\_</latex>
|
||||
<preferred>\_</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>^</unicode>
|
||||
<latex>\^{}</latex>
|
||||
<preferred>\^{}</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>\</unicode>
|
||||
<latex>\textbackslash{}</latex>
|
||||
<mathlatex>\backslash </mathlatex>
|
||||
<preferred>\textbackslash{}</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>{</unicode>
|
||||
<latex>\{</latex>
|
||||
<preferred>\{</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>}</unicode>
|
||||
<latex>\}</latex>
|
||||
<preferred>\}</preferred>
|
||||
</character>
|
||||
<character>
|
||||
<unicode>|</unicode>
|
||||
<latex>$\vert$</latex>
|
||||
<preferred>$\vert$</preferred>
|
||||
</character>
|
||||
</mapping>
|
Loading…
Reference in New Issue
Block a user