Compare commits

...

No commits in common. "debian/latest" and "pristine-tar" have entirely different histories.

948 changed files with 26 additions and 247236 deletions

View File

@ -1 +0,0 @@
Patrick Ohly <patrick.ohly@gmx.de>

View File

@ -1,39 +0,0 @@
Untested:
- flags of configure script:
--enable-mlite
--enable-gui=all or --enable-gui=moblin
--enable-akonadi
--enable-kcalextended
--enable-qtcontacts (see TODO)
--enable-kwallet
--enable-maemocal
... probably more.
- make -j and make -jX where X>2, because gcc is being killed by oom-killer).
Partially tested:
--enable-gnome-bluetooth-panel-plugin (installation not tested - plugin is not
installed under given prefix, but somewhere into /usr/lib...)
Tested and passed:
- flags of configure script:
--enable-unit-tests
--enable-integration-tests
--enable-maemo
--enable-libcurl
--enable-libsoup
--enable-bluetooth
--enable-gui=gtk
--enable-core
--enable-dbus-service
--enable-gnome-keyring
--enable-notify
--enable-doc
--enable-sqlite
--enable-dav
--enable-xmlrpc
--enable-qt-dbus
--enable-static
--disable-shared
- make -jX
- make V=0
- make -j2 distcheck

View File

@ -1,109 +0,0 @@
REGRESSIONS:
- Port ActiveSync backend to non-recursive Automake.
IMPROVEMENTS:
- Add a check for qt-mobility for QtContacts backend.
- Probably client test should be built only when unit tests or integration tests
are enabled.
- Review CLEANFILES, DISTCLEANFILES, MAINTAINERCLEANFILES and MOSTLYCLEANFILES.
That is - check which files should be assigned to which of CLEAN variables.
- Check why distcheck outputs:
==================
All 0 tests passed
==================
There should have been at least one test being run. The same behavior exists
in old build system.
This is because neither unit tests nor integration tests are enabled by
default. If we would want to enable them then we should add
--enable-unit-tests and --enable-integration-tests into
DISTCHECK_CONFIGURE_FLAGS in toplevel Makefile.am.
- Check why there are so many failed tests when running `make check' explicitly.
The same number of failures exists in old build system:
Run: 583 Failure total: 528 Failures: 206 Errors: 322
- Tidy up configure.ac and some .am files.
- Maybe write scripts generating configs_xml.am, templates.am and profiles.am.
QUESTIONS:
- None.
PERSISTENT:
- Hunt for common variables clobbering.
- Silence more verbose output if found.
NITPICKS:
- Check if SyncEvolutionXML.c should always be recreated, patches always checked
and test-client always relinked.
- Maybe do not create /share/man/man1 directory if we do not put there anything.
- If backends are static libraries then do not create /lib/syncevolution,
because nothing is put here.
- Change $(foo) to @foo@ for all variables substituted by configure script. This
might be useful when looking for actual value of variable appearing out of
nowhere in .am file. Maybe make also all configure variables UPPER_CASE
and all local Automake variables lower_case.
- Lower autoreconf's warnings level later. Namely - don't warn about some
portability issues. The warnings about obsolete stuff should rather remain.
For now only some glib macros are using obsolete features.
- Should stamp files be marked as intermediate or rather as secondary files?
- Check why 'copying selected object files to avoid basename conflicts...' is
displayed between linking src/dbus/server/libsyncevodbusserver.la
and compiling src/gdbus/src_gdbus_libgdbussyncevo_la-debug.lo. This is
probably harmless.
TRACKING:
- Handle nobase prefixes. Link to track:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9289
- Explanation why make -jX used to fail:
It failed because usually Automake generates dependencies of a library/program
by looking at its _LIBADD/_LDADD variable. But this generation doesn't work
correctly when _LIBADD/_LDADD variable has AC_SUBSTed variable - automake then
just discards them and resulting _DEPENDENCIES variable does not contain them.
As a workaround _DEPENDENCIES variable have to be written explicitly. Link to
track:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9320

26
COPYING
View File

@ -1,26 +0,0 @@
SyncEvolution - the next generation data synchronization program using SyncML
Copyright (C) 2005-2006 Patrick Ohly <patrick.ohly@gmx.de>
Copyright (C) 2007 Funambol (up to and including release 0.7, but no
later version)
Copyright (C) 2007-2008 Patrick Ohly <patrick.ohly@gmx.de>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2.1 of the License, or (at your option)
version 3.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
more details.
You should have received a copy of the GNU Lesser General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-------------------------------------------------------------------
Some of the files included in the SyncEvolution distribution were
written by other authors and/or are distributed under a different
license. See the individual COPYING files in subdirectories.

View File

@ -1,5 +0,0 @@
2009-02-27 Patrick Ohly <patrick.ohly@intel.com>
* SyncEvolution moved from Subversion to Git. If you are reading
this then you should use `git log` to read the changes from the
commit messages.

1294
Doxyfile

File diff suppressed because it is too large Load Diff

369
HACKING
View File

@ -1,369 +0,0 @@
Compiling from Source
---------------------
To compile the code the source or an installation of the Synthesis
SyncML engine is needed. A compatible snapshot of it is included in
SyncEvolution source packages and will be used automatically.
The section _`Checking out the source` explains how to work
with sources obtained via the git repositories.
Also needed are the Evolution (can be disabled), Boost (>= 1.35) and
pcre development files. For HTTP, either Curl or libsoup can be used.
For compiling libsynthesis, sqlite, expat, libz are needed.
On Debian based systems, the required packages can be installed with
apt-get install evolution-data-server-dev \
libglib2.0-dev \
libecal1.2-dev libebook1.2-dev \
libsoup2.4-dev \
libpcre3-dev \
libexpat-dev \
libz-dev \
libboost-dev
If gio (part of libglib) is not available in version 2.26 or higher,
then libdbus can be used as fallback (not needed otherwise):
apt-get install libdbus-glib-1-dev
libboost-dev >= 1.34, available as libboost1.35-dev backport for Debian Etch.
Necessary on some distros due to bad dependencies (not needed by SyncEvolution itself):
apt-get install libdb3-dev
Optional (enables reading proxy settings from GNOME preferences):
apt-get install libsoup-gnome2.4-dev
Optional (enables direct sync with phones):
apt-get install libopenobex-dev libbluetooth-dev
Optional (only used for SHA-256 when glib is not already a dependency):
apt-get install libnss3-dev
The test framework also requires CPPUnit:
apt-get install libcppunit-dev
For the GUI and its D-Bus based service backend:
apt-get install xsltproc \
libdbus-glib-1-dev \
libglib2.0-dev \
libgtk2.0-dev libglade2-dev \
libsecret-1-dev \
libgconf2-dev libgnomevfs2-dev
Optional packages for GUI:
apt-get install libunique-dev
libunique = ensure that GTK GUI only runs once per user
Optional packages for GNOME Bluetooth Panel plugin:
apt-get install libgnome-bluetooth-dev
The plugin adds a button to invoke sync-UI after a device
was paired which supports SyncML.
The build system is the normal autotools system. See INSTALL for
general instructions how to use that and "./configure --help" for
SyncEvolution specific options.
Note that compiling without the Evolution development files is
possible. But because this is usually not what people want,
the configure script needs explicit --disable-ecal --disable-ebook
parameters, otherwise it will refuse to compile without Evolution
support.
When compiling from a git checkout, remember to run "./autogen.sh".
It depends on:
apt-get install libtool intltool automake
Checking out the Source
-----------------------
SyncEvolution is hosted on freedesktop.org. Anonymous access is via
git clone git://anongit.freedesktop.org/SyncEvolution/syncevolution
Before using sources checked out from Subversion, invoke "sh
autogen.sh" with appropriate autotools packages installed.
When running the configure script, it can be told to compile a
Synthesis library automatically via the --with-synthesis-src configure
option. This has advantages when modifying the Synthesis source
together with SyncEvolution (no need to install Synthesis and thus
faster compilation) and will bundle the Synthesis sources in source
.tar.gz archives.
The upstream Synthesis source code is here:
git://www.synthesis.ch/libsynthesis.git
The staging area for patches developed as part of SyncEvolution are
in the following repository:
git://anongit.freedesktop.org/SyncEvolution/libsynthesis
The intention is to include all these patches upstream to
prevent forking the code. If you want to get patches included
in the Synthesis code base, then please work directly with
the upstream branch.
For doing development work the recommended configure line is:
configure --with-synthesis-src=<path to libsynthesis source> \
--enable-warnings=fatal \
--enable-unit-tests \
--enable-libcurl \
--disable-shared \
--enable-developer-mode
Enabling libcurl explicitly ensures that it gets built even when not
the default.
--disable-shared results in easier to debug executables (no shell
wrapper scripts, all symbols available before the program runs).
Backend libraries are dynamically scannned and loaded into syncevolution, the
library path defaults to $prefix/syncevolution/backends. When developer-mode is
enabled, it will scan libraries in current build directory instead.
-Wno-unknown-pragmas is required to avoid warnings triggered by
'#pragma }', a trick to preserve indention after 'extern "C" {' in
/usr/include/evolution-data-server-1.12/libical/
Working with the Code
---------------------
The code follows the code formatting of the Funambol
C++ client library. Just emulate the existing
code when possible.
Exceptions derived from std::exception are used to report errors. The
EvolutionSyncSource::handleException() function deals with logging the
exception.
SyncEvolution uses the a CPPUnit based testing framework. Configure
with --enable-integration-tests and (optionally) --enable-unit-tests,
then run "src/client-test" as described in src/client-test-app.cpp.
It understands several environment variables, among them:
- CLIENT_TEST_SERVER = chooses config
- CLIENT_TEST_SOURCES = comma separated list of enabled sources, identified
by their name
For Evolution: eds_contact,eds_event,eds_task,eds_memo
For file backend: file_contact,file_event,file_task,file_memo (uses same test
data and vCard flavor as Evolution)
- CLIENT_TEST_EVOLUTION_PREFIX=[name|file://<path>] overrides
the evolutionsource setting in the configuration; if file:// is used
then these database will be created automatically
NOTE : The automatic database creation is not supported for EDS 2.32. We need
to create manually the databases using Evolution. New database names must be
named ${CLIENT_TEST_EVOLUTION_PREFIX}${CLIENT_TEST_SOURCES}_[12].
Example: if CLIENT_TEST_EVOLUTION_PREFIX=Test_ and Client::Sync::eds_contact
is used, then addressbooks with the names 'Test_eds_contact_1' and
'Test_eds_contact_2' must exist.
- CLIENT_TEST_XML=1 use XML format as default instead of the normal WBXML
For unattended testing:
- CLIENT_TEST_FAILURES = comma separated list of tests which are allowed
to fail without affecting the return code of the test runner; each list
entry is a regex which must match a complete test name
- CLIENT_TEST_SKIP = comma separated list of tests or test groups which
are not to be executed at all; for this to work the test or test group
has to be passed through test.h's version of ADD_TEST or FilterTest,
which is the case for most tests but not all; as in CLIENT_TEST_FAILURES,
each entry is a regex
- CLIENT_TEST_LOG = name of server log file, will be copied and reset
after each sync
- CLIENT_TEST_ALARM = number of seconds a single test is allowed to run
before aborting it
Most Client::Sync tests use the default encoding, usually WBXML unless
changed via CLIENT_TEST_XML=1. Client::Sync::*::testItemsXML always
uses XML and Client::Sync::*::testItems always WBXML.
Here are step-by-step instructions to get started with testing,
using ScheduleWorld as example:
- CLIENT_TEST_SERVER=scheduleworld \
CLIENT_TEST_EVOLUTION_PREFIX=file:///tmp/testing/ \
./client-test -h
=> creates ~/.config/syncevolution/scheduleworld_[12]/ configs
which use data bases under /tmp/testing, then
prints all available tests
- edit ~/.config/syncevolution/scheduleworld_[12]/spds/syncml/config.txt
and enter account data for ScheduleWorld in both configurations;
check that the syncURL is correct
- CLIENT_TEST_SERVER=scheduleworld \
CLIENT_TEST_EVOLUTION_PREFIX=file:///tmp/testing/ \
./client-test Client::Source
=> runs alls tests involving just local operations
- CLIENT_TEST_SERVER=scheduleworld \
CLIENT_TEST_EVOLUTION_PREFIX=file:///tmp/testing/ \
./client-test Client::Sync::vcard30::testCopy
=> runs one test that checks that one contact can
be copied to and from the server using the two
configurations
- CLIENT_TEST_SERVER=scheduleworld \
CLIENT_TEST_EVOLUTION_PREFIX=file:///tmp/testing/ \
./client-test Client::Sync
=> runs all tests which involve the SyncML server;
tests involving just one source are run first,
followed by the same tests with all enabled
sources in two different orders
"make valgrind" runs the same tests inside valgrind
[http://www.valgrind.org]. A suppression file is
used to hide errors inside system libraries which
are not caused by SyncEvolution or Synthesis
library code. Most likely the suppressions are system
dependent and might have to be updated from time to time.
Committing Changes
------------------
Here are some guidelines for well-formed commits:
- Avoid unnecessary white space changes in the source code.
- Don't mix unrelated changes in one single commit. Every
single commit should leave the code in a functional state
(compiles, unit tests pass, ...).
- Document new functions and structures with Doxygen comments.
These comments should really add information, not just
repeat the name of the entity. At least paraphrase the names.
- Each commit message should follow the format
<item>: <summary> [(BMC #1234)]
<blank line>
<body>
- <item> here refers to the module, class or functionality modified
in the commit, for example "autotools" for the build scripts,
"EvolutionContactSource" for the EDS contact backend, etc.
- <summary> should be consise enough to describe the patch on
its own.
- The optional bugs.meego.com (BMC) number in round brackets
refers to the issue addressed by the commit. Most changes,
in particular bug fixes, should have such an issue filed
for tracking purposes.
- The body (hard-wrapped, multiple paragraphs for long text)
should include the following pieces of information,
if applicable:
- problem statement (*why* is the change relevant?)
- summary of the solution (*how* is the problem solved?)
- what other solutions were considered and rejected (*context*
for the solution)
- known gaps (in particularly useful during code review,
which will start with the oldest, possibly incomplete patch first)
When writing source code comments and commit messages, always remember
that you are communicating with someone. This person might be even be
you in some distant future, trying to remember why the heck something
was done the way it was done... There might not be a chance to ask
questions, so think about what such a person might want to know and
answer it in advance.
There is a certain redundancy between source code comments, commit
messages and issue tracker comments. Whenever possible, the
description of the solution should be in the source code itself, with
only a brief summary and/or pointer in the commit message. It's fine
to copy-and-paste to reduce the overall effort.
Building a Release
------------------
- increase version number in configure-pre.in/AM_INIT_AUTOMAKE
For prereleases use "old version"+"new prerelease"-1 as
package version. That ensures that package versions are
higher than the old release, but lower than the final
release. Avoid hyphens as part of the release names, i.e.
use "0.7+0.8beta1" instead of "0.7+0.8-beta1".
- ensure files were updated:
./NEWS debian/changelog
- update po/LINGUAS
- check and if necessary, bump the Synthesis .so versions
(libsynthesis/src/Makefile.am.in)
- ensure that Synthesis source code is tagged:
use <base version>+<syncevo version> if local changes exist
- commit and tag SyncEvolution source code
- make distcheck
- compile binary .tar.gz packages for different Evolution versions;
done automatically by runtests.py on estamos.de (= Debian 3.0), using different Garnome
installations, and with special configure options to ensure maximum
portability (LDFLAGS=-Wl,--as-needed --enable-static-cxx)
- compile .deb for Maemo
- update entries on the web about the release:
http://maemo.org/downloads/product/OS2008/syncevolution/
http://www.estamos.de/blog/wp-admin
http://www.estamos.de/projects/SyncEvolution/Roadmap.html
http://freshmeat.net/projects/syncevolution/
Compiling for Maemo
-------------------
unpack source archive in Scratchbox (for maximum compatibility: use Chinook 4.0
rootstrap; for support of all backends: ensure that the EDS-DBus calendar dev packages
are installed),
DEB_BUILD_OPTIONS=maemo fakeroot dpkg-buildpackage
NOTE: dpkg-buildpackage -rfakeroot does *not* work as it leads to strange problems executing a.out
during the client-src configure.
Maemo EDS-DBus calendar dev packages /etc/apt/source.list:
deb http://maemo.o-hand.com/packages chinook/
Compiling for iPhone
--------------------
Requires iPhone toolchain and a libcurl compiled for the iPhone.
libcurl is ideally configured as small as possible
and statically (to avoid packaging problems):
./configure --prefix=/usr/local/iphone --host=arm-apple-darwin --disable-shared \
--disable-crypto-auth --without-gnutls --without-ssl --without-zlib \
--without-libssh2 --disable-ipv6 --disable-manual --disable-telnet \
--disable-tftp --disable-ldap --disable-file --disable-ftp
manually set HAVE_POSIX_STRERROR_R in lib/config.h
Potential problems with toolchain:
std++ not found: ln -s libstdc++.6.dylib /usr/local/iphone-filesystem/usr/lib/libstdc++.dylib
AddressBook framework must be added to iphone-dev/include/install-headers.sh.in
Compile with curl-config in the PATH:
PATH=/usr/local/iphone/bin/:$PATH ~/projects/SyncEvolution/trunk/configure --host=arm-apple-darwin --with-funambol-src=/home/patrick/projects/native CXXFLAGS=-O0 --disable-ecal --disable-ebook --enable-addressbook --prefix=/usr
PATH=/usr/local/iphone/bin/:$PATH make all
Build a package with:
make distbin BINSUFFIX="iphone"
Compiling for Mac OS X
----------------------
Configuring for development:
<path>/configure --with-funambol-src=<path> \
--enable-addressbook \
--disable-ecal --disable-ebook \
CXXFLAGS="-Wall -Werror -Wno-unknown-pragmas" \
LDFLAGS="-framework Addressbook -framework CoreServices" \
CXXFLAGS=-g \
CFLAGS=-g
Compiling final release:
./configure --enable-addressbook \
--disable-ecal --disable-ebook \
CXXFLAGS="-O -g -arch i386 -arch ppc" \
CFLAGS="-O -g -arch i386 -arch ppc" \
LDFLAGS="-arch i386 -arch ppc -framework Addressbook -framework CoreServices" \
--disable-dependency-tracking
make BINSUFFIX=mac-os-x distbin
Fine-grained memory checking:
MallocStackLogging=1 MallocStackLoggingNoCompact=1 \
MallocScribble=1 MallocPreScribble=1 MallocGuardEdges=1 \
MallocCheckHeapStart=1 MallocCheckHeapEach=100
Debugging
---------
The following packages contain debug information for
relevant libraries on Ubuntu 7.10:
evolution-data-server-dbg libglib2.0-0-dbg evolution-dbg
Normally, syncevolution redirects stderr to its own log file. In
crash scenarios the final error messages may get lost. To debug such
cases, disable redirection by setting the environment variable
SYNCEVOLUTION_DEBUG (value doesn't matter) and capture the output
normally.

View File

@ -1,12 +0,0 @@
This archive contains all files necessary to run SyncEvolution *as
part of the system*.
This means that the files have to be placed in the root file
system. This is necessary because some system services (D-Bus server)
would not be able to find them without further hacks otherwise.
To install the files, unpack them and then run:
sudo cp -a usr/* /usr
*** Warning: *** this bypasses the system's package management. If
there are packages for your system, then better install those.

View File

@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -1,280 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS

View File

@ -1,419 +0,0 @@
include $(top_srcdir)/setup-variables.am
include $(top_srcdir)/autotroll.am
include $(top_srcdir)/build/build.am
AUTOMAKE_OPTIONS = subdir-objects
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4 -I m4-repo ${ACLOCAL_FLAGS}
if COND_CORE
SUBDIRS += $(SYNTHESIS_SUBDIR)
else
SUBDIRS += $(SYNTHESIS_SUBDIR_INCLUDES)
endif
SUBDIRS += .
gdbus_dir = $(top_srcdir)/src/gdbusxx
gdbus_build_dir = src/gdbusxx
disted_docs =
distbin_docs =
man_MANS =
include src/src.am
if COND_CORE
include test/test.am
SUBDIRS += po
disted_docs += README NEWS COPYING $(TEST_README_FILES) test/syncevo-http-server-logging.conf
distbin_docs += $(disted_docs)
dist_doc_DATA += $(disted_docs)
if COND_HTML_README
distbin_docs += README.html
# do not distribute in tarball.
doc_DATA += README.html
endif
if COND_MAN_PAGES
man_MANS += syncevolution.1
endif
endif
DIST_SUBDIRS += po
dist_noinst_DATA += \
HACKING \
LICENSE.txt \
LICENSE.LGPL-21 \
README.rst \
description \
autogen.sh \
Doxyfile \
po/LINGUAS.README
MAINTAINERCLEANFILES += Makefile.in config.h.in config.guess config.sub configure depcomp install-sh ltmain.sh missing mkinstalldirs
TEST_README_FILES = $(wildcard $(top_srcdir)/test/README.*)
# files and file patterns which are not meant to be packaged.
DEV_FILE_PATTERN = $(1)$(2)/include $(1)$(2)/lib/*.so $(1)$(2)/lib/*.a $(1)$(2)/lib/*.la $(1)$(2)/lib/*/*.la $(1)$(2)/lib/pkgconfig
# Exclude syncactivesync.so from bundle package because that needs to
# be packaged separately.
DEV_FILE_PATTERN += $(1)$(2)/lib/syncevolution/backends/syncactivesync.so
# binary distribution as .tar.gz
if COND_DBUS
# when building with D-Bus, we have no choice: the service has to go into /usr
# in order to be found
distbin : $(distbin_docs) INSTALL-tar-gz all
@ [ "$(BINSUFFIX)" ] || (echo "please invoke with e.g. 'make distbin BINSUFFIX=debian-3.1'"; exit 1 )
@ [ "$(prefix)" = "/usr" ] || (echo "please reconfigure with --prefix=/usr"; exit 1 )
rm -rf $(distdir)
$(MAKE) DESTDIR=`pwd`/$(distdir) install
$(MAKE) DESTDIR=`pwd`/$(distdir) installcheck
rm -rf $(call DEV_FILE_PATTERN,$(distdir),/usr)
for i in `find $(distdir) -type d | sort -r`; do rmdir $$i 2>/dev/null || true; done
mkdir -p $(distdir)/usr/share/doc/syncevolution
cp $(srcdir)/INSTALL-tar-gz $(distdir)/INSTALL
cp $(filter-out all, $+) $(distdir)/usr/share/doc/syncevolution
tar zcf $(distdir)-$(BINSUFFIX).tar.gz $(distdir)
rm -rf $(distdir)
else
# without D-Bus, we can simply create an archive with a bin directory
# and everything works
distbin : $(distbin_docs) all
@ [ "$(BINSUFFIX)" ] || (echo "please invoke with e.g. 'make distbin BINSUFFIX=debian-3.1'"; exit 1 )
rm -rf $(distdir)
$(MAKE) prefix=`pwd`/$(distdir) install
@echo removing developer files and empty directories
rm -rf $(call DEV_FILE_PATTERN,$(distdir),/)
for i in `find $(distdir) -type d | sort -r`; do rmdir $$i 2>/dev/null || true; done
cp $(filter-out all, $+) $(distdir)
tar zcf $(distdir)-$(BINSUFFIX).tar.gz $(distdir)
rm -rf $(distdir)
endif
iphone : SyncEvolution.plist
IPHONE_FILENAME = syncevolution-$(VERSION)-iphone.zip
SyncEvolution.plist : SyncEvolution.plist.in $(IPHONE_FILENAME)
$(AM_V_GEN)sed -e 's/__FILENAME__/$(IPHONE_FILENAME)/' \
-e 's/__VERSION__/$(VERSION)/' \
-e 's/__SIZE__/$(shell ls -l $(IPHONE_FILENAME) | sed -e 's/ */ /g' | cut -d ' ' -f 5)/' \
$< >$@
$(IPHONE_FILENAME) : all
rm -rf syncevolution-iphone $@
$(MAKE) DESTDIR=`pwd`/syncevolution-iphone install
rm -rf `ls -1 -d syncevolution-iphone/usr/share/doc/syncevolution/*/spds/sources/* | grep -v addressbook`
perl -pi -e 's;SyncEvolution test #1;;;' \
-e 's;^type = text/(x-)?vcard;type = addressbook;m;' \
syncevolution-iphone/usr/share/doc/syncevolution/*/spds/sources/addressbook/config.txt
cd syncevolution-iphone && zip -r ../$(IPHONE_FILENAME) .
TYPE_deb = -D
TYPE_rpm = -R
# Dependency calculation is intentionally incomplete:
# - don't force dependency on specific EDS libs via backends, their versions change too much (handled via --enable-evolution-compatibility and dynamic loading of the backends)
# - ignore client-test dependencies (because users typically don't run it)
# - ignore backend dependencies (should never prevent installing the bundle)
# - be more flexible about kdelibs5 than dpkg-shlibdeps: it is found as package
# for libkdeui.so.5 and libkdecore.so.5 on Ubuntu Lucid, but after Debian
# Squeeze the package was replaced by individual library packages. On such
# distros, libkdeui5 is what we need.
# - same for kdepimlibs5 -> libakonadi-kde4
# - kdebase-runtime became kde-runtime in Debian Wheezy
REQUIRES_SED_KDE = -e 's/kdelibs5 ([^,]*),/kdelibs5 | libkdeui5,/g' -e 's/kdepimlibs5 ([^,]*),/kdepimlibs5 | libakonadi-kde4,/g' -e 's/kdebase-runtime/kdebase-runtime | kde-runtime/g'
REQUIRES_deb = --requires="'$(shell set -x; cd checkinstall/dist; LD_LIBRARY_PATH=$(distdir)/usr/lib:$(distdir)/usr/lib/syncevolution dpkg-shlibdeps -L$(EXTRA_SHLIBS_LOCAL) --ignore-missing-info -O $$(for i in $$(find $(distdir) -type f -perm /u+x | grep -v -e client-test -e lib/syncevolution/backends/); do if file $$i | grep ELF >/dev/null; then echo $$i; fi; done) | sed $(REQUIRES_SED_KDE) -e 's/[^=]*=//')$(REQUIRES_deb_neon)'"
if NEON_COMPATIBILITY
# --enable-neon-compatibility in src/backends/webdav:
# replace dependencies from linking with hard-coded dlopen() dependencies
REQUIRES_deb_neon = , libneon27 (>= 0.29.0) | libneon27-gnutls (>= 0.29.0)
else
REQUIRES_deb_neon =
endif
VERSION_deb = 1:$(STABLE_VERSION)$(VERSION)
VERSION_rpm = `echo $(VERSION) | sed -e s/-/_/g`
RELEASE = 2
# The package name: BINSUFFIX is used to distinguish binaries
# for different Evolution releases.
PKGNAME=syncevolution$(patsubst %,-%,$(BINSUFFIX))
# This is a list of packages (potentially) provided on estamos.de.
# The current package conflicts with any of them, but not itself.
PKGS = $(addprefix syncevolution-evolution-, 2.6 2.8 2.12)
# When calling checkinstall we cannot install into /tmp
# because any file created there will be excluded: that makes
# sense, because "make install" might create temporary files
# there. The current directory might be in /tmp, so use $HOME.
#
# --replaces is necessary for migrating from syncevolution-evolution-<evover>
# to syncevolution-evolution (as per http://wiki.debian.org/Renaming_a_Package)
#
# When we build shared objects, then conflict with the corresponding
# system libs. The assumption is that the system library is named
# after the lib and its major version, which holds for libsmltk and
# libsynthesis in Debian.
deb rpm : checkinstall/dist/$(distdir) checkinstall/dist/debian/control
(echo "SyncEvolution - synchronizing personal information management data" && cat $(srcdir)/description) >checkinstall/description-pak
echo "/sbin/ldconfig" >checkinstall/postremove-pak
echo "/sbin/ldconfig" >checkinstall/postinstall-pak
conflicts=`ls -1 checkinstall/dist/$(distdir)/usr/lib/*.so.[0123456789] | sed -e 's;.*/;;' -e 's/\.so\.//' -e 's/$$/, /'` && \
tmpdir=`mktemp -d $$HOME/syncevolution.XXXXXXXXXX` && \
trap "rm -rf $$tmpdir" EXIT && \
cd checkinstall && \
fakeroot checkinstall </dev/null \
$(TYPE_$@) \
$(REQUIRES_$@) \
--fstrans=yes \
--install=no \
--strip=no \
--pkgversion=$(VERSION_$@) \
--pkgrelease=$(RELEASE) \
--pkgname=$(PKGNAME) \
--pkgarch=$(PKGARCH) \
--provides=syncevolution \
--replaces="'syncevolution, `echo $(filter-out $(PKGNAME), $(PKGS)) | sed -e 's/ */ (<< 1:0.8.1-2), /g'` (<< 1:0.8.1-2)'" \
--conflicts="'$${conflicts}syncevolution, `echo $(filter-out $(PKGNAME), $(PKGS)) | sed -e 's/ */ (<< 1:0.8.1-2), /g'` (<< 1:0.8.1-2)', libsmltk0, libsyncevolution0, libsynthesis0, syncevolution-common, syncevolution-libs" \
--maintainer="'Patrick Ohly <patrick.ohly@gmx.de>'" \
--pkgsource='http://syncevolution.org' \
--pkggroup='$*' \
--pkggroup='comm' \
cp -r `pwd`/dist/$(distdir)/* / && \
if [ $@ = "rpm" ]; then cp /usr/src/rpm/RPMS/*/${PKGNAME}-${VERSION}-2.*.rpm ..; else mv ${PKGNAME}_${VERSION}*.deb ..; fi
# Pseudo platform .deb packages:
# only depend on PKGNAME = syncevolution-$(BINSUFFIX) (usually syncevolution-bundle).
# Version number is only bumped when changing the packaging rules here.
PLATFORM_DEB_VERSION = $(VERSION_deb)
PLATFORM_DEB_RELEASE = 1
if ENABLE_MODULES
# Not supported anymore.
# deb : syncevolution-kde-deb
deb : syncevolution-evolution-deb
endif
# define which files are relevant for each platform
PLATFORM_FILES_evolution = platformgnome syncecal syncebook
PLATFORM_FILES_kde = platformkde syncakonadi
# Additional parameters for syncevolution-kde/evolution.deb.
# Fake conflicts/replaces works around a bug in CheckInstall,
# which creates empty, invalid entries for those unless
# something is given. For Evolution we expect the caller
# to provide the actual dependencies.
SYNCEVOLUTION_kde_DEB_ARGS = \
--conflicts=syncevolution-foobar \
--replaces=syncevolution-foobar
SYNCEVOLUTION_evolution_DEB_ARGS = \
--conflicts=syncevolution-foobar \
--replaces=syncevolution-foobar
SYNCEVOLUTION_evolution_DEB_REQUIRES = \
, evolution-data-server \
, $(EXTRA_BACKENDS_EBOOK_REQUIRES) \
, $(EXTRA_BACKENDS_ECAL_REQUIRES)
syncevolution-%-deb: checkinstall/dist/$(distdir) checkinstall/dist/debian/control
(echo "SyncEvolution - meta package for $*" && cat $(srcdir)/description) >checkinstall/description-pak
tmpdir=`mktemp -d $$HOME/syncevolution.XXXXXXXXXX` && \
trap "rm -rf $$tmpdir" EXIT && \
cd checkinstall && \
fakeroot checkinstall </dev/null \
$(TYPE_deb) \
--fstrans=yes \
--strip=no \
--nodoc \
--pkgversion=$(PLATFORM_DEB_VERSION) \
--pkgrelease=$(PLATFORM_DEB_RELEASE) \
$(SYNCEVOLUTION_$*_DEB_ARGS) \
--pkgname=syncevolution-$* \
--pkgarch=all \
--requires="'$(shell set -x; cd checkinstall/dist; LD_LIBRARY_PATH=$(distdir)/usr/lib:$(distdir)/usr/lib/syncevolution dpkg-shlibdeps -L$(EXTRA_SHLIBS_LOCAL) --ignore-missing-info -O $$(for i in $(patsubst %,$(distdir)/usr/lib/syncevolution/backends/%.so,$(PLATFORM_FILES_$*)); do if file $$i | grep ELF >/dev/null; then echo $$i; fi; done) | sed $(REQUIRES_SED_KDE) -e 's/[^=]*=//'), $(PKGNAME) (= $(VERSION_deb)-$(RELEASE))$(SYNCEVOLUTION_$*_DEB_REQUIRES)'" \
--maintainer="'Patrick Ohly <patrick.ohly@gmx.de>'" \
--pkgsource='http://syncevolution.org' \
--pkggroup='$*' \
sh -c 'mkdir -p touch /usr/share/doc/syncevolution-$* && echo "SyncEvolution platform pseudo-package for $*" >/usr/share/doc/syncevolution-$*/README' && \
mv syncevolution-$**.deb ..
all_phonies += checkinstall/dist/$(distdir) clean_dist
checkinstall/dist/$(distdir): all
rm -rf $@
$(MAKE) install DESTDIR=`pwd`/$@
$(MAKE) installcheck DESTDIR=`pwd`/$@
rm -rf $(call DEV_FILE_PATTERN,$@,/usr)
clean-local: clean_dist
clean_dist:
rm -rf checkinstall
# required by dpkg-shlibdeps
checkinstall/dist/debian/control:
mkdir -p ${dir $@}
touch $@
# Build "html" inside the build dir, using source files
# from the SyncEvolution source directory and (if built)
# the installed client-api.build directory.
all_phonies += doc clean-html
doc:
rm -rf html
export VERSION="SyncEvolution $(VERSION)"; \
export OUTPUT_DIRECTORY="`pwd`"; \
export PREDEFINED="@BACKEND_DEFINES@ ENABLE_UNIT_TESTS ENABLE_INTEGRATION_TESTS"; \
export CLIENT_LIBRARY="@FUNAMBOL_SUBDIR@/test @FUNAMBOL_SUBDIR@/include "; \
export STRIP_FROM_PATH="$(srcdir) `dirname @FUNAMBOL_SUBDIR@`"; \
cd $(srcdir); doxygen
clean-local: clean-html
clean-html:
rm -rf html
all_dist_hooks += dot_dist_hook
dot_dist_hook:
@if test -d "$(srcdir)/.git"; \
then \
printf '%s' 'Creating ChangeLog...' && \
( cd "$(top_srcdir)" && \
printf '%s\n\n' '# Generated by configure. Do not edit.'; \
$(top_srcdir)/missing --run perl $(top_srcdir)/build/gen-changelog.pl ) > ChangeLog.tmp && \
( mv -f ChangeLog.tmp $(top_distdir)/ChangeLog && \
printf '%s\n' ' done.' ) || \
( rm -f ChangeLog.tmp ; \
printf '%s\n' ' failed.'; \
echo Failed to generate ChangeLog >&2 ); \
else \
echo 'A git checkout is required to generate a ChangeLog.' >&2; \
fi
# Check that no executable or shared object depends on symbols in
# libraries that it does not link against. Unnecessarily linking
# against libs is okay, that can be caught and fixed by
# -Wl,--as-needed. Depends on dpkg-shlibdeps, skipped if that is
# not available.
all_local_installchecks += toplevel_link_check
toplevel_link_check:
set -x; cd $(DESTDIR) && \
mkdir debian && \
touch debian/control && \
trap "rm -rf debian" EXIT && \
files=$$(find $(DESTDIR)/$(prefix) $(DESTDIR)/$(libdir) $(DESTDIR)/$(bindir) $(DESTDIR)/$(libexecdir) -type f -perm /u+x | sort -u) && \
files=$$(for i in $$files; do if file $$i | grep ELF >/dev/null; then echo $$i; fi; done) && \
if ! dpkg-shlibdeps --version; then \
echo "dpkg-shlibdeps not found, skipping link check"; \
elif LD_LIBRARY_PATH=usr/lib:usr/lib/syncevolution dpkg-shlibdeps \
--ignore-missing-info -O $$files \
2>&1 >/dev/null | \
grep -v $(LINK_CHECK_ALLOWED) | \
grep -e "symbol .* found in none of the libraries" \
-e "contains an unresolvable reference to symbol" \
; then \
echo "linking must be fixed"; false; \
else \
echo "linking is okay"; \
fi
# Some exceptions for the link check above (= symbol may be used without linking).
LINK_CHECK_ALLOWED = -e xxxxxxxx
# SySync_ConsolePrintf is expected by libsmltk and has to be provided by caller.
LINK_CHECK_ALLOWED += -e 'SySync_ConsolePrintf.*libsmltk.so'
if NEON_COMPATIBILITY
# libneon is intentionally not linked against, to choose between
# GNUTLS and OpenSSL at runtime.
LINK_CHECK_ALLOWED += -e 'symbol ne_.*syncdav.so'
# Allow undefined references to libstdcxx. This happens when
# adding backends compiled on more recent Linux distros into
# the release archive.
LINK_CHECK_ALLOWED += -e '@GLIBCXX_[^ ]* used by'
endif
# libgdbussyncevo uses some symbols from libsyncevolution without
# linking against it (circular dependency).
LINK_CHECK_ALLOWED += -e SyncEvo.*libgdbussyncevo -e gsignond_pipe_stream_new.*libgdbussyncevo
LINK_CHECK_ALLOWED += $(EXTRA_LINK_CHECK_ALLOWED)
# Be strict about running 'syncevolution' only when not doing
# cross-compilation: in that case, if running 'syncevolution' fails,
# abort the build process. Otherwise proceed with the fallback below,
# which is to keep the "see --sync/source-property ?" placeholders in
# the README.
if COND_CROSS_COMPILING
RUN_SYNCEVOLUTION_CHECK=if ($$?) { return ""; } else { return $$buffer; }
else
RUN_SYNCEVOLUTION_CHECK=die if $$?; return $$buffer;
endif
# patch README.rst properties on-the-fly
if COND_CMDLINE
README.patched.rst: README.rst src/syncevolution
$(AM_V_GEN)perl -e '$$syncfound=0; $$sourcefound=0; $$res=0;' \
-e 'sub run { $$cmd = shift; $$buffer = `env LD_LIBRARY_PATH=src/syncevo/.libs:src/gdbusxx/.libs:src/build-synthesis/src/.libs:$$ENV{LD_LIBRARY_PATH} $$cmd`; $(RUN_SYNCEVOLUTION_CHECK) }' \
-e 'while (<>) {' \
-e 's/^:Version: .*/:Version: $(VERSION)/;' \
-e 's/:Date: .*/":Date: " . `date +%Y-%m-%d`/e;' \
-e 'if (s;(<< see "syncevolution --sync-property ." >>\n);run("src/syncevolution --daemon=no --sync-property ?") || $$1;e) { $$syncfound=1; }' \
-e 'if (s;(<< see "syncevolution --datastore-property ." >>\n);run("src/syncevolution --daemon=no --source-property ?") || $$1;e) { $$sourcefound=1; }' \
-e 'print;' \
-e '}' \
-e 'die "<<sync-property>> tag not in README.rst?!" unless $$syncfound;' \
-e 'die "<<source-property>> tag not in README.rst?!" unless $$sourcefound;' \
-e 'exit $$res;' \
$< >$@
else
# Simpler version without inserting the actual sync and datastore properties.
README.patched.rst: README.rst
$(AM_V_GEN)perl -p \
-e 's/^:Version: .*/:Version: $(VERSION)/;' \
-e 's/:Date: .*/":Date: " . `date +%Y-%m-%d`/e;' \
$< >$@
endif
CLEANFILES += README.patched.rst
# produce man pages
syncevolution.1: README.patched.rst
$(AM_V_GEN)$(RST2MAN) --exit-status=3 $< >$@
CLEANFILES += syncevolution.1
# README is the traditional name in the distribution,
# continue using it instead of README.rst.
# TODO: replace some of the RST syntax
README: README.patched.rst
$(AM_V_GEN)cp $< $@
CLEANFILES += README
# The README.html is also used on syncevolution.org as "Usage" page,
# therefore we must use <h3> headers and lower to fit into the page.
README.html: README.patched.rst
$(AM_V_GEN)$(RST2HTML) --initial-header-level=3 --exit-status=3 $< >$@
CLEANFILES += README.html
.PHONY: $(all_phonies) ;
installcheck-local: $(all_local_installchecks) ;
dist-hook: $(all_dist_hooks)
install-exec-hook: $(all_install_exec_hooks)
uninstall-hook: $(all_uninstall_hooks)
# Can be overridden during make invocation to inject additional commands.
CREATE_EXTRA_BACKENDS=true
# Force sequential installation. This is a workaround for relinking failures
# during concurrent distcheck (a backend was relinked against not yet installed
# libsyncevolution.la).
#
# Also used to add additional backends. EXTRA_BACKENDS must already contain
# renamed files, by convention using -2.so, -3.so, etc as suffix instead of the
# base file's .so.
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am
@$(MAKE) $(AM_MAKEFLAGS) install-data-am
$(CREATE_EXTRA_BACKENDS) $(DESTDIR)/$(BACKENDS_DIRECTORY)
for i in $(EXTRA_BACKENDS); do $(INSTALL) $$i $(DESTDIR)/$(BACKENDS_DIRECTORY)/; done
# Necessary for "make distcheck": must not leave files behind.
uninstall-local:
rm -f $(DESTDIR)/$(BACKENDS_DIRECTORY)/*-[0-9].so
.DELETE_ON_ERROR:

9190
NEWS

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +0,0 @@
Diagnostic Log and Trace
========================
Diagnostic Log and Trace (DLT) is a logging mechanism defined and
implemented by GENIVI: http://projects.genivi.org/diagnostic-log-trace/
SyncEvolution optionally supports DLT as follows:
* syncevo-dbus-server, syncevo-dbus-helper and syncevo-local-sync can
log to DLT. Operations with "syncevolution --daemon=no" never use
DLT.
* Each of the three processes uses a different application ID. By
default, these IDs are "SYNS", "SYNH", "SYNL". These default can be
changed via configure options. All processes use just one context,
with the fixed ID "SYNC".
* syncevo-dbus-helper and syncevo-local-sync only run occasionally.
This makes is hard to adjust their log levels, for example via the
dlt-viewer, because the processes and their contexts are only shown
(known?) while the processes run. To work around this, the initial
log level of these two helpers are inherited from the
log level of the "SYNC" context in syncevo-dbus-helper.
* That log level defaults to "WARN", which ensures that normal runs
produce no output.
* To enable DLT support during compilation, use
"--enable-dlt" and "--with-dlt-syncevolution=SYNS,SYNH,SYNL" where SYNS/H/L
are the actual application IDs.
* To enable DLT support at runtime, run syncevo-dbus-server with
"--dlt". Logging to syslog should be disabled with "--no-syslog".
* The hierarchical log from libsynthesis gets flattened into a flat
stream of messages and no syncevolution-log.html files are written.

View File

@ -1,27 +0,0 @@
Some of the advanced features of SyncEvolution depend on optional
packages. In addition to the more obvious dependencies of the
backends there are more subtle dependencies:
- for good time zone support, libsynthesis must have access to
either libical or libecal
- direct sync with phones depends on bluez and openobex
- GNOME Bluetooth Panel needs libgnome-bluetooth-dev *AND*
--enable-gnome-bluetooth-panel
- either glib or libnss should be available, so that
SyncEvolution can use SHA-256 hashes instead of a
weaker built-in algorithm for hashes in the database dump
.ini files
- libnotify is needed by the syncevo-dbus-server, although
--disable-notify can be used to avoid that.
- Localization data is shared between sync-ui and syncevo-dbus-server
and thus needs to be packaged with the core SyncEvolution.
- to enable CalDAV/CardDAV:
- use --enable-dav
- needs libneon[-gnutls].pc (use gnutls version, if available,
but make sure that it is >= 0.29.5, which has this patch:
http://lists.manyfish.co.uk/pipermail/neon/2010-November/001294.html)
- ensure that one of the following commands is available at runtime:
adnshost, host, nslookup
- as of SyncEvolution >= 1.3 rst2html tool should be made as a build
requirement, because README.html is optionally generated during build instead
of being distributed.

1343
README.rst

File diff suppressed because it is too large Load Diff

View File

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bundleIdentifier</key>
<string>de.estamos.iphone.SyncEvolution</string>
<key>name</key>
<string>SyncEvolution</string>
<key>version</key>
<string>__VERSION__</string>
<key>location</key>
<string>http://www.estamos.de/iphone/zips/__FILENAME__</string>
<key>size</key>
<string>__SIZE__</string>
<key>description</key>
<string>A command line tool to synchronize the address book via SyncML.</string>
<key>url</key>
<string>http://www.estamos.de/projects/SyncML/</string>
<key>scripts</key>
<dict>
<key>install</key>
<array>
<array>
<string>CopyPath</string>
<string>usr/bin/syncevolution</string>
<string>/usr/bin/syncevolution</string>
</array>
<array>
<string>CopyPath</string>
<string>usr/bin/synccompare</string>
<string>/usr/bin/synccompare</string>
</array>
<array>
<string>SetStatus</string>
<string>Run 'syncevolution &lt;server&gt;' to synchronize.</string>
</array>
<array>
<string>IfNot</string>
<array>
<array>
<string>ExistsPath</string>
<string>/var/root/.sync4j</string>
</array>
</array>
<array>
<array>
<string>CopyPath</string>
<string>usr/share/doc/syncevolution/</string>
<string>/var/root/.sync4j/evolution</string>
</array>
</array>
</array>
</array>
<key>uninstall</key>
<array>
<array>
<string>RemovePath</string>
<string>/usr/bin/syncevolution</string>
</array>
<array>
<string>RemovePath</string>
<string>/usr/bin/synccompare</string>
</array>
</array>
</dict>
</dict>
</plist>

View File

@ -1,31 +0,0 @@
#!/bin/sh
set -e
# wipe out temporary autotools files, necessary
# when switching between distros and SyncEvolution releases
rm -rf aclocal.m4 m4 autom4te.cache config.guess config.sub config.h.in configure depcomp install-sh ltmain.sh missing configure.in src/Makefile.am
# intltoolize fails to copy its macros unless m4 exits
mkdir m4
#env GEN_AUTOTOOLS_SET_VERSION=1 sh ./gen-autotools.sh
glib-gettextize --force --copy
intltoolize --force --copy --automake
autoreconf -v -i -f -W all -W no-portability -W no-obsolete
#libtoolize -c
#glib-gettextize --force --copy
#intltoolize --force --copy --automake
#aclocal -I m4 -I m4-repo
#autoheader
#automake -a -c -Wno-portability
#autoconf
# This hack is required for the autotools on Debian Etch.
# Without it, configure expects a po/Makefile where
# only po/Makefile.in is available. This patch fixes
# configure so that it uses po/Makefile.in, like more
# recent macros do.
#perl -pi -e 's;test ! -f "po/Makefile";test ! -f "po/Makefile.in";; s;mv "po/Makefile" "po/Makefile.tmp";cp "po/Makefile.in" "po/Makefile.tmp";;' configure

View File

@ -1,101 +0,0 @@
# Makerules.
# This file is part of AutoTroll.
# Copyright (C) 2006, 2007, 2009, 2010 Benoit Sigoure.
#
# AutoTroll is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# In addition, as a special exception, the copyright holders of AutoTroll
# give you unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the macros of
# AutoTroll. You need not follow the terms of the GNU General Public License
# when using or distributing such scripts, even though portions of the text of
# AutoTroll appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes AutoTroll.
#
# This special exception to the GPL applies to versions of AutoTroll
# released by the copyright holders of AutoTroll. Note that people who make
# modified versions of AutoTroll are not obligated to grant this special
# exception for their modified versions; it is their choice whether to do so.
# The GNU General Public License gives permission to release a modified version
# without this exception; this exception also makes it possible to release a
# modified version which carries forward this exception.
# ------------- #
# DOCUMENTATION #
# ------------- #
# See autotroll.m4 :)
# --- #
# MOC #
# --- #
%.moc.cpp: %.hpp
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
%.moc.cpp: %.hh
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
%.moc.cpp: %.h
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
%moc.cc: %.hpp
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
%.moc.cc: %.hh
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
%.moc.cc: %.h
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
%.moc.cxx: %.hpp
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
%.moc.cxx: %.hh
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
%.moc.cxx: %.h
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
%.moc.C: %.hpp
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
%.moc.C: %.hh
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
%.moc.C: %.h
$(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
# --- #
# UIC #
# --- #
%.ui.hpp: %.ui
$(AM_V_GEN)$(UIC) $< -o $@
%.ui.hh: %.ui
$(AM_V_GEN)$(UIC) $< -o $@
%.ui.h: %.ui
$(AM_V_GEN)$(UIC) $< -o $@
# --- #
# RCC #
# --- #
%.qrc.cpp: %.qrc
$(AM_V_GEN)$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
%.qrc.cc: %.qrc
$(AM_V_GEN)$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
%.qrc.cxx: %.qrc
$(AM_V_GEN)$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
%.qrc.C: %.qrc
$(AM_V_GEN)$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@

View File

@ -1,14 +0,0 @@
dist_noinst_SCRIPTS += build/gen-git-version.sh \
build/source2html.py
EXTRA_DIST += \
build/export-foreign-git.sh \
build/export-synthesis-xml.sh \
build/gen-backends-am.sh \
build/gen-backends.sh \
build/gen-changelog.pl \
build/gen-linguas.sh \
build/import-foreign-git.sh \
build/import-gdbus.sh \
build/import-synthesis-xml.sh \
build/update-copyrights.sh

View File

@ -1,46 +0,0 @@
#! /bin/sh
#
# Exports changes made to files so that the upstream
# maintainers can import the changes into their own
# git repo. All changes which are not marked as
# being from the remote git repo with a "commit ID"
# comment are exported.
#
# Result are numbered .patch files, as with "git format-patch".
#
# Run this inside the top level of a clean
# syncevolution git repository with the following
# parameters:
# - file system path for foreign git repository
# - a remote directory into which the source file(s) are to be placed,
# preserving all remaining directories after stripping
# - common local directory to be stripped from source file(s)
# - one or more source file names, with paths relative to the
# local repository
set -e
set -x
FOREIGN="$1"
shift
TARGET_DIR="$1"
shift
SOURCE_DIR="$1"
shift
SOURCE="$@"
FOREIGN_NAME=`basename $FOREIGN`
# iterate over commits involving the relevant files,
# starting with oldest one
counter=1
for commit in `(git log --format=format:%H $SOURCE; echo) | perl -e 'print reverse(<>)'`; do
if git log -n 1 $commit | grep -q "$FOREIGN_NAME commit ID"; then
# nothing to do, is in original git repo
true
else
file=`printf %03d $counter`-`git log -n 1 --format=format:%f $commit`.patch
counter=`expr $counter + 1`
git log -n 1 -p --stat --format=email $commit $SOURCE | perl -p -e "s;$SOURCE_DIR;$TARGET_DIR;g;" -e "s/^index [0-9a-f]*\.\.[0-9a-f]* [0-9]*\n$//;" >$file
fi
done

View File

@ -1,18 +0,0 @@
#! /bin/sh
#
# Run this inside the top level of a clean
# syncevolution git repository. Pass the path
# to a gdbus repository (default: ../libsynthesis).
#
# The script generates .patch files for all changes
# made in the current branch to files which are
# shared with gdbus. The resulting files can
# be imported with "git am".
set -e
set -x
path="${1:-../libsynthesis}"
files="`((cd $path/src/sysync_SDK && find configs \( -name '*.xml' -o -name 'update-samples.pl' -o -name README \) -a \! \( -name 'sync*_sample_config.xml' -o -name sunbird_client.xml \)) && (cd src/syncevo && find configs -name '*.xml' -o name README)) | sort -u | sed -e 's;^;src/syncevo/;'`"
`dirname $0`/export-foreign-git.sh "$path" src/sysync_SDK src/syncevo $files

View File

@ -1,38 +0,0 @@
#!/bin/sh
amfile='src/backends/backends.am'
tmpfile="$amfile.$$"
rm -f "$tmpfile"
touch "$tmpfile"
BACKENDS="`echo src/backends/*/configure-sub.in | sed -e 's%/configure-sub\.in%%g' | sort`"
BACKEND_REGISTRIES="`echo src/backends/*/*Register.cpp | sort`"
tf()
{
echo "$1" >>"$tmpfile"
}
# tf '# This is a stupid workaround for an absolute path in SYNCEVOLUTION_LIBS.'
# tf '# See AUTOTOOLS-TODO for details.'
# tf '@SYNCEVOLUTION_LIBS@: src/syncevo/libsyncevolution.la ; @true'
# tf ''
tf "BACKENDS = $BACKENDS"
tf ''
tf "BACKEND_REGISTRIES = $BACKEND_REGISTRIES"
tf ''
tf '# backend includes'
for backend in $BACKENDS
do
name=`echo "$backend" | sed -e 's%src/backends/%%'`
tf "include \$(top_srcdir)/$backend/$name.am"
done
if test ! -f "$amfile" || ! cmp -s "$amfile" "$tmpfile"
then
mv "$tmpfile" "$amfile"
else
rm -f "$tmpfile"
fi

View File

@ -1,24 +0,0 @@
#! /bin/sh
#
# This script prints all configure-sub.in in src/backends
# directory to standard output. This is meant to be used
# from m4_esyscmd inside configure.ac.
#
# The motivation for this non-standard approach was that
# it allows adding new backends without touching core
# files, which should have simplified the development of
# out-of-tree backends. Now git pretty much removes
# the need for such tricks, but it's still around.
tmpfile="configure.in.$$"
rm -f "$tmpfile"
for sub in src/backends/*/configure-sub.in
do
echo "# vvvvvvvvvvvvvv $sub vvvvvvvvvvvvvv" >>"$tmpfile"
cat "$sub" >>"$tmpfile"
echo "# ^^^^^^^^^^^^^^ $sub ^^^^^^^^^^^^^^" >>"$tmpfile"
echo >>"$tmpfile"
done
cat "$tmpfile"
rm -f "$tmpfile"

View File

@ -1,148 +0,0 @@
#!/usr/bin/perl
use strict;
use warnings;
use Text::Wrap;
use Pod::Usage;
use Getopt::Long;
use POSIX qw( strftime );
$Text::Wrap::columns = 74;
# git commands
our $GIT_LOG = 'git log --pretty=format:"%at|%an|<%ae>|%h|%s"';
our $GIT_DIFF_TREE = 'git diff-tree --name-only -r';
my $help;
my $result = GetOptions(
"h|help" => \$help,
);
pod2usage(1) if $help;
our $revs = $ARGV[0] or undef;
my $log_cmd = $GIT_LOG;
$log_cmd .= ' ' . $revs if defined $revs;
open my $git_log, '-|', $log_cmd
or die("Unable to invoke git-log: $!\n");
while (<$git_log>) {
my $log_line = $_;
chomp($log_line);
my ($timestamp, $committer, $email, $commit_hash, $subject) =
split /\|/, $log_line, 5;
# use a shorter date line
my $date = strftime("%Y-%m-%d", localtime($timestamp));
print STDOUT $date, " ", $committer, " ", $email, "\n\n";
# list the file changes
if ($commit_hash) {
my $diff_cmd = $GIT_DIFF_TREE . " " . $commit_hash;
open my $git_diff, '-|', $diff_cmd
or die("Unable to invoke git-diff-tree: $!\n");
while (<$git_diff>) {
my $diff_line = $_;
chomp($diff_line);
next if $diff_line =~ /^$commit_hash/;
print STDOUT "\t* ", $diff_line, ":\n";
}
close($git_diff);
}
else {
print STDOUT "\t* *:\n";
}
print STDOUT "\n";
# no need to use the full body, the subject will do
if (defined $subject) {
$subject =~ s/\t//g;
print STDOUT wrap("\t", "\t", $subject), "\n";
}
print STDOUT "\n";
}
close($git_log);
0;
__END__
=pod
=head1 NAME
gen-changelog - Creates a ChangeLog from a git log
=head1 SYNOPSIS
gen-changelog <options>
=head1 DESCRIPTION
B<gen-changelog> is a small Perl script that reads the output of git log
and creates a file using the GNU ChangeLog format. It should be used when
creating a tarball of a project, to provide a full log of the changes to
the users.
=head1 OPTIONS
=over 4
=item -h, --help
Prints a brief help message
=item E<lt>sinceE<gt>..E<lt>untilE<gt>
Show only commits between the named two commits. When either E<lt>sinceE<gt>
or E<lt>untilE<gt> is omitted, it defaults to `HEAD`, i.e. the tip of the
current branch. For a more complete list of ways to spell E<lt>sinceE<gt>
and E<lt>untilE<gt>, see "SPECIFYING REVISIONS" section in git rev-parse.
=back
=head1 CAVEATS
B<gen-changelog> is very simple and should be tweaked to fit your use case.
It does fit the author's, but he'll gladly accept patches and requests.
=head1 EXAMPLES
=over 4
=item Print the full log and redirect it to a file
gen-changelog > ChangeLog
=item Print the changelog of the local changes
gen-changelog origin..HEAD
=back
=head1 AUTHOR
Emmanuele Bassi E<lt>ebassi (at) gnome.orgE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2009 Emmanuele Bassi
This program is free software. It can be distributed and/or modified under
the terms of Perl itself. See L<perlartistic> for further details.
=cut

View File

@ -1,105 +0,0 @@
#! /bin/sh
# This scripts takes current version as a parameter, generates the version
# and prints it to standard output - this way it is usable with m4_esyscmd,
# which can be used inside AC_INIT. The script will print the passed version if
# the following checks pass:
# - SyncEvolution source is clean (git status reports
# no "modified" files or "untracked" files, or the source
# is not in git at all)
# - the source is tagged with the version of SyncEvolution
# (git describe --tags HEAD reports something which matches,
# for example syncevolution-1-0-beta-2a for 1.0beta2a)
# - same for libsynthesis, if the SYNTHESISSRC env variable
# is set
#
# If these tests fail, the version is extended:
# +<yyyymmdd>+SE+<status>+SYSYNC+<status>
# <yyyymmdd> = date
# <status> = <hash>[+unclean]
# <hash> = shortened hash from describe (for example, 1040ffd)
# +unclean = source was dirty
set -e
version="$1"
checksource ()
{
dir=$1
force=$2
dirty=
if [ ! -d $dir/.git ]; then
return
fi
cur=`pwd`
cd $dir
if git status | grep -e "modified:" -e "Untracked files:" -q; then
dirty='+unclean'
fi
describe=`git describe --tags`
hash=`cat .git/HEAD | sed -e 's/ref: //'`
if [ "`echo $hash | sed -e 's/[0-9a-fA-F]//g'`" ] ; then
# contains other characters than simple hex, probably a reference:
# convert to abbreviated hash
hash=`git show-ref --abbrev --hash --verify $hash`
else
# already a hash, abbreviate
hash=`echo $hash | sed -e 's/\(......\).*/\1/'`
fi
if git show-ref --tags | grep -q $hash; then
# there is at least one tag matching HEAD;
# pick the most recent one (based on lexical sorting)
exact=1
tag=`git show-ref --tags | grep $hash | sort | tail -1 | sed -e 's;.*refs/tags/;;'`
else
# Detect -<number of changes>-g<hash> suffix added when tag is older than HEAD.
# Remove suffix to get tag (doesn't matter if we do not pick
# the most recent one).
exact=
tag=`echo $describe | sed -e 's/-[0123456789]*-g.*//'`
fi
simpletag=$tag
# Hyphens between numbers in the tag are dots in the version
# and all other hyphens can be removed.
while true; do
tmp=`echo $simpletag | sed -e 's/\([0123456789]\)-\([0123456789]\)/\1.\2/'`
if [ $tmp = $simpletag ]; then
break
else
simpletag=$tmp
fi
done
simpletag=`echo $simpletag | sed -e 's/-//g'`
if [ "$dirty" ] || [ "$force" ]; then
# previous check failed, always print hash
echo $hash$dirty
elif [ "$exact" ] &&
echo $simpletag | grep -q "syncevolution${version}\$"; then
true
else
echo $hash$dirty
fi
cd $cur
}
versionsuffix=''
syncevo=`checksource .`
if [ "$SYNTHESISSRC" ]; then
sysync=`checksource $SYNTHESISSRC $syncevo`
fi
# run check again, to get hash when only libsynthesis failed
syncevo=`checksource . $sysync`
if [ "$syncevo" ]; then
versionsuffix="+SE+$syncevo"
fi
if [ "$sysync" ]; then
versionsuffix="$versionsuffix+SYSYNC+$sysync"
fi
if [ "$versionsuffix" ]; then
versionsuffix="+`date +%Y%m%d`$versionsuffix"
fi
# using printf, because echo -n is not portable. hopefully printf is.
printf %s "$version$versionsuffix"

View File

@ -1,15 +0,0 @@
#!/bin/sh -e
lings_new="LINGUAS.new.$$"
lings="LINGUAS"
# create LINGUAS file: every .po is included
cd po
ls -1 *.po | sort -u | sed -e 's/.po$//' >"$lings_new"
if test -f "$lings" && cmp -s "$lings" "$lings_new"
then
rm "$lings_new"
else
mv "$lings_new" "$lings"
fi

View File

@ -1,84 +0,0 @@
#! /bin/sh
#
# Run this inside the top level of a clean
# syncevolution git repository with the following
# parameters:
# - file system path for foreign git repository
# - name of local branch for importing changes
# - a local directory into which the source file(s) is to be placed,
# preserving all remaining directories after stripping
# - number of directory levels to strip from source file(s)
# - one or more source file names, with paths relative to the
# foreign repository
set -e
set -x
FOREIGN="$1"
shift
TARGET_BRANCH="$1"
shift
TARGET_DIR="$1"
shift
SOURCE_LEVELS="$1"
shift
SOURCE="$@"
FOREIGN_NAME=`basename $FOREIGN`
TARGET=`for i in $SOURCE; do echo $i | perl -p -e "s;([^/]*/){$SOURCE_LEVELS};$TARGET_DIR/;"; done`
PATCH=`mktemp`
MSG=`mktemp`
git checkout $TARGET_BRANCH
# find lastest imported commit:
# import everything unless one of the files already exists,
# in which case we assume that all of the others also exist
revisions=master
for i in $TARGET; do
if [ -f $i ]; then
revisions="`git log -n 1 -- $TARGET | tail -1`..master"
break
fi
done
count=`(cd "$FOREIGN" && git log -p $revisions -- $SOURCE) | grep '^commit' | wc -l`
# iterate over all commits from oldest to newest
i=1
while [ $i -le $count ]; do
# get complete patch
(cd "$FOREIGN" && git log -p --max-count=1 --skip=`expr $count - $i` $revisions -- $SOURCE) >$PATCH
# get just the commit message
(cd "$FOREIGN" && git log --max-count=1 --skip=`expr $count - $i` $revisions -- $SOURCE) >$MSG
# apply patch to file: enter directory and skip pathname from patch
if ! (cd $TARGET_DIR && patch -p`expr $SOURCE_LEVELS + 1` <$PATCH); then
echo "patch failed in $TARGET_DIR: patch -p`expr $SOURCE_LEVELS + 1` <$PATCH"
echo "continue? yes/no [no]"
read yesno
if [ "$yesno" != "yes" ]; then
exit 1
fi
fi
# now commit it (can't use commit because we want to preserve date):
# - add to index
for t in $TARGET; do
[ -f $t ] && git add $t
done
# - write index
id=`git write-tree`
# - find information for commit and commit
parent=`git show-ref --heads --hash $TARGET_BRANCH`
origid=`grep ^commit $MSG | sed -e 's/commit //'`
GIT_AUTHOR_NAME="`grep ^Author: $MSG | sed -e 's/Author: \(.*\) <.*/\1/'`"
GIT_AUTHOR_EMAIL="`grep ^Author: $MSG | sed -e 's/Author: [^<]*<\([^>]*\)>/\1/'`"
GIT_AUTHOR_DATE="`grep ^Date: $MSG | sed -e 's/Date: *//'`"
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
id=`(grep '^ ' $MSG | sed -e 's/^ *//' && echo && echo "$FOREIGN_NAME commit ID:" && echo $origid) | git commit-tree $id -p $parent`
# - update branch and check it out
git update-ref refs/heads/$TARGET_BRANCH $id
git reset --hard $TARGET_BRANCH
# next patch
i=`expr $i + 1`
done

View File

@ -1,27 +0,0 @@
#! /bin/sh
#
# Run this inside the top level of a clean
# syncevolution git repository. Pass the path
# to a gdbus repository (default: ../libgdbus).
#
# The script switches to the "gdbus" branch
# in the syncevolution repo and then merges all
# patches committed to the "master" branch in the
# gdbus repo, updating the "gdbus" branch
# as it goes along.
#
# The original commit IDs are recorded
# at the end of each commit message.
set -e
set -x
`dirname $0`/import-foreign-git.sh "${1:-../libgdbus}" gdbus src/gdbus 1 \
src/debug.c \
src/debug.h \
src/gdbus.h \
src/mainloop.c \
src/Makefile.am \
src/object.c \
src/watch.c

View File

@ -1,23 +0,0 @@
#! /bin/sh
#
# Run this inside the top level of a clean
# syncevolution git repository. Pass the path
# to a synthesis repository (default: ../libsynthesis).
#
# The script switches to the "synthesis-xml-fragments" branch
# in the syncevolution repo and then merges all
# patches committed to the "master" branch in the
# synthesis repo, updating the "synthesis" branch
# as it goes along.
#
# The original commit IDs are recorded
# at the end of each commit message.
set -e
set -x
path="${1:-../libsynthesis}"
files="`cd $path && find src/sysync_SDK/configs/ \( -name '*.xml' -o -name 'update-samples.pl' -o -name README \) -a \! \( -name 'sync*_sample_config.xml' -o -name sunbird_client.xml \)`"
`dirname $0`/import-foreign-git.sh "${1:-../libsynthesis}" synthesis-xml-fragments src/syncevo/configs 3 $files

View File

@ -1,59 +0,0 @@
#!/usr/bin/python3
"""
Converts source code (first parameter, can be - for stdin) to HTML
(stdout), using pygments if installed, otherwise simple text
manipulation without syntax highlighting. In both cases the output
will have "True-<number>" as anchors for each line.
"""
import sys
filename = sys.argv[1]
if filename == '-':
code = sys.stdin.read()
else:
code = open(filename).read()
out = sys.stdout
try:
import pygments
import pygments.lexers
from pygments.formatters import HtmlFormatter
if filename == '-':
lexer = pygments.lexers.guess_lexer(code)
else:
lexer = pygments.lexers.guess_lexer_for_filename(filename, code)
formatter = HtmlFormatter(full=True, linenos=True, lineanchors=True)
pygments.highlight(code, lexer, formatter, out)
except:
import cgi
print("source2html.py failed with pygments:", sys.exc_info(), file=sys.stderr)
print("falling back to internal code", file=sys.stderr)
out.write('''<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=None">
<style type="text/css">
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
body .hll { background-color: #ffffcc }
body .hll { background-color: #ffffcc }
body { background: #f8f8f8; }
</style>
</head>
<body>
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>''')
lines = code.split('\n')
for line in range(1, len(lines)):
out.write('%4d\n' % line)
out.write('%4d' % len(lines))
out.write('</pre></div></td><td class="code"><div class="highlight"><pre>')
for lineno, line in enumerate(lines):
out.write('<a name="True-%d"></a>%s\n' % (lineno + 1, cgi.escape(line)))
out.write('''</pre></div>
</td></tr></table></body>
</html>''')

View File

@ -1,65 +0,0 @@
#! /bin/sh
#
# Usage: update-copyrights.sh "author" <files/dirs>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) version 3.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
currentyear=`date +%Y`
oldyear=`expr $currentyear - 1`
export currentyear oldyear author
addcopyright () {
file="$1"
author="$2"
if grep -w "Copyright.*$currentyear.*$author" $file >/dev/null; then
# done
true
elif grep -w "Copyright.*-$oldyear $author" $file >/dev/null; then
# replace end year
perl -pi -e 's/-$ENV{oldyear} $ENV{author}/-$ENV{currentyear} $ENV{author}/' $file
echo updated: $author: $file
elif grep -w "Copyright.*$oldyear $author" $file >/dev/null; then
# add consecutive year
perl -pi -e 's/$ENV{oldyear} $ENV{author}/$ENV{oldyear}-$ENV{currentyear} $ENV{author}/' $file
echo updated: $author: $file
elif grep -w "Copyright.*$author" $file >/dev/null; then
# add separate year
perl -pi -e 's/(Copyright.*) $ENV{author}/$1, $ENV{currentyear} $ENV{author}/' $file
echo updated: $author: $file
elif grep -w "Copyright" $file >/dev/null; then
# add new line after the last copyright line
# -i doesn't work with reading all lines?
perl -e '$_ = join ("", <>); s/(.*)((^[ *#]*Copyright)[^\n]*)/$1$2\n$3 (C) $ENV{currentyear} $ENV{author}/ms; print;' \
$file >$file.bak && mv $file.bak $file && echo added: $author: $file ||
rm $file.bak && echo no copyright: $author: $file
else
echo skipped: $author: $file
fi
}
for file in `git ls-files "$@"`; do
git log --since=2009-01-01 --pretty='format:%ai: %an <%ae>' $file |
grep ^$currentyear |
sed -e 's/.*: //' |
sort -u |
while read author; do
case $author in *intel.com*)
author="Intel Corporation"
esac
addcopyright "$file" "$author"
done
done

View File

@ -1,15 +0,0 @@
#! /bin/sh
#
# Download current version of all our docbook XSL files.
# Handles download errors by retrying. Does not handle
# new or removed files, that needs to be done manually.
set -x
cd `dirname $0`/xsl
for i in `find * -type f`; do
for attempt in `seq 0 10`; do
if wget -O $i.tmp http://docbook.sourceforge.net/release/xsl/current/$i && mv $i.tmp $i; then
break
fi
done
done

View File

@ -1,48 +0,0 @@
Copyright
---------
Copyright (C) 1999-2007 Norman Walsh
Copyright (C) 2003 Jiří Kosek
Copyright (C) 2004-2007 Steve Ball
Copyright (C) 2005-2008 The DocBook Project
Copyright (C) 2011-2012 O'Reilly Media
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the ``Software''), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Except as contained in this notice, the names of individuals
credited with contribution to this software shall not be used in
advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization
from the individuals in question.
Any stylesheet derived from this Software that is publically
distributed will be identified with a different name and the
version strings in any derived Software will be changed so that
no possibility of confusion between the derived package and this
Software will exist.
Warranty
--------
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER
CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Contacting the Author
---------------------
The DocBook XSL stylesheets are maintained by Norman Walsh,
<ndw@nwalsh.com>, and members of the DocBook Project,
<docbook-developers@sf.net>

View File

@ -1,173 +0,0 @@
----------------------------------------------------------------------
README file for the DocBook XSL Stylesheets
----------------------------------------------------------------------
$Id: README 9397 2012-06-02 22:35:07Z bobstayton $
These are XSL stylesheets for transforming DocBook XML document
instances into various output formats.
This README file provides only very minimal documentation on using
the stylesheets. For more complete information, see Bob Stayton's
book "DocBook XSL: The Complete Guide", available online at:
http://www.sagehill.net/docbookxsl/
----------------------------------------------------------------------
Installation
----------------------------------------------------------------------
See the INSTALL file for information about installing this release.
----------------------------------------------------------------------
How to use the stylesheets
----------------------------------------------------------------------
The base canonical URI for these stylesheets is:
http://docbook.sourceforge.net/release/xsl/current/
You call any of the stylesheets in this distribution by doing one
of the following:
- Use the base canonical URI in combination with one of the
pathnames below. For example, for "chunked" HTML, output:
http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
If your system has a working XML Catalog or SGML Catalog setup
(most Linux systems do), then that URI will automatically be
resolved and replaced with a local pathname on your system.
- Use a "real" local system base path in combination with one of
the pathnames below. For example, for "chunked" HTML, output:
/usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl
To transform documents created with the standard DocBook
schema/DTD, use one of the following stylesheets:
fo/docbook.xsl - for XSL-FO
html/docbook.xsl - for HTML (as a single file)
html/chunk.xsl - for HTML (chunked into multiple files)
html/onechunk.xsl - for HTML (chunked output in single file)
xhtml/*.xsl - for XHTML versions of the above
xhtml-1_1/*.xsl - for XHTML 1.1 versions of the above
xhtml5/*.xsl - for XHTML5 versions of the above
epub/docbook.xsl - for .epub version 2 and earlier
epub3/docbook.xsl - for .epub version 3 and later
htmlhelp/htmlhelp.xsl - for HTML Help
javahelp/javahelp.xsl - for JavaHelp
eclipse/eclipse.xsl - for Eclipse Help
manpages/docbook.xsl - for groff/nroff man pages
*/profile-* - single-pass-profiling versions of all above
roundtrip/*.xsl - for DocBook to WordML, etc., to DocBook
assembly/assemble.xsl - converts an assembly into a DocBook document
assembly/topic-maker-chunk.xsl
- converts a DocBook document into an assembly
with topic files.
To transform documents created with the DocBook Slides schema/DTD,
use one of the following stylesheets:
slides/html/*.xsl - for HTML slides of various kinds
slides/xhtml/*.xsl - for XHTML slides of various kinds
slides/fo/plain.xsl - for XSL-FO slides
slides/htmlhelp/... - for HTML Help slides
To transform documents created with the DocBook Website
schema/DTD, use one of the following stylesheets:
website/website.xsl - for non-tabular, non-chunked output
website/tabular.xsl - for tabular, non-chunked output
website/chunk-* - for chunked output
To generate a titlepage customization layer from a titlepage spec:
template/titlepage.xsl
For fo titlepage customizations, set the stylesheet parameter named 'ns'
to 'http://www.w3.org/1999/XSL/Format' when using this stylesheet.
For xhtml titlepage customizations, set the stylesheet parameter named 'ns'
to 'http://www.w3.org/1999/xhtml' when using this stylesheet.
For details about creating titlepage spec files and generating and
using titlepage customization layers, see "DocBook XSL: The
Complete Guide" <http://www.sagehill.net/docbookxsl/>
----------------------------------------------------------------------
Manifest
----------------------------------------------------------------------
AUTHORS contact information
BUGS about known problems
COPYING copyright information
INSTALL installation instructions
README this file
RELEASE.* per-release cumulative summaries of user-visible changes
TODO about planned features not yet implemented
VERSION release metadata, including the current version
number (note that the VERSION file is an XSL stylesheet)
NEWS changes since the last public release (for a cumulative list of
changes, see the ChangeHistory.xml file)
assembly/ for making and processing DocBook assemblies.
common/ code used among several output formats (HTML, FO, manpages,...)
docsrc/ documentation sources
eclipse/ for producing Eclipse Help
epub/ for producing .epub version 2.
epub3/ for producing .epub version 3 and beyond.
extensions/ DocBook XSL Java extensions
fo/ for producing XSL-FO
highlighting files used for adding source-code syntax highlighting in output
html/ for producing HTML
htmlhelp/ for producing HTML Help
images/ images used in callouts and graphical admonitions
javahelp/ for producing Java Help
lib/ utility stylesheets with schema-independent functions
manpages/ for producing groff/troff man pages
profiling/ for profiling (omitting/including conditional text)
roundtrip/ for "round trip" conversion among DocBook and
various word-processor formats (WordML, etc.)
slides/ for producing slides output (from Slides source)
template/ templates for building stylesheet customization layers
tools/ assorted supplementary tools
website/ for producing website output (from Website source)
xhtml/ for producing XHTML
xhtml-1_1/ for producing (stricter) XHTML 1.1
xhtml5/ for producing XHTML5
----------------------------------------------------------------------
Changes
----------------------------------------------------------------------
See the NEWS file for changes made since the previous release.
See the RELEASE-NOTES.html or RELEASE-NOTES.txt or RELEASE-NOTES.pdf
files for per-release cumulative summaries of significant
user-visible changes.
For online access to a hyperlinked view of all changes made over
the entire history of the codebase, see the following:
http://docbook.svn.sourceforge.net/viewvc/docbook/trunk/xsl/?view=log
WARNING: That above change history is a very long list and may
take a long time to load/download.
You can also create an XML-formatted "ChangeHistory.xml" copy of
the complete change history for the codebase by running the
following commands:
svn checkout https://docbook.svn.sf.net/svnroot/docbook/trunk/xsl
svn log --xml --verbose xsl > ChangeHistory.xml
----------------------------------------------------------------------
Copyright information
----------------------------------------------------------------------
See the accompanying file named COPYING.

View File

@ -1,115 +0,0 @@
<?xml version='1.0'?> <!-- -*- nxml -*- vim: set foldlevel=2: -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fm="http://freshmeat.net/projects/freshmeat-submit/"
xmlns:sf="http://sourceforge.net/"
xmlns:dyn="http://exslt.org/dynamic"
xmlns:saxon="http://icl.com/saxon"
exclude-result-prefixes="fm sf"
version='1.0'>
<xsl:param name="get"/>
<xsl:param name="VERSION" select="string(document('')//fm:Version[1])"/>
<xsl:param name="Tag" select="concat('V',translate(string(document('')//fm:Version[1]),'.',''))"/>
<xsl:param name="DistroTitle" select="string(document('')//fm:Branch[1])"/>
<xsl:param name="sf-relid" select="0"/>
<xsl:param name="DistroName">docbook-xsl</xsl:param>
<xsl:param name="PreviousRelease">1.77.0</xsl:param>
<xsl:param name="PreviousReleaseRevision">9371</xsl:param>
<xsl:param name="Revision">$Revision: 9399 $</xsl:param>
<xsl:param name="VersionFileURL">$URL: https://docbook.svn.sourceforge.net/svnroot/docbook/trunk/xsl/VERSION $</xsl:param>
<xsl:strip-space elements="fm:*"/>
<fm:project>
<fm:Project>DocBook</fm:Project>
<fm:Branch>XSL Stylesheets</fm:Branch>
<!-- * set/keep fm:version as N.NN.N-pre except for official releases, -->
<!-- * then after the release, revert it to N.NN.N-pre & check back in -->
<fm:Version>1.77.1</fm:Version>
<!--
<fm:License>MIT/X Consortium License</fm:License>
-->
<fm:Release-Focus>
<!-- * Initial freshmeat announcement -->
<!-- * Documentation -->
<!-- * Code cleanup -->
<!-- * Minor feature enhancements -->
* Major feature enhancements
<!-- * Minor bugfixes -->
<!-- * Major bugfixes -->
<!-- * Minor security fixes -->
<!-- * Major security fixes -->
</fm:Release-Focus>
<fm:Home-Page-URL>http://sourceforge.net/projects/docbook/</fm:Home-Page-URL>
<fm:Gzipped-Tar-URL>http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.tar.gz?download</fm:Gzipped-Tar-URL>
<fm:Zipped-Tar-URL>http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.zip?download</fm:Zipped-Tar-URL>
<fm:Bzipped-Tar-URL>http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.bz2?download</fm:Bzipped-Tar-URL>
<fm:Changelog-URL>http://sourceforge.net/project/shownotes.php?release_id={SFRELID}</fm:Changelog-URL>
<fm:CVS-URL>http://docbook.svn.sourceforge.net/viewvc/docbook/</fm:CVS-URL>
<fm:Mailing-List-URL>http://lists.oasis-open.org/archives/docbook-apps/</fm:Mailing-List-URL>
<fm:Changes>This is a release with bugfixes and some enhancements.</fm:Changes>
</fm:project>
<xsl:template match="/" priority="-100">
<xsl:choose>
<xsl:when test="$get = 'Tag'">
<xsl:value-of select="$Tag"/>
</xsl:when>
<xsl:when test="$get = 'PreviousRelease'">
<xsl:value-of select="$PreviousRelease"/>
</xsl:when>
<xsl:when test="$get = 'PreviousReleaseRevision'">
<xsl:value-of select="$PreviousReleaseRevision"/>
</xsl:when>
<xsl:when test="$get = 'DistroTitle'">
<xsl:value-of select="$DistroTitle"/>
</xsl:when>
<xsl:when test="$get = 'VERSION'">
<xsl:value-of select="$VERSION"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$sf-relid = 0">
<xsl:message terminate="yes">
<xsl:text>You must specify the sf-relid as a parameter.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:apply-templates select="//fm:project"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="fm:project">
<xsl:apply-templates/>
<xsl:text>&#10;</xsl:text>
<xsl:apply-templates select="fm:Changes" mode="text"/>
</xsl:template>
<xsl:template match="fm:Changes"/>
<xsl:template match="fm:Gzipped-Tar-URL|fm:Zipped-Tar-URL|fm:Bzipped-Tar-URL">
<xsl:value-of select="local-name(.)"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="substring-before(., '{DISTRONAME-VERSION}')"/>
<xsl:value-of select="concat($DistroName, '-', $VERSION)"/>
<xsl:value-of select="substring-after(., '{DISTRONAME-VERSION}')"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
<xsl:template match="fm:Changelog-URL">
<xsl:value-of select="local-name(.)"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="substring-before(., '{SFRELID}')"/>
<xsl:value-of select="$sf-relid"/>
<xsl:value-of select="substring-after(., '{SFRELID}')"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
<xsl:template match="fm:*">
<xsl:value-of select="local-name(.)"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="normalize-space(.)"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,67 +0,0 @@
<!-- ********************************************************************
$Id: entities.ent 9286 2012-04-19 10:10:58Z bobstayton $
********************************************************************
This file contains common entity declarations used for
sorting (and other things) by various templates.
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!ENTITY lowercase "'Aa&#192;&#224;&#193;&#225;&#194;&#226;&#195;&#227;&#196;&#228;&#197;&#229;&#256;&#257;&#258;&#259;&#260;&#261;&#461;&#462;&#478;&#479;&#480;&#481;&#506;&#507;&#512;&#513;&#514;&#515;&#550;&#551;&#7680;&#7681;&#7834;&#7840;&#7841;&#7842;&#7843;&#7844;&#7845;&#7846;&#7847;&#7848;&#7849;&#7850;&#7851;&#7852;&#7853;&#7854;&#7855;&#7856;&#7857;&#7858;&#7859;&#7860;&#7861;&#7862;&#7863;Bb&#384;&#385;&#595;&#386;&#387;&#7682;&#7683;&#7684;&#7685;&#7686;&#7687;Cc&#199;&#231;&#262;&#263;&#264;&#265;&#266;&#267;&#268;&#269;&#391;&#392;&#597;&#7688;&#7689;Dd&#270;&#271;&#272;&#273;&#394;&#599;&#395;&#396;&#453;&#498;&#545;&#598;&#7690;&#7691;&#7692;&#7693;&#7694;&#7695;&#7696;&#7697;&#7698;&#7699;Ee&#200;&#232;&#201;&#233;&#202;&#234;&#203;&#235;&#274;&#275;&#276;&#277;&#278;&#279;&#280;&#281;&#282;&#283;&#516;&#517;&#518;&#519;&#552;&#553;&#7700;&#7701;&#7702;&#7703;&#7704;&#7705;&#7706;&#7707;&#7708;&#7709;&#7864;&#7865;&#7866;&#7867;&#7868;&#7869;&#7870;&#7871;&#7872;&#7873;&#7874;&#7875;&#7876;&#7877;&#7878;&#7879;Ff&#401;&#402;&#7710;&#7711;Gg&#284;&#285;&#286;&#287;&#288;&#289;&#290;&#291;&#403;&#608;&#484;&#485;&#486;&#487;&#500;&#501;&#7712;&#7713;Hh&#292;&#293;&#294;&#295;&#542;&#543;&#614;&#7714;&#7715;&#7716;&#7717;&#7718;&#7719;&#7720;&#7721;&#7722;&#7723;&#7830;Ii&#204;&#236;&#205;&#237;&#206;&#238;&#207;&#239;&#296;&#297;&#298;&#299;&#300;&#301;&#302;&#303;&#304;&#407;&#616;&#463;&#464;&#520;&#521;&#522;&#523;&#7724;&#7725;&#7726;&#7727;&#7880;&#7881;&#7882;&#7883;Jj&#308;&#309;&#496;&#669;Kk&#310;&#311;&#408;&#409;&#488;&#489;&#7728;&#7729;&#7730;&#7731;&#7732;&#7733;Ll&#313;&#314;&#315;&#316;&#317;&#318;&#319;&#320;&#321;&#322;&#410;&#456;&#564;&#619;&#620;&#621;&#7734;&#7735;&#7736;&#7737;&#7738;&#7739;&#7740;&#7741;Mm&#625;&#7742;&#7743;&#7744;&#7745;&#7746;&#7747;Nn&#209;&#241;&#323;&#324;&#325;&#326;&#327;&#328;&#413;&#626;&#414;&#544;&#459;&#504;&#505;&#565;&#627;&#7748;&#7749;&#7750;&#7751;&#7752;&#7753;&#7754;&#7755;Oo&#210;&#242;&#211;&#243;&#212;&#244;&#213;&#245;&#214;&#246;&#216;&#248;&#332;&#333;&#334;&#335;&#336;&#337;&#415;&#416;&#417;&#465;&#466;&#490;&#491;&#492;&#493;&#510;&#511;&#524;&#525;&#526;&#527;&#554;&#555;&#556;&#557;&#558;&#559;&#560;&#561;&#7756;&#7757;&#7758;&#7759;&#7760;&#7761;&#7762;&#7763;&#7884;&#7885;&#7886;&#7887;&#7888;&#7889;&#7890;&#7891;&#7892;&#7893;&#7894;&#7895;&#7896;&#7897;&#7898;&#7899;&#7900;&#7901;&#7902;&#7903;&#7904;&#7905;&#7906;&#7907;Pp&#420;&#421;&#7764;&#7765;&#7766;&#7767;Qq&#672;Rr&#340;&#341;&#342;&#343;&#344;&#345;&#528;&#529;&#530;&#531;&#636;&#637;&#638;&#7768;&#7769;&#7770;&#7771;&#7772;&#7773;&#7774;&#7775;Ss&#346;&#347;&#348;&#349;&#350;&#351;&#352;&#353;&#536;&#537;&#642;&#7776;&#7777;&#7778;&#7779;&#7780;&#7781;&#7782;&#7783;&#7784;&#7785;Tt&#354;&#355;&#356;&#357;&#358;&#359;&#427;&#428;&#429;&#430;&#648;&#538;&#539;&#566;&#7786;&#7787;&#7788;&#7789;&#7790;&#7791;&#7792;&#7793;&#7831;Uu&#217;&#249;&#218;&#250;&#219;&#251;&#220;&#252;&#360;&#361;&#362;&#363;&#364;&#365;&#366;&#367;&#368;&#369;&#370;&#371;&#431;&#432;&#467;&#468;&#469;&#470;&#471;&#472;&#473;&#474;&#475;&#476;&#532;&#533;&#534;&#535;&#7794;&#7795;&#7796;&#7797;&#7798;&#7799;&#7800;&#7801;&#7802;&#7803;&#7908;&#7909;&#7910;&#7911;&#7912;&#7913;&#7914;&#7915;&#7916;&#7917;&#7918;&#7919;&#7920;&#7921;Vv&#434;&#651;&#7804;&#7805;&#7806;&#7807;Ww&#372;&#373;&#7808;&#7809;&#7810;&#7811;&#7812;&#7813;&#7814;&#7815;&#7816;&#7817;&#7832;Xx&#7818;&#7819;&#7820;&#7821;Yy&#221;&#253;&#255;&#376;&#374;&#375;&#435;&#436;&#562;&#563;&#7822;&#7823;&#7833;&#7922;&#7923;&#7924;&#7925;&#7926;&#7927;&#7928;&#7929;Zz&#377;&#378;&#379;&#380;&#381;&#382;&#437;&#438;&#548;&#549;&#656;&#657;&#7824;&#7825;&#7826;&#7827;&#7828;&#7829;&#7829;'">
<!ENTITY uppercase "'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ'">
<!-- The following three entities are used for sorting and grouping
indexterms, not in presentation of them. -->
<!-- If @sortas is present, sort and group by combination of
@sortas, space and entry to keep it separate from other entries
with the same @sortas.
If @sortas is not present, the first item is empty, and the added space
is removed when normalize-space is applied, leaving just the entry -->
<!ENTITY primary 'normalize-space(concat(primary/@sortas, " ", primary))'>
<!ENTITY secondary 'normalize-space(concat(secondary/@sortas, " ", secondary))'>
<!ENTITY tertiary 'normalize-space(concat(tertiary/@sortas, " ", tertiary))'>
<!ENTITY section '(ancestor-or-self::set|ancestor-or-self::book|ancestor-or-self::part|ancestor-or-self::reference|ancestor-or-self::partintro|ancestor-or-self::chapter|ancestor-or-self::appendix|ancestor-or-self::preface|ancestor-or-self::article|ancestor-or-self::section|ancestor-or-self::sect1|ancestor-or-self::sect2|ancestor-or-self::sect3|ancestor-or-self::sect4|ancestor-or-self::sect5|ancestor-or-self::refentry|ancestor-or-self::refsect1|ancestor-or-self::refsect2|ancestor-or-self::refsect3|ancestor-or-self::simplesect|ancestor-or-self::bibliography|ancestor-or-self::glossary|ancestor-or-self::index|ancestor-or-self::webpage|ancestor-or-self::topic)[last()]'>
<!ENTITY section.id 'generate-id(&section;)'>
<!ENTITY sep '" "'>
<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))'>
<!ENTITY setup-language-variable '
<xsl:variable name="language" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:call-template name="l10n.language"/>
</xsl:variable>
<xsl:variable name="lowercase" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:call-template name="gentext">
<xsl:with-param name="key">normalize.sort.input</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="uppercase" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:call-template name="gentext">
<xsl:with-param name="key">normalize.sort.output</xsl:with-param>
</xsl:call-template>
</xsl:variable>
'>
<!-- Entity used in html/inline.xsl and fo/inline.xsl -->
<!ENTITY comment.block.parents "parent::answer|parent::appendix|parent::article|parent::bibliodiv|
parent::bibliography|parent::blockquote|parent::caution|parent::chapter|
parent::glossary|parent::glossdiv|parent::important|parent::index|
parent::indexdiv|parent::listitem|parent::note|parent::orderedlist|
parent::partintro|parent::preface|parent::procedure|parent::qandadiv|
parent::qandaset|parent::question|parent::refentry|parent::refnamediv|
parent::refsect1|parent::refsect2|parent::refsect3|parent::refsection|
parent::refsynopsisdiv|parent::sect1|parent::sect2|parent::sect3|parent::sect4|
parent::sect5|parent::section|parent::setindex|parent::sidebar|
parent::simplesect|parent::taskprerequisites|parent::taskrelated|
parent::tasksummary|parent::warning|parent::topic">

View File

@ -1,839 +0,0 @@
<?xml version='1.0'?>
<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'>
<!-- ********************************************************************
$Id: gentext.xsl 9286 2012-04-19 10:10:58Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="*" mode="object.title.template">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'title'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="chapter" mode="object.title.template">
<xsl:choose>
<xsl:when test="string($chapter.autolabel) != 0">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'title-numbered'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'title-unnumbered'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="appendix" mode="object.title.template">
<xsl:choose>
<xsl:when test="string($appendix.autolabel) != 0">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'title-numbered'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'title-unnumbered'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="part" mode="object.title.template">
<xsl:choose>
<xsl:when test="string($part.autolabel) != 0">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'title-numbered'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'title-unnumbered'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="section|sect1|sect2|sect3|sect4|sect5|simplesect
|bridgehead|topic"
mode="object.title.template">
<xsl:variable name="is.numbered">
<xsl:call-template name="label.this.section"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is.numbered != 0">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'title-numbered'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'title-unnumbered'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="procedure" mode="object.title.template">
<xsl:choose>
<xsl:when test="$formal.procedures != 0 and title">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'title'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
<xsl:text>.formal</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'title'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ============================================================ -->
<xsl:template match="*" mode="object.subtitle.template">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'subtitle'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- ============================================================ -->
<xsl:template match="*" mode="is.autonumber">
<xsl:value-of select="'0'"/>
</xsl:template>
<xsl:template match="section|sect1|sect2|sect3|sect4|sect5"
mode="is.autonumber">
<xsl:call-template name="label.this.section"/>
</xsl:template>
<xsl:template match="figure|example|table|equation" mode="is.autonumber">
<xsl:value-of select="'1'"/>
</xsl:template>
<xsl:template match="appendix" mode="is.autonumber">
<xsl:value-of select="$appendix.autolabel"/>
</xsl:template>
<xsl:template match="chapter" mode="is.autonumber">
<xsl:value-of select="$chapter.autolabel"/>
</xsl:template>
<xsl:template match="part" mode="is.autonumber">
<xsl:value-of select="$part.autolabel"/>
</xsl:template>
<xsl:template match="preface" mode="is.autonumber">
<xsl:value-of select="$preface.autolabel"/>
</xsl:template>
<xsl:template match="question|answer" mode="is.autonumber">
<xsl:choose>
<xsl:when test="$qanda.defaultlabel = 'number'
and not(label)">
<xsl:value-of select="'1'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'0'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="qandadiv" mode="is.autonumber">
<xsl:value-of select="$qandadiv.autolabel"/>
</xsl:template>
<xsl:template match="bridgehead" mode="is.autonumber">
<xsl:value-of select="$section.autolabel"/>
</xsl:template>
<xsl:template match="procedure" mode="is.autonumber">
<xsl:value-of select="$formal.procedures"/>
</xsl:template>
<xsl:template match="*" mode="object.xref.template">
<xsl:param name="purpose"/>
<xsl:param name="xrefstyle"/>
<xsl:param name="referrer"/>
<!-- Is autonumbering on? -->
<xsl:variable name="autonumber">
<xsl:apply-templates select="." mode="is.autonumber"/>
</xsl:variable>
<xsl:variable name="number-and-title-template">
<xsl:call-template name="gentext.template.exists">
<xsl:with-param name="context" select="'xref-number-and-title'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="number-template">
<xsl:call-template name="gentext.template.exists">
<xsl:with-param name="context" select="'xref-number'"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="context">
<xsl:choose>
<xsl:when test="self::equation and not(title) and not(info/title)">
<xsl:value-of select="'xref-number'"/>
</xsl:when>
<xsl:when test="string($autonumber) != 0
and $number-and-title-template != 0
and $xref.with.number.and.title != 0">
<xsl:value-of select="'xref-number-and-title'"/>
</xsl:when>
<xsl:when test="string($autonumber) != 0
and $number-template != 0">
<xsl:value-of select="'xref-number'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'xref'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="name">
<xsl:call-template name="xpath.location"/>
</xsl:with-param>
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="referrer" select="$referrer"/>
</xsl:call-template>
</xsl:template>
<!-- ============================================================ -->
<xsl:template match="*" mode="object.title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:variable name="template">
<xsl:apply-templates select="." mode="object.title.template"/>
</xsl:variable>
<!--
<xsl:message>
<xsl:text>object.title.markup: </xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="$template"/>
</xsl:message>
-->
<xsl:call-template name="substitute-markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="template" select="$template"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="*" mode="object.title.markup.textonly">
<xsl:variable name="title">
<xsl:apply-templates select="." mode="object.title.markup"/>
</xsl:variable>
<xsl:value-of select="normalize-space($title)"/>
</xsl:template>
<!-- ============================================================ -->
<xsl:template match="*" mode="object.titleabbrev.markup">
<xsl:param name="allow-anchors" select="0"/>
<!-- Just for consistency in template naming -->
<xsl:apply-templates select="." mode="titleabbrev.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<!-- ============================================================ -->
<xsl:template match="*" mode="object.subtitle.markup">
<xsl:variable name="template">
<xsl:apply-templates select="." mode="object.subtitle.template"/>
</xsl:variable>
<xsl:call-template name="substitute-markup">
<xsl:with-param name="template" select="$template"/>
</xsl:call-template>
</xsl:template>
<!-- ============================================================ -->
<xsl:template match="*" mode="object.xref.markup">
<xsl:param name="purpose"/>
<xsl:param name="xrefstyle"/>
<xsl:param name="referrer"/>
<xsl:param name="verbose" select="1"/>
<xsl:variable name="template">
<xsl:choose>
<xsl:when test="starts-with(normalize-space($xrefstyle), 'select:')">
<xsl:call-template name="make.gentext.template">
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="referrer" select="$referrer"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="starts-with(normalize-space($xrefstyle), 'template:')">
<xsl:value-of select="substring-after(normalize-space($xrefstyle), 'template:')"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="object.xref.template">
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="referrer" select="$referrer"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!--
<xsl:message>
<xsl:text>object.xref.markup: </xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text>(</xsl:text>
<xsl:value-of select="$xrefstyle"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="$purpose"/>
<xsl:text>)</xsl:text>
<xsl:text>: [</xsl:text>
<xsl:value-of select="$template"/>
<xsl:text>]</xsl:text>
</xsl:message>
-->
<xsl:if test="$template = '' and $verbose != 0">
<xsl:message>
<xsl:text>object.xref.markup: empty xref template</xsl:text>
<xsl:text> for linkend="</xsl:text>
<xsl:value-of select="@id|@xml:id"/>
<xsl:text>" and @xrefstyle="</xsl:text>
<xsl:value-of select="$xrefstyle"/>
<xsl:text>"</xsl:text>
</xsl:message>
</xsl:if>
<xsl:call-template name="substitute-markup">
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="referrer" select="$referrer"/>
<xsl:with-param name="template" select="$template"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="listitem" mode="object.xref.markup">
<xsl:param name="verbose" select="1"/>
<xsl:choose>
<xsl:when test="parent::orderedlist">
<xsl:variable name="template">
<xsl:apply-templates select="." mode="object.xref.template"/>
</xsl:variable>
<xsl:call-template name="substitute-markup">
<xsl:with-param name="template" select="$template"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$verbose != 0">
<xsl:message>
<xsl:text>Xref is only supported to listitems in an</xsl:text>
<xsl:text> orderedlist: </xsl:text>
<xsl:value-of select=".//@id|.//@xml:id"/>
</xsl:message>
<xsl:text>???</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="question" mode="object.xref.markup">
<xsl:param name="purpose"/>
<xsl:param name="xrefstyle"/>
<xsl:param name="referrer"/>
<xsl:variable name="deflabel">
<xsl:choose>
<xsl:when test="ancestor-or-self::*[@defaultlabel]">
<xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
/@defaultlabel"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$qanda.defaultlabel"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="template">
<xsl:choose>
<!-- This avoids double Q: Q: in xref when defaultlabel=qanda -->
<xsl:when test="$deflabel = 'qanda' and not(label)">%n</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="object.xref.template">
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="referrer" select="$referrer"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="substitute-markup">
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="referrer" select="$referrer"/>
<xsl:with-param name="template" select="$template"/>
</xsl:call-template>
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="substitute-markup">
<xsl:param name="template" select="''"/>
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="title" select="''"/>
<xsl:param name="subtitle" select="''"/>
<xsl:param name="docname" select="''"/>
<xsl:param name="label" select="''"/>
<xsl:param name="pagenumber" select="''"/>
<xsl:param name="purpose"/>
<xsl:param name="xrefstyle"/>
<xsl:param name="referrer"/>
<xsl:param name="verbose"/>
<xsl:choose>
<xsl:when test="contains($template, '%')">
<xsl:value-of select="substring-before($template, '%')"/>
<xsl:variable name="candidate"
select="substring(substring-after($template, '%'), 1, 1)"/>
<xsl:choose>
<xsl:when test="$candidate = 't'">
<xsl:apply-templates select="." mode="insert.title.markup">
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="title">
<xsl:choose>
<xsl:when test="$title != ''">
<xsl:copy-of select="$title"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$candidate = 's'">
<xsl:apply-templates select="." mode="insert.subtitle.markup">
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="subtitle">
<xsl:choose>
<xsl:when test="$subtitle != ''">
<xsl:copy-of select="$subtitle"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="subtitle.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$candidate = 'n'">
<xsl:apply-templates select="." mode="insert.label.markup">
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="label">
<xsl:choose>
<xsl:when test="$label != ''">
<xsl:copy-of select="$label"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$candidate = 'p'">
<xsl:apply-templates select="." mode="insert.pagenumber.markup">
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="pagenumber">
<xsl:choose>
<xsl:when test="$pagenumber != ''">
<xsl:copy-of select="$pagenumber"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="pagenumber.markup"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$candidate = 'o'">
<!-- olink target document title -->
<xsl:apply-templates select="." mode="insert.olink.docname.markup">
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="docname">
<xsl:choose>
<xsl:when test="$docname != ''">
<xsl:copy-of select="$docname"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="olink.docname.markup"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$candidate = 'd'">
<xsl:apply-templates select="." mode="insert.direction.markup">
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="direction">
<xsl:choose>
<xsl:when test="$referrer">
<xsl:variable name="referent-is-below">
<xsl:for-each select="preceding::xref">
<xsl:if test="generate-id(.) = generate-id($referrer)">1</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:choose>
<xsl:when test="$referent-is-below = ''">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'above'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'below'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:message>Attempt to use %d in gentext with no referrer!</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$candidate = '%' ">
<xsl:text>%</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>%</xsl:text><xsl:value-of select="$candidate"/>
</xsl:otherwise>
</xsl:choose>
<!-- recurse with the rest of the template string -->
<xsl:variable name="rest"
select="substring($template,
string-length(substring-before($template, '%'))+3)"/>
<xsl:call-template name="substitute-markup">
<xsl:with-param name="template" select="$rest"/>
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="title" select="$title"/>
<xsl:with-param name="subtitle" select="$subtitle"/>
<xsl:with-param name="docname" select="$docname"/>
<xsl:with-param name="label" select="$label"/>
<xsl:with-param name="pagenumber" select="$pagenumber"/>
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="referrer" select="$referrer"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$template"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="make.gentext.template">
<xsl:param name="xrefstyle" select="''"/>
<xsl:param name="purpose"/>
<xsl:param name="referrer"/>
<xsl:param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:param>
<xsl:param name="target.elem" select="local-name(.)"/>
<!-- parse xrefstyle to get parts -->
<xsl:variable name="parts"
select="substring-after(normalize-space($xrefstyle), 'select:')"/>
<xsl:variable name="labeltype">
<xsl:choose>
<xsl:when test="contains($parts, 'labelnumber')">
<xsl:text>labelnumber</xsl:text>
</xsl:when>
<xsl:when test="contains($parts, 'labelname')">
<xsl:text>labelname</xsl:text>
</xsl:when>
<xsl:when test="contains($parts, 'label')">
<xsl:text>label</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="titletype">
<xsl:choose>
<xsl:when test="contains($parts, 'quotedtitle')">
<xsl:text>quotedtitle</xsl:text>
</xsl:when>
<xsl:when test="contains($parts, 'title')">
<xsl:text>title</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="pagetype">
<xsl:choose>
<xsl:when test="$insert.olink.page.number = 'no' and
local-name($referrer) = 'olink'">
<!-- suppress page numbers -->
</xsl:when>
<xsl:when test="$insert.xref.page.number = 'no' and
local-name($referrer) != 'olink'">
<!-- suppress page numbers -->
</xsl:when>
<xsl:when test="contains($parts, 'nopage')">
<xsl:text>nopage</xsl:text>
</xsl:when>
<xsl:when test="contains($parts, 'pagenumber')">
<xsl:text>pagenumber</xsl:text>
</xsl:when>
<xsl:when test="contains($parts, 'pageabbrev')">
<xsl:text>pageabbrev</xsl:text>
</xsl:when>
<xsl:when test="contains($parts, 'Page')">
<xsl:text>Page</xsl:text>
</xsl:when>
<xsl:when test="contains($parts, 'page')">
<xsl:text>page</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="docnametype">
<xsl:choose>
<xsl:when test="($olink.doctitle = 0 or
$olink.doctitle = 'no') and
local-name($referrer) = 'olink'">
<!-- suppress docname -->
</xsl:when>
<xsl:when test="contains($parts, 'nodocname')">
<xsl:text>nodocname</xsl:text>
</xsl:when>
<xsl:when test="contains($parts, 'docnamelong')">
<xsl:text>docnamelong</xsl:text>
</xsl:when>
<xsl:when test="contains($parts, 'docname')">
<xsl:text>docname</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:if test="$labeltype != ''">
<xsl:choose>
<xsl:when test="$labeltype = 'labelname'">
<xsl:call-template name="gentext">
<xsl:with-param name="key">
<xsl:choose>
<xsl:when test="local-name($referrer) = 'olink'">
<xsl:value-of select="$target.elem"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="local-name(.)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$labeltype = 'labelnumber'">
<xsl:text>%n</xsl:text>
</xsl:when>
<xsl:when test="$labeltype = 'label'">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'xref-number'"/>
<xsl:with-param name="name">
<xsl:choose>
<xsl:when test="local-name($referrer) = 'olink'">
<xsl:value-of select="$target.elem"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="xpath.location"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="referrer" select="$referrer"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="$titletype != ''">
<xsl:value-of select="$xref.label-title.separator"/>
</xsl:when>
<xsl:when test="$pagetype != '' and $pagetype != 'nopage'">
<xsl:value-of select="$xref.label-page.separator"/>
</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="$titletype != ''">
<xsl:choose>
<xsl:when test="$titletype = 'title'">
<xsl:text>%t</xsl:text>
</xsl:when>
<xsl:when test="$titletype = 'quotedtitle'">
<xsl:call-template name="gentext.dingbat">
<xsl:with-param name="dingbat" select="'startquote'"/>
</xsl:call-template>
<xsl:text>%t</xsl:text>
<xsl:call-template name="gentext.dingbat">
<xsl:with-param name="dingbat" select="'endquote'"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="$pagetype != '' and $pagetype != 'nopage'">
<xsl:value-of select="$xref.title-page.separator"/>
</xsl:when>
</xsl:choose>
</xsl:if>
<!-- special case: use regular xref template if just turning off page -->
<xsl:if test="($pagetype = 'nopage' or $docnametype = 'nodocname')
and local-name($referrer) != 'olink'
and $labeltype = ''
and $titletype = ''">
<xsl:apply-templates select="." mode="object.xref.template">
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="referrer" select="$referrer"/>
</xsl:apply-templates>
</xsl:if>
<xsl:if test="$pagetype != ''">
<xsl:choose>
<xsl:when test="$pagetype = 'page'">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'xref'"/>
<xsl:with-param name="name" select="'page'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pagetype = 'Page'">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'xref'"/>
<xsl:with-param name="name" select="'Page'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pagetype = 'pageabbrev'">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'xref'"/>
<xsl:with-param name="name" select="'pageabbrev'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pagetype = 'pagenumber'">
<xsl:text>%p</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:if>
<!-- Add reference to other document title -->
<xsl:if test="$docnametype != '' and local-name($referrer) = 'olink'">
<!-- Any separator should be in the gentext template -->
<xsl:choose>
<xsl:when test="$docnametype = 'docnamelong'">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'xref'"/>
<xsl:with-param name="name" select="'docnamelong'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$docnametype = 'docname'">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'xref'"/>
<xsl:with-param name="name" select="'docname'"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,64 +0,0 @@
<!ENTITY % prefix "l">
<!ENTITY % xmlns "xmlns:%prefix;">
<!ENTITY % uri "'http://docbook.sourceforge.net/xmlns/l10n/1.0'">
<!ENTITY % i18n "%prefix;:i18n">
<!ENTITY % l10n "%prefix;:l10n">
<!ENTITY % gentext "%prefix;:gentext">
<!ENTITY % dingbat "%prefix;:dingbat">
<!ENTITY % context "%prefix;:context">
<!ENTITY % template "%prefix;:template">
<!ENTITY % letters "%prefix;:letters">
<!ENTITY % l "%prefix;:l">
<!ENTITY % lang "lang NMTOKEN #IMPLIED">
<!ELEMENT %i18n; ((%l10n;)+)>
<!ATTLIST %i18n;
%xmlns; CDATA #FIXED %uri;
>
<!ELEMENT %l10n; (%gentext;|%dingbat;|%context;|%letters;)*>
<!ATTLIST %l10n;
%xmlns; CDATA #FIXED %uri;
language CDATA #REQUIRED
english-language-name CDATA #IMPLIED
href CDATA #IMPLIED
>
<!ELEMENT %gentext; EMPTY>
<!ATTLIST %gentext;
%lang;
key CDATA #REQUIRED
text CDATA #REQUIRED
>
<!ELEMENT %dingbat; EMPTY>
<!ATTLIST %dingbat;
%lang;
key CDATA #REQUIRED
text CDATA #REQUIRED
>
<!ELEMENT %context; ((%template;)+)>
<!ATTLIST %context;
name CDATA #REQUIRED
>
<!ELEMENT %template; EMPTY>
<!ATTLIST %template;
%lang;
name CDATA #REQUIRED
text CDATA #REQUIRED
style CDATA #IMPLIED
>
<!ELEMENT %letters; ((%l;)+)>
<!ATTLIST %letters;
%lang;
>
<!ELEMENT %l; (#PCDATA)>
<!ATTLIST %l;
i CDATA #REQUIRED
>

View File

@ -1,77 +0,0 @@
<?xml version='1.0'?>
<!DOCTYPE l:i18n SYSTEM "l10n.dtd">
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
<l:l10n language="af" href="af.xml"/>
<l:l10n language="am" href="am.xml"/>
<l:l10n language="ar" href="ar.xml"/>
<l:l10n language="as" href="as.xml"/>
<l:l10n language="ast" href="ast.xml"/>
<l:l10n language="az" href="az.xml"/>
<l:l10n language="bg" href="bg.xml"/>
<l:l10n language="bn" href="bn.xml"/>
<l:l10n language="bn_in" href="bn_in.xml"/>
<l:l10n language="bs" href="bs.xml"/>
<l:l10n language="ca" href="ca.xml"/>
<l:l10n language="cs" href="cs.xml"/>
<l:l10n language="cy" href="cy.xml"/>
<l:l10n language="da" href="da.xml"/>
<l:l10n language="de" href="de.xml"/>
<l:l10n language="el" href="el.xml"/>
<l:l10n language="en" href="en.xml"/>
<l:l10n language="eo" href="eo.xml"/>
<l:l10n language="es" href="es.xml"/>
<l:l10n language="et" href="et.xml"/>
<l:l10n language="eu" href="eu.xml"/>
<l:l10n language="fa" href="fa.xml"/>
<l:l10n language="fi" href="fi.xml"/>
<l:l10n language="fr" href="fr.xml"/>
<l:l10n language="ga" href="ga.xml"/>
<l:l10n language="gl" href="gl.xml"/>
<l:l10n language="gu" href="gu.xml"/>
<l:l10n language="he" href="he.xml"/>
<l:l10n language="hi" href="hi.xml"/>
<l:l10n language="hr" href="hr.xml"/>
<l:l10n language="hu" href="hu.xml"/>
<l:l10n language="id" href="id.xml"/>
<l:l10n language="is" href="is.xml"/>
<l:l10n language="it" href="it.xml"/>
<l:l10n language="ja" href="ja.xml"/>
<l:l10n language="ka" href="ka.xml"/>
<l:l10n language="kn" href="kn.xml"/>
<l:l10n language="ko" href="ko.xml"/>
<l:l10n language="ky" href="ky.xml"/>
<l:l10n language="la" href="la.xml"/>
<l:l10n language="lt" href="lt.xml"/>
<l:l10n language="lv" href="lv.xml"/>
<l:l10n language="ml" href="ml.xml"/>
<l:l10n language="mn" href="mn.xml"/>
<l:l10n language="mr" href="mr.xml"/>
<l:l10n language="nb" href="nb.xml"/>
<l:l10n language="nds" href="nds.xml"/>
<l:l10n language="nl" href="nl.xml"/>
<l:l10n language="nn" href="nn.xml"/>
<l:l10n language="or" href="or.xml"/>
<l:l10n language="pa" href="pa.xml"/>
<l:l10n language="pl" href="pl.xml"/>
<l:l10n language="pt" href="pt.xml"/>
<l:l10n language="pt_br" href="pt_br.xml"/>
<l:l10n language="ro" href="ro.xml"/>
<l:l10n language="ru" href="ru.xml"/>
<l:l10n language="sk" href="sk.xml"/>
<l:l10n language="sl" href="sl.xml"/>
<l:l10n language="sq" href="sq.xml"/>
<l:l10n language="sr" href="sr.xml"/>
<l:l10n language="sr_latn" href="sr_Latn.xml"/>
<l:l10n language="sv" href="sv.xml"/>
<l:l10n language="ta" href="ta.xml"/>
<l:l10n language="te" href="te.xml"/>
<l:l10n language="th" href="th.xml"/>
<l:l10n language="tl" href="tl.xml"/>
<l:l10n language="tr" href="tr.xml"/>
<l:l10n language="uk" href="uk.xml"/>
<l:l10n language="vi" href="vi.xml"/>
<l:l10n language="xh" href="xh.xml"/>
<l:l10n language="zh" href="zh.xml"/>
<l:l10n language="zh_cn" href="zh_cn.xml"/>
<l:l10n language="zh_tw" href="zh_tw.xml"/>
</l:i18n>

View File

@ -1,593 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
exclude-result-prefixes="l"
version='1.0'>
<!-- ********************************************************************
$Id: l10n.xsl 8904 2010-09-11 01:56:22Z kosek $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
This file contains localization templates (for internationalization)
******************************************************************** -->
<xsl:param name="l10n.xml" select="document('../common/l10n.xml')"/>
<xsl:param name="local.l10n.xml" select="document('')"/>
<xsl:param name="empty.local.l10n.xml" select="not($local.l10n.xml//l:l10n)"/>
<xsl:key name="l10n-lang" match="l:l10n" use="@language"/>
<xsl:key name="l10n-gentext" match="l:l10n/l:gentext" use="@key"/>
<xsl:key name="l10n-dingbat" match="l:l10n/l:dingbat" use="@key"/>
<xsl:key name="l10n-context" match="l:l10n/l:context" use="@name"/>
<xsl:key name="l10n-template" match="l:l10n/l:context/l:template[not(@style)]" use="concat(../@name, '#', @name)"/>
<xsl:key name="l10n-template-style" match="l:l10n/l:context/l:template[@style]" use="concat(../@name, '#', @name, '#', @style)"/>
<xsl:template name="l10n.language">
<xsl:param name="target" select="."/>
<xsl:param name="xref-context" select="false()"/>
<xsl:variable name="mc-language">
<xsl:choose>
<xsl:when test="$l10n.gentext.language != ''">
<xsl:value-of select="$l10n.gentext.language"/>
</xsl:when>
<xsl:when test="$xref-context or $l10n.gentext.use.xref.language != 0">
<!-- can't do this one step: attributes are unordered! -->
<xsl:variable name="lang-scope"
select="$target/ancestor-or-self::*
[@lang or @xml:lang][1]"/>
<xsl:variable name="lang-attr"
select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
<xsl:choose>
<xsl:when test="string($lang-attr) = ''">
<xsl:value-of select="$l10n.gentext.default.language"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$lang-attr"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<!-- can't do this one step: attributes are unordered! -->
<xsl:variable name="lang-scope"
select="$target/ancestor-or-self::*
[@lang or @xml:lang][1]"/>
<xsl:variable name="lang-attr"
select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
<xsl:choose>
<xsl:when test="string($lang-attr) = ''">
<xsl:value-of select="$l10n.gentext.default.language"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$lang-attr"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="language" select="translate($mc-language,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ-',
'abcdefghijklmnopqrstuvwxyz_')"/>
<xsl:for-each select="$l10n.xml"> <!-- We need to change context in order to get key work -->
<xsl:choose>
<xsl:when test="key('l10n-lang', $language)">
<xsl:value-of select="$language"/>
</xsl:when>
<!-- try just the lang code without country -->
<xsl:when test="key('l10n-lang', substring-before($language,'_'))">
<xsl:value-of select="substring-before($language,'_')"/>
</xsl:when>
<!-- or use the default -->
<xsl:otherwise>
<xsl:message>
<xsl:text>No localization exists for "</xsl:text>
<xsl:value-of select="$language"/>
<xsl:text>" or "</xsl:text>
<xsl:value-of select="substring-before($language,'_')"/>
<xsl:text>". Using default "</xsl:text>
<xsl:value-of select="$l10n.gentext.default.language"/>
<xsl:text>".</xsl:text>
</xsl:message>
<xsl:value-of select="$l10n.gentext.default.language"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template name="l10n.language.name">
<xsl:param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:param>
<xsl:for-each select="$l10n.xml">
<xsl:value-of
select="document(key('l10n-lang', $lang)/@href)/l:l10n/@english-language-name"/>
</xsl:for-each>
</xsl:template>
<xsl:template name="language.attribute">
<xsl:param name="node" select="."/>
<xsl:variable name="language">
<xsl:choose>
<xsl:when test="$l10n.gentext.language != ''">
<xsl:value-of select="$l10n.gentext.language"/>
</xsl:when>
<xsl:otherwise>
<!-- can't do this one step: attributes are unordered! -->
<xsl:variable name="lang-scope"
select="$node/ancestor-or-self::*
[@lang or @xml:lang][1]"/>
<xsl:variable name="lang-attr"
select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
<xsl:choose>
<xsl:when test="string($lang-attr) = ''">
<xsl:value-of select="$l10n.gentext.default.language"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$lang-attr"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$language != ''">
<xsl:attribute name="lang">
<xsl:choose>
<xsl:when test="$l10n.lang.value.rfc.compliant != 0">
<xsl:value-of select="translate($language, '_', '-')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$language"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<!-- FIXME: This is sort of hack, but it was the easiest way to add at least partial support for dir attribute -->
<xsl:copy-of select="ancestor-or-self::*[@dir][1]/@dir"/>
</xsl:template>
<!-- Duplication of language.attribute template to allow for xml:lang attribute
creation for XHTML 1.1 and epub target -->
<xsl:template name="xml.language.attribute">
<xsl:param name="node" select="."/>
<xsl:variable name="language">
<xsl:choose>
<xsl:when test="$l10n.gentext.language != ''">
<xsl:value-of select="$l10n.gentext.language"/>
</xsl:when>
<xsl:otherwise>
<!-- can't do this one step: attributes are unordered! -->
<xsl:variable name="lang-scope"
select="$node/ancestor-or-self::*
[@lang or @xml:lang][1]"/>
<xsl:variable name="lang-attr"
select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
<xsl:choose>
<xsl:when test="string($lang-attr) = ''">
<xsl:value-of select="$l10n.gentext.default.language"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$lang-attr"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$language != ''">
<xsl:attribute name="xml:lang">
<xsl:choose>
<xsl:when test="$l10n.lang.value.rfc.compliant != 0">
<xsl:value-of select="translate($language, '_', '-')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$language"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<!-- FIXME: This is sort of hack, but it was the easiest way to add at least partial support for dir attribute -->
<xsl:copy-of select="ancestor-or-self::*[@dir][1]/@dir"/>
</xsl:template>
<xsl:template name="gentext">
<xsl:param name="key" select="local-name(.)"/>
<xsl:param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:param>
<xsl:for-each select="$l10n.xml"> <!-- We need to switch context in order to make key() work -->
<xsl:for-each select="document(key('l10n-lang', $lang)/@href)">
<xsl:variable name="local.l10n.gentext"
select="($local.l10n.xml//l:i18n/l:l10n[@language=$lang]/l:gentext[@key=$key])[1]"/>
<xsl:variable name="l10n.gentext"
select="key('l10n-gentext', $key)[1]"/>
<xsl:choose>
<xsl:when test="$local.l10n.gentext">
<xsl:value-of select="$local.l10n.gentext/@text"/>
</xsl:when>
<xsl:when test="$l10n.gentext">
<xsl:value-of select="$l10n.gentext/@text"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>No "</xsl:text>
<xsl:value-of select="$lang"/>
<xsl:text>" localization of "</xsl:text>
<xsl:value-of select="$key"/>
<xsl:text>" exists</xsl:text>
<xsl:choose>
<xsl:when test="$lang = 'en'">
<xsl:text>.</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>; using "en".</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:message>
<xsl:for-each select="$l10n.xml"> <!-- We need to switch context in order to make key() work -->
<xsl:for-each select="document(key('l10n-lang', 'en')/@href)">
<xsl:value-of select="key('l10n-gentext', $key)[1]/@text"/>
</xsl:for-each>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<xsl:template name="gentext.element.name">
<xsl:param name="element.name" select="local-name(.)"/>
<xsl:param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:param>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="$element.name"/>
<xsl:with-param name="lang" select="$lang"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="gentext.space">
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template name="gentext.edited.by">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Editedby'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="gentext.by">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'by'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="gentext.dingbat">
<xsl:param name="dingbat">bullet</xsl:param>
<xsl:param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:param>
<xsl:for-each select="$l10n.xml"> <!-- We need to switch context in order to make key() work -->
<xsl:for-each select="document(key('l10n-lang', $lang)/@href)">
<xsl:variable name="local.l10n.dingbat"
select="($local.l10n.xml//l:i18n/l:l10n[@language=$lang]/l:dingbat[@key=$dingbat])[1]"/>
<xsl:variable name="l10n.dingbat"
select="key('l10n-dingbat', $dingbat)[1]"/>
<xsl:choose>
<xsl:when test="$local.l10n.dingbat">
<xsl:value-of select="$local.l10n.dingbat/@text"/>
</xsl:when>
<xsl:when test="$l10n.dingbat">
<xsl:value-of select="$l10n.dingbat/@text"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>No "</xsl:text>
<xsl:value-of select="$lang"/>
<xsl:text>" localization of dingbat </xsl:text>
<xsl:value-of select="$dingbat"/>
<xsl:text> exists; using "en".</xsl:text>
</xsl:message>
<xsl:for-each select="$l10n.xml"> <!-- We need to switch context in order to make key() work -->
<xsl:for-each select="document(key('l10n-lang', 'en')/@href)">
<xsl:value-of select="key('l10n-dingbat', $dingbat)[1]/@text"/>
</xsl:for-each>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<xsl:template name="gentext.startquote">
<xsl:call-template name="gentext.dingbat">
<xsl:with-param name="dingbat">startquote</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="gentext.endquote">
<xsl:call-template name="gentext.dingbat">
<xsl:with-param name="dingbat">endquote</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="gentext.nestedstartquote">
<xsl:call-template name="gentext.dingbat">
<xsl:with-param name="dingbat">nestedstartquote</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="gentext.nestedendquote">
<xsl:call-template name="gentext.dingbat">
<xsl:with-param name="dingbat">nestedendquote</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="gentext.nav.prev">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'nav-prev'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="gentext.nav.next">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'nav-next'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="gentext.nav.home">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'nav-home'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="gentext.nav.up">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'nav-up'"/>
</xsl:call-template>
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="gentext.template">
<xsl:param name="context" select="'default'"/>
<xsl:param name="name" select="'default'"/>
<xsl:param name="origname" select="$name"/>
<xsl:param name="purpose"/>
<xsl:param name="xrefstyle"/>
<xsl:param name="referrer"/>
<xsl:param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:param>
<xsl:param name="verbose" select="1"/>
<xsl:choose>
<xsl:when test="$empty.local.l10n.xml">
<xsl:for-each select="$l10n.xml"> <!-- We need to switch context in order to make key() work -->
<xsl:for-each select="document(key('l10n-lang', $lang)/@href)">
<xsl:variable name="localization.node"
select="key('l10n-lang', $lang)[1]"/>
<xsl:if test="count($localization.node) = 0
and $verbose != 0">
<xsl:message>
<xsl:text>No "</xsl:text>
<xsl:value-of select="$lang"/>
<xsl:text>" localization exists.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:variable name="context.node"
select="key('l10n-context', $context)[1]"/>
<xsl:if test="count($context.node) = 0
and $verbose != 0">
<xsl:message>
<xsl:text>No context named "</xsl:text>
<xsl:value-of select="$context"/>
<xsl:text>" exists in the "</xsl:text>
<xsl:value-of select="$lang"/>
<xsl:text>" localization.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:for-each select="$context.node">
<xsl:variable name="template.node"
select="(key('l10n-template-style', concat($context, '#', $name, '#', $xrefstyle))
|key('l10n-template', concat($context, '#', $name)))[1]"/>
<xsl:choose>
<xsl:when test="$template.node/@text">
<xsl:value-of select="$template.node/@text"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="contains($name, '/')">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="name" select="substring-after($name, '/')"/>
<xsl:with-param name="origname" select="$origname"/>
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="referrer" select="$referrer"/>
<xsl:with-param name="lang" select="$lang"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$verbose = 0">
<!-- silence -->
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>No template for "</xsl:text>
<xsl:value-of select="$origname"/>
<xsl:text>" (or any of its leaves) exists in the context named "</xsl:text>
<xsl:value-of select="$context"/>
<xsl:text>" in the "</xsl:text>
<xsl:value-of select="$lang"/>
<xsl:text>" localization.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$l10n.xml"> <!-- We need to switch context in order to make key() work -->
<xsl:for-each select="document(key('l10n-lang', $lang)/@href)">
<xsl:variable name="local.localization.node"
select="($local.l10n.xml//l:i18n/l:l10n[@language=$lang])[1]"/>
<xsl:variable name="localization.node"
select="key('l10n-lang', $lang)[1]"/>
<xsl:if test="count($localization.node) = 0
and count($local.localization.node) = 0
and $verbose != 0">
<xsl:message>
<xsl:text>No "</xsl:text>
<xsl:value-of select="$lang"/>
<xsl:text>" localization exists.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:variable name="local.context.node"
select="$local.localization.node/l:context[@name=$context]"/>
<xsl:variable name="context.node"
select="key('l10n-context', $context)[1]"/>
<xsl:if test="count($context.node) = 0
and count($local.context.node) = 0
and $verbose != 0">
<xsl:message>
<xsl:text>No context named "</xsl:text>
<xsl:value-of select="$context"/>
<xsl:text>" exists in the "</xsl:text>
<xsl:value-of select="$lang"/>
<xsl:text>" localization.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:variable name="local.template.node"
select="($local.context.node/l:template[@name=$name
and @style
and @style=$xrefstyle]
|$local.context.node/l:template[@name=$name
and not(@style)])[1]"/>
<xsl:for-each select="$context.node">
<xsl:variable name="template.node"
select="(key('l10n-template-style', concat($context, '#', $name, '#', $xrefstyle))
|key('l10n-template', concat($context, '#', $name)))[1]"/>
<xsl:choose>
<xsl:when test="$local.template.node/@text">
<xsl:value-of select="$local.template.node/@text"/>
</xsl:when>
<xsl:when test="$template.node/@text">
<xsl:value-of select="$template.node/@text"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="contains($name, '/')">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="name" select="substring-after($name, '/')"/>
<xsl:with-param name="origname" select="$origname"/>
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="referrer" select="$referrer"/>
<xsl:with-param name="lang" select="$lang"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$verbose = 0">
<!-- silence -->
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>No template for "</xsl:text>
<xsl:value-of select="$origname"/>
<xsl:text>" (or any of its leaves) exists in the context named "</xsl:text>
<xsl:value-of select="$context"/>
<xsl:text>" in the "</xsl:text>
<xsl:value-of select="$lang"/>
<xsl:text>" localization.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- silently test if a gentext template exists -->
<xsl:template name="gentext.template.exists">
<xsl:param name="context" select="'default'"/>
<xsl:param name="name" select="'default'"/>
<xsl:param name="origname" select="$name"/>
<xsl:param name="purpose"/>
<xsl:param name="xrefstyle"/>
<xsl:param name="referrer"/>
<xsl:param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:param>
<xsl:variable name="template">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="name" select="$name"/>
<xsl:with-param name="origname" select="$origname"/>
<xsl:with-param name="purpose" select="$purpose"/>
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
<xsl:with-param name="referrer" select="$referrer"/>
<xsl:with-param name="lang" select="$lang"/>
<xsl:with-param name="verbose" select="0"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($template) != 0">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,903 +0,0 @@
<?xml version='1.0'?>
<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'>
<!-- ********************************************************************
$Id: labels.xsl 9286 2012-04-19 10:10:58Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- label markup -->
<doc:mode mode="label.markup" xmlns="">
<refpurpose>Provides access to element labels</refpurpose>
<refdescription id="label.markup-desc">
<para>Processing an element in the
<literal role="mode">label.markup</literal> mode produces the
element label.</para>
<para>Trailing punctuation is not added to the label.
</para>
</refdescription>
</doc:mode>
<xsl:template match="*" mode="intralabel.punctuation">
<xsl:text>.</xsl:text>
</xsl:template>
<xsl:template match="*" mode="label.markup">
<xsl:param name="verbose" select="1"/>
<xsl:if test="$verbose">
<xsl:message>
<xsl:text>Request for label of unexpected element: </xsl:text>
<xsl:value-of select="local-name(.)"/>
</xsl:message>
</xsl:if>
</xsl:template>
<xsl:template match="set|book" mode="label.markup">
<xsl:if test="@label">
<xsl:value-of select="@label"/>
</xsl:if>
</xsl:template>
<xsl:template match="part" mode="label.markup">
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="string($part.autolabel) != 0">
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$part.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:number from="book" count="part" format="{$format}"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="partintro" mode="label.markup">
<!-- no label -->
</xsl:template>
<xsl:template match="preface" mode="label.markup">
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="string($preface.autolabel) != 0">
<xsl:if test="$component.label.includes.part.label != 0 and
ancestor::part">
<xsl:variable name="part.label">
<xsl:apply-templates select="ancestor::part"
mode="label.markup"/>
</xsl:variable>
<xsl:if test="$part.label != ''">
<xsl:value-of select="$part.label"/>
<xsl:apply-templates select="ancestor::part"
mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$preface.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$label.from.part != 0 and ancestor::part">
<xsl:number from="part" count="preface" format="{$format}" level="any"/>
</xsl:when>
<xsl:otherwise>
<xsl:number from="book" count="preface" format="{$format}" level="any"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="chapter" mode="label.markup">
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="string($chapter.autolabel) != 0">
<xsl:if test="$component.label.includes.part.label != 0 and
ancestor::part">
<xsl:variable name="part.label">
<xsl:apply-templates select="ancestor::part"
mode="label.markup"/>
</xsl:variable>
<xsl:if test="$part.label != ''">
<xsl:value-of select="$part.label"/>
<xsl:apply-templates select="ancestor::part"
mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$chapter.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$label.from.part != 0 and ancestor::part">
<xsl:number from="part" count="chapter" format="{$format}" level="any"/>
</xsl:when>
<xsl:otherwise>
<xsl:number from="book" count="chapter" format="{$format}" level="any"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="appendix" mode="label.markup">
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="string($appendix.autolabel) != 0">
<xsl:if test="$component.label.includes.part.label != 0 and
ancestor::part">
<xsl:variable name="part.label">
<xsl:apply-templates select="ancestor::part"
mode="label.markup"/>
</xsl:variable>
<xsl:if test="$part.label != ''">
<xsl:value-of select="$part.label"/>
<xsl:apply-templates select="ancestor::part"
mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$appendix.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$label.from.part != 0 and ancestor::part">
<xsl:number from="part" count="appendix" format="{$format}" level="any"/>
</xsl:when>
<xsl:otherwise>
<xsl:number from="book|article"
count="appendix" format="{$format}" level="any"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="article" mode="label.markup">
<xsl:if test="@label">
<xsl:value-of select="@label"/>
</xsl:if>
</xsl:template>
<xsl:template match="dedication|colophon" mode="label.markup">
<xsl:if test="@label">
<xsl:value-of select="@label"/>
</xsl:if>
</xsl:template>
<xsl:template match="reference" mode="label.markup">
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="string($reference.autolabel) != 0">
<xsl:if test="$component.label.includes.part.label != 0 and
ancestor::part">
<xsl:variable name="part.label">
<xsl:apply-templates select="ancestor::part"
mode="label.markup"/>
</xsl:variable>
<xsl:if test="$part.label != ''">
<xsl:value-of select="$part.label"/>
<xsl:apply-templates select="ancestor::part"
mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$reference.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$label.from.part != 0 and ancestor::part">
<xsl:number from="part" count="reference" format="{$format}" level="any"/>
</xsl:when>
<xsl:otherwise>
<xsl:number from="book" count="reference" format="{$format}" level="any"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="refentry" mode="label.markup">
<xsl:if test="@label">
<xsl:value-of select="@label"/>
</xsl:if>
</xsl:template>
<xsl:template match="section" mode="label.markup">
<!-- if this is a nested section, label the parent -->
<xsl:if test="local-name(..) = 'section'">
<xsl:variable name="parent.section.label">
<xsl:call-template name="label.this.section">
<xsl:with-param name="section" select=".."/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$parent.section.label != '0'">
<xsl:apply-templates select=".." mode="label.markup"/>
<xsl:apply-templates select=".." mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
<!-- if the parent is a component, maybe label that too -->
<xsl:variable name="parent.is.component">
<xsl:call-template name="is.component">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
</xsl:variable>
<!-- does this section get labelled? -->
<xsl:variable name="label">
<xsl:call-template name="label.this.section">
<xsl:with-param name="section" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$section.label.includes.component.label != 0
and $parent.is.component != 0">
<xsl:variable name="parent.label">
<xsl:apply-templates select=".." mode="label.markup"/>
</xsl:variable>
<xsl:if test="$parent.label != ''">
<xsl:apply-templates select=".." mode="label.markup"/>
<xsl:apply-templates select=".." mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
<!--
<xsl:message>
test: <xsl:value-of select="$label"/>, <xsl:number count="section"/>
</xsl:message>
-->
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="$label != 0">
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$section.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:number format="{$format}" count="section"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="sect1" mode="label.markup">
<!-- if the parent is a component, maybe label that too -->
<xsl:variable name="parent.is.component">
<xsl:call-template name="is.component">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="component.label">
<xsl:if test="$section.label.includes.component.label != 0
and $parent.is.component != 0">
<xsl:variable name="parent.label">
<xsl:apply-templates select=".." mode="label.markup"/>
</xsl:variable>
<xsl:if test="$parent.label != ''">
<xsl:apply-templates select=".." mode="label.markup"/>
<xsl:apply-templates select=".." mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
</xsl:variable>
<xsl:variable name="is.numbered">
<xsl:call-template name="label.this.section"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="$is.numbered != 0">
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$section.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:copy-of select="$component.label"/>
<xsl:number format="{$format}" count="sect1"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="sect2|sect3|sect4|sect5" mode="label.markup">
<!-- label the parent -->
<xsl:variable name="parent.section.label">
<xsl:call-template name="label.this.section">
<xsl:with-param name="section" select=".."/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$parent.section.label != '0'">
<xsl:apply-templates select=".." mode="label.markup"/>
<xsl:apply-templates select=".." mode="intralabel.punctuation"/>
</xsl:if>
<xsl:variable name="is.numbered">
<xsl:call-template name="label.this.section"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="$is.numbered != 0">
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$section.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="local-name(.) = 'sect2'">
<xsl:number format="{$format}" count="sect2"/>
</xsl:when>
<xsl:when test="local-name(.) = 'sect3'">
<xsl:number format="{$format}" count="sect3"/>
</xsl:when>
<xsl:when test="local-name(.) = 'sect4'">
<xsl:number format="{$format}" count="sect4"/>
</xsl:when>
<xsl:when test="local-name(.) = 'sect5'">
<xsl:number format="{$format}" count="sect5"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>label.markup: this can't happen!</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="bridgehead" mode="label.markup">
<!-- FIXME: could we do a better job here? -->
<xsl:variable name="contsec"
select="(ancestor::section
|ancestor::simplesect
|ancestor::topic
|ancestor::sect1
|ancestor::sect2
|ancestor::sect3
|ancestor::sect4
|ancestor::sect5
|ancestor::refsect1
|ancestor::refsect2
|ancestor::refsect3
|ancestor::chapter
|ancestor::appendix
|ancestor::preface)[last()]"/>
<xsl:apply-templates select="$contsec" mode="label.markup"/>
</xsl:template>
<xsl:template match="refsect1" mode="label.markup">
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="$section.autolabel != 0">
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$section.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:number count="refsect1" format="{$format}"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="refsect2|refsect3" mode="label.markup">
<!-- label the parent -->
<xsl:variable name="parent.label">
<xsl:apply-templates select=".." mode="label.markup"/>
</xsl:variable>
<xsl:if test="$parent.label != ''">
<xsl:apply-templates select=".." mode="label.markup"/>
<xsl:apply-templates select=".." mode="intralabel.punctuation"/>
</xsl:if>
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="$section.autolabel != 0">
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$section.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="local-name(.) = 'refsect2'">
<xsl:number count="refsect2" format="{$format}"/>
</xsl:when>
<xsl:otherwise>
<xsl:number count="refsect3" format="{$format}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="simplesect" mode="label.markup">
<!-- if this is a nested section, label the parent -->
<xsl:if test="local-name(..) = 'section'
or local-name(..) = 'sect1'
or local-name(..) = 'sect2'
or local-name(..) = 'sect3'
or local-name(..) = 'sect4'
or local-name(..) = 'sect5'">
<xsl:variable name="parent.section.label">
<xsl:apply-templates select=".." mode="label.markup"/>
</xsl:variable>
<xsl:if test="$parent.section.label != ''">
<xsl:apply-templates select=".." mode="label.markup"/>
<xsl:apply-templates select=".." mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
<!-- if the parent is a component, maybe label that too -->
<xsl:variable name="parent.is.component">
<xsl:call-template name="is.component">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
</xsl:variable>
<!-- does this section get labelled? -->
<xsl:variable name="label">
<xsl:call-template name="label.this.section">
<xsl:with-param name="section" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$section.label.includes.component.label != 0
and $parent.is.component != 0">
<xsl:variable name="parent.label">
<xsl:apply-templates select=".." mode="label.markup"/>
</xsl:variable>
<xsl:if test="$parent.label != ''">
<xsl:apply-templates select=".." mode="label.markup"/>
<xsl:apply-templates select=".." mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="$label != 0">
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$section.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:number format="{$format}" count="simplesect"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="topic" mode="label.markup">
<!-- topics are not numbered by default -->
</xsl:template>
<xsl:template match="qandadiv" mode="label.markup">
<xsl:variable name="lparent" select="(ancestor::set
|ancestor::book
|ancestor::chapter
|ancestor::appendix
|ancestor::preface
|ancestor::section
|ancestor::simplesect
|ancestor::sect1
|ancestor::sect2
|ancestor::sect3
|ancestor::sect4
|ancestor::sect5
|ancestor::refsect1
|ancestor::refsect2
|ancestor::refsect3)[last()]"/>
<xsl:variable name="lparent.prefix">
<xsl:apply-templates select="$lparent" mode="label.markup"/>
</xsl:variable>
<xsl:variable name="prefix">
<xsl:if test="$qanda.inherit.numeration != 0">
<xsl:if test="$lparent.prefix != ''">
<xsl:apply-templates select="$lparent" mode="label.markup"/>
<xsl:apply-templates select="$lparent" mode="intralabel.punctuation"/>
</xsl:if>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="$qandadiv.autolabel != 0">
<xsl:variable name="format">
<xsl:call-template name="autolabel.format">
<xsl:with-param name="format" select="$qandadiv.autolabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$prefix"/>
<xsl:number level="multiple" count="qandadiv" format="{$format}"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="question|answer" mode="label.markup">
<xsl:variable name="lparent" select="(ancestor::set
|ancestor::book
|ancestor::chapter
|ancestor::appendix
|ancestor::preface
|ancestor::section
|ancestor::simplesect
|ancestor::sect1
|ancestor::sect2
|ancestor::sect3
|ancestor::sect4
|ancestor::sect5
|ancestor::refsect1
|ancestor::refsect2
|ancestor::refsect3)[last()]"/>
<xsl:variable name="lparent.prefix">
<xsl:apply-templates select="$lparent" mode="label.markup"/>
</xsl:variable>
<xsl:variable name="prefix">
<xsl:if test="$qanda.inherit.numeration != 0">
<xsl:choose>
<xsl:when test="ancestor::qandadiv">
<xsl:variable name="div.label">
<xsl:apply-templates select="ancestor::qandadiv[1]" mode="label.markup"/>
</xsl:variable>
<xsl:if test="string-length($div.label) != 0">
<xsl:copy-of select="$div.label"/>
<xsl:apply-templates select="ancestor::qandadiv[1]"
mode="intralabel.punctuation"/>
</xsl:if>
</xsl:when>
<xsl:when test="$lparent.prefix != ''">
<xsl:apply-templates select="$lparent" mode="label.markup"/>
<xsl:apply-templates select="$lparent" mode="intralabel.punctuation"/>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:variable>
<xsl:variable name="inhlabel"
select="ancestor-or-self::qandaset/@defaultlabel[1]"/>
<xsl:variable name="deflabel">
<xsl:choose>
<xsl:when test="$inhlabel != ''">
<xsl:value-of select="$inhlabel"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$qanda.defaultlabel"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="label" select="label"/>
<xsl:choose>
<xsl:when test="count($label)>0">
<xsl:apply-templates select="$label"/>
</xsl:when>
<xsl:when test="$deflabel = 'qanda' and self::question">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Question'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$deflabel = 'qanda' and self::answer">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Answer'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="($deflabel = 'qnumber' or
$deflabel = 'qnumberanda') and self::question">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Question'"/>
</xsl:call-template>
<xsl:text>&#xA0;</xsl:text>
<xsl:value-of select="$prefix"/>
<xsl:number level="multiple" count="qandaentry" format="1"/>
</xsl:when>
<xsl:when test="$deflabel = 'qnumberanda' and self::answer">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Answer'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$deflabel = 'number' and self::question">
<xsl:value-of select="$prefix"/>
<xsl:number level="multiple" count="qandaentry" format="1"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="bibliography|glossary|
qandaset|index|setindex" mode="label.markup">
<xsl:if test="@label">
<xsl:value-of select="@label"/>
</xsl:if>
</xsl:template>
<xsl:template match="figure|table|example" mode="label.markup">
<xsl:variable name="pchap"
select="(ancestor::chapter
|ancestor::appendix
|ancestor::article[ancestor::book])[last()]"/>
<xsl:variable name="prefix">
<xsl:if test="count($pchap) &gt; 0">
<xsl:apply-templates select="$pchap" mode="label.markup"/>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$prefix != ''">
<xsl:apply-templates select="$pchap" mode="label.markup"/>
<xsl:apply-templates select="$pchap" mode="intralabel.punctuation"/>
<xsl:number format="1" from="chapter|appendix" level="any"/>
</xsl:when>
<xsl:otherwise>
<xsl:number format="1" from="book|article" level="any"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="procedure" mode="label.markup">
<xsl:variable name="pchap"
select="ancestor::chapter
|ancestor::appendix
|ancestor::article[ancestor::book]"/>
<xsl:variable name="prefix">
<xsl:if test="count($pchap) &gt; 0">
<xsl:apply-templates select="$pchap" mode="label.markup"/>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="$formal.procedures = 0">
<!-- No label -->
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="count($pchap)>0">
<xsl:if test="$prefix != ''">
<xsl:apply-templates select="$pchap" mode="label.markup"/>
<xsl:apply-templates select="$pchap" mode="intralabel.punctuation"/>
</xsl:if>
<xsl:number count="procedure[title]" format="1"
from="chapter|appendix" level="any"/>
</xsl:when>
<xsl:otherwise>
<xsl:number count="procedure[title]" format="1"
from="book|article" level="any"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="equation" mode="label.markup">
<xsl:variable name="pchap"
select="ancestor::chapter
|ancestor::appendix
|ancestor::article[ancestor::book]"/>
<xsl:variable name="prefix">
<xsl:if test="count($pchap) &gt; 0">
<xsl:apply-templates select="$pchap" mode="label.markup"/>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="count($pchap)>0">
<xsl:if test="$prefix != ''">
<xsl:apply-templates select="$pchap" mode="label.markup"/>
<xsl:apply-templates select="$pchap" mode="intralabel.punctuation"/>
</xsl:if>
<xsl:number format="1" count="equation"
from="chapter|appendix" level="any"/>
</xsl:when>
<xsl:otherwise>
<xsl:number format="1" count="equation"
from="book|article" level="any"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="orderedlist/listitem" mode="label.markup">
<xsl:variable name="numeration">
<xsl:call-template name="list.numeration">
<xsl:with-param name="node" select="parent::orderedlist"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="type">
<xsl:choose>
<xsl:when test="$numeration='arabic'">1</xsl:when>
<xsl:when test="$numeration='loweralpha'">a</xsl:when>
<xsl:when test="$numeration='lowerroman'">i</xsl:when>
<xsl:when test="$numeration='upperalpha'">A</xsl:when>
<xsl:when test="$numeration='upperroman'">I</xsl:when>
<!-- What!? This should never happen -->
<xsl:otherwise>
<xsl:message>
<xsl:text>Unexpected numeration: </xsl:text>
<xsl:value-of select="$numeration"/>
</xsl:message>
<xsl:value-of select="1."/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="item-number">
<xsl:call-template name="orderedlist-item-number"/>
</xsl:variable>
<xsl:number value="$item-number" format="{$type}"/>
</xsl:template>
<xsl:template match="abstract" mode="label.markup">
<!-- nop -->
</xsl:template>
<xsl:template match="sidebar" mode="label.markup">
<!-- nop -->
</xsl:template>
<xsl:template match="glossdiv|glosslist" mode="label.markup">
<!-- nop -->
</xsl:template>
<xsl:template match="glossentry" mode="label.markup">
<!-- nop -->
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="label.this.section">
<xsl:param name="section" select="."/>
<xsl:variable name="level">
<xsl:call-template name="section.level"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$level &lt;= $section.autolabel.max.depth">
<xsl:value-of select="$section.autolabel"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<doc:template name="label.this.section" xmlns="">
<refpurpose>Returns true if $section should be labelled</refpurpose>
<refdescription id="label.this.section-desc">
<para>Returns true if the specified section should be labelled.
By default, this template returns zero unless
the section level is less than or equal to the value of the
<literal>$section.autolabel.max.depth</literal> parameter, in
which case it returns
<literal>$section.autolabel</literal>.
Custom stylesheets may override it to get more selective behavior.</para>
</refdescription>
</doc:template>
<!-- ============================================================ -->
<xsl:template name="default.autolabel.format">
<xsl:param name="context" select="."/>
<xsl:choose>
<xsl:when test="local-name($context) = 'appendix'">
<xsl:value-of select="'A'"/>
</xsl:when>
<xsl:when test="local-name($context) = 'part'">
<xsl:value-of select="'I'"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="autolabel.format">
<xsl:param name="context" select="."/>
<xsl:param name="format"/>
<xsl:choose>
<xsl:when test="string($format) != 0">
<xsl:choose>
<xsl:when test="string($format)='arabic' or $format='1'">1</xsl:when>
<xsl:when test="$format='loweralpha' or $format='a'">
<xsl:value-of select="'a'"/>
</xsl:when>
<xsl:when test="$format='lowerroman' or $format='i'">
<xsl:value-of select="'i'"/>
</xsl:when>
<xsl:when test="$format='upperalpha' or $format='A'">
<xsl:value-of select="'A'"/>
</xsl:when>
<xsl:when test="$format='upperroman' or $format='I'">
<xsl:value-of select="'I'"/>
</xsl:when>
<xsl:when test="$format='arabicindic' or $format='&#x661;'">
<xsl:value-of select="'&#x661;'"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Unexpected </xsl:text><xsl:value-of select="local-name(.)"/><xsl:text>.autolabel value: </xsl:text>
<xsl:value-of select="$format"/><xsl:text>; using default.</xsl:text>
</xsl:message>
<xsl:call-template name="default.autolabel.format"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<doc:template name="autolabel.format" xmlns="">
<refpurpose>Returns format for autolabel parameters</refpurpose>
<refdescription id="autolabel.format-desc">
<para>Returns format passed as parameter if non zero. Supported
format are 'arabic' or '1', 'loweralpha' or 'a', 'lowerroman' or 'i',
'upperlapha' or 'A', 'upperroman' or 'I', 'arabicindic' or '&#x661;'.
If its not one of these then
returns the default format.</para>
</refdescription>
</doc:template>
<!-- ============================================================ -->
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@ -1,346 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:exsl="http://exslt.org/common"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="doc date exsl"
extension-element-prefixes="date exsl"
version='1.0'>
<!-- ********************************************************************
$Id: pi.xsl 8782 2010-07-27 21:15:17Z mzjn $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<doc:reference xmlns=""><info><title>Common Processing Instruction Reference</title>
<releaseinfo role="meta">
$Id: pi.xsl 8782 2010-07-27 21:15:17Z mzjn $
</releaseinfo>
</info>
<partintro id="partintro">
<title>Introduction</title>
<para>This is generated reference documentation for all
user-specifiable processing instructions (PIs) in the
“common” part of the DocBook XSL stylesheets.
<note>
<para>You add these PIs at particular points in a document to
cause specific “exceptions” to formatting/output behavior. To
make global changes in formatting/output behavior across an
entire document, its better to do it by setting an
appropriate stylesheet parameter (if there is one).</para>
</note>
</para>
</partintro>
</doc:reference>
<!-- ==================================================================== -->
<doc:pi name="dbchoice_choice" xmlns="">
<refpurpose>Generates a localized choice separator</refpurpose>
<refdescription id="select.choice.separator-desc">
<para>Use the <tag class="xmlpi">dbchoice choice</tag> PI to
generate an appropriate localized “choice” separator (for
example, <literal>and</literal> or <literal>or</literal>)
before the final item in an inline <tag>simplelist</tag></para>
<warning>
<para>This PI is a less-than-ideal hack; support for it may
disappear in the future (particularly if and when a more
appropriate means for marking up "choice" lists becomes
available in DocBook).</para>
</warning>
</refdescription>
<refsynopsisdiv>
<synopsis><tag class="xmlpi">dbchoice choice="and"|"or"|<replaceable>string</replaceable>"</tag></synopsis>
</refsynopsisdiv>
<refparameter>
<variablelist>
<varlistentry><term>choice="and"</term>
<listitem>
<para>generates a localized <literal>and</literal> separator</para>
</listitem>
</varlistentry>
<varlistentry><term>choice="or"</term>
<listitem>
<para>generates a localized <literal>or</literal> separator</para>
</listitem>
</varlistentry>
<varlistentry><term>choice="<replaceable>string</replaceable>"</term>
<listitem>
<para>generates a literal <replaceable>string</replaceable> separator</para>
</listitem>
</varlistentry>
</variablelist>
</refparameter>
</doc:pi>
<xsl:template name="pi.dbchoice_choice">
<xsl:param name="node" select="."/>
<xsl:call-template name="pi-attribute">
<xsl:with-param name="pis" select="$node/processing-instruction('dbchoice')"/>
<xsl:with-param name="attribute">choice</xsl:with-param>
</xsl:call-template>
</xsl:template>
<doc:pi name="dbtimestamp" xmlns="">
<refpurpose>Inserts a date timestamp</refpurpose>
<refdescription>
<para>Use the <tag class="xmlpi">dbtimestamp</tag> PI at any point in a
source document to cause a date timestamp (a formatted
string representing the current date and time) to be
inserted in output of the document.</para>
</refdescription>
<refsynopsisdiv>
<synopsis><tag class="xmlpi">dbtimestamp format="<replaceable>formatstring</replaceable>" [padding="0"|"1"]</tag></synopsis>
</refsynopsisdiv>
<refparameter>
<variablelist>
<varlistentry><term>format="<replaceable>formatstring</replaceable>"</term>
<listitem>
<para>Specifies format in which the date and time are
output</para>
<note>
<para>For details of the content of the format string,
see <link role="tcg" xlink:href="Datetime.html"
>Date and time</link>.</para>
</note>
</listitem>
</varlistentry>
<varlistentry><term>padding="0"|"1"</term>
<listitem>
<para>Specifies padding behavior; if non-zero, padding is is added</para>
</listitem>
</varlistentry>
</variablelist>
</refparameter>
</doc:pi>
<xsl:template name="pi.dbtimestamp">
<xsl:variable name="format">
<xsl:variable name="pi-format">
<xsl:call-template name="pi-attribute">
<xsl:with-param name="pis" select="."/>
<xsl:with-param name="attribute">format</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$pi-format != ''">
<xsl:value-of select="$pi-format"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'datetime'"/>
<xsl:with-param name="name" select="'format'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="padding">
<xsl:variable name="pi-padding">
<xsl:call-template name="pi-attribute">
<xsl:with-param name="pis" select="."/>
<xsl:with-param name="attribute">padding</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$pi-padding != ''">
<xsl:value-of select="$pi-padding"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="date">
<xsl:choose>
<xsl:when test="function-available('date:date-time')">
<xsl:value-of select="date:date-time()"/>
</xsl:when>
<xsl:when test="function-available('date:dateTime')">
<!-- Xalan quirk -->
<xsl:value-of select="date:dateTime()"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="function-available('date:date-time') or
function-available('date:dateTime')">
<xsl:call-template name="datetime.format">
<xsl:with-param name="date" select="$date"/>
<xsl:with-param name="format" select="$format"/>
<xsl:with-param name="padding" select="$padding"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:message>
Timestamp processing requires XSLT processor with EXSLT date support.
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<doc:pi name="dbtex_delims" xmlns="">
<refpurpose>Generates delimiters around embedded TeX equations
in output</refpurpose>
<refdescription>
<para>Use the <tag class="xmlpi">dbtex delims</tag> PI as a
child of a <tag>textobject</tag> containing embedded TeX
markup, to cause that markup to be surrounded by
<literal>$</literal> delimiter characters in output.</para>
<warning>
<para>This feature is useful for print/PDF output only if you
use the obsolete and now unsupported PassiveTeX XSL-FO
engine.</para>
</warning>
</refdescription>
<refsynopsisdiv>
<synopsis><tag class="xmlpi">dbtex delims="no"|"yes"</tag></synopsis>
</refsynopsisdiv>
<refparameter>
<variablelist>
<varlistentry><term>dbtex delims="no"|"yes"</term>
<listitem>
<para>Specifies whether delimiters are output</para>
</listitem>
</varlistentry>
</variablelist>
</refparameter>
<refsee role="params">
<para><parameter>tex.math.delims</parameter></para>
</refsee>
</doc:pi>
<xsl:template name="pi.dbtex_delims">
<xsl:param name="node" select="."/>
<xsl:call-template name="pi-attribute">
<xsl:with-param name="pis" select="$node/processing-instruction('dbtex')"/>
<xsl:with-param name="attribute" select="'delims'"/>
</xsl:call-template>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="processing-instruction()" mode="titlepage.mode">
<!-- * Als process PIs on title pages -->
<xsl:apply-templates select="."/>
</xsl:template>
<xsl:template match="processing-instruction('dbtimestamp')">
<xsl:call-template name="pi.dbtimestamp"/>
</xsl:template>
<xsl:template name="datetime.format">
<xsl:param name="date"/>
<xsl:param name="format"/>
<xsl:param name="padding" select="1"/>
<xsl:if test="$format != ''">
<!-- replace any whitespace in the format string with a non-breaking space -->
<xsl:variable name="format-nbsp"
select="translate($format,
'&#x20;&#x9;&#xd;&#xa;',
'&#xa0;&#xa0;&#xa0;&#xa0;')"/>
<xsl:variable name="tokenized-format-string">
<xsl:call-template name="str.tokenize.keep.delimiters">
<xsl:with-param name="string" select="$format-nbsp"/>
<xsl:with-param name="delimiters" select="'&#xa0;,./-()[]:'"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$exsl.node.set.available != 0">
<!-- We must preserve context node in order to get valid language -->
<xsl:variable name="context" select="."/>
<xsl:for-each select="exsl:node-set($tokenized-format-string)/node()">
<xsl:variable name="token">
<xsl:value-of select="."/>
</xsl:variable>
<!-- Restore context node -->
<xsl:for-each select="$context">
<xsl:choose>
<xsl:when test="$token = 'a'">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'datetime-abbrev'"/>
<xsl:with-param name="name" select="date:day-abbreviation($date)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$token = 'A'">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'datetime-full'"/>
<xsl:with-param name="name" select="date:day-name($date)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$token = 'b'">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'datetime-abbrev'"/>
<xsl:with-param name="name" select="date:month-abbreviation($date)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$token = 'c'">
<xsl:value-of select="date:date($date)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="date:time($date)"/>
</xsl:when>
<xsl:when test="$token = 'B'">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'datetime-full'"/>
<xsl:with-param name="name" select="date:month-name($date)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$token = 'd'">
<xsl:if test="$padding = 1 and
string-length(date:day-in-month($date)) = 1">0</xsl:if>
<xsl:value-of select="date:day-in-month($date)"/>
</xsl:when>
<xsl:when test="$token = 'H'">
<xsl:if test="$padding = 1 and string-length(date:hour-in-day($date)) = 1">0</xsl:if>
<xsl:value-of select="date:hour-in-day($date)"/>
</xsl:when>
<xsl:when test="$token = 'j'">
<xsl:value-of select="date:day-in-year($date)"/>
</xsl:when>
<xsl:when test="$token = 'm'">
<xsl:if test="$padding = 1 and string-length(date:month-in-year($date)) = 1">0</xsl:if>
<xsl:value-of select="date:month-in-year($date)"/>
</xsl:when>
<xsl:when test="$token = 'M'">
<xsl:if test="string-length(date:minute-in-hour($date)) = 1">0</xsl:if>
<xsl:value-of select="date:minute-in-hour($date)"/>
</xsl:when>
<xsl:when test="$token = 'S'">
<xsl:if test="string-length(date:second-in-minute($date)) = 1">0</xsl:if>
<xsl:value-of select="date:second-in-minute($date)"/>
</xsl:when>
<xsl:when test="$token = 'U'">
<xsl:value-of select="date:week-in-year($date)"/>
</xsl:when>
<xsl:when test="$token = 'w'">
<xsl:value-of select="date:day-in-week($date)"/>
</xsl:when>
<xsl:when test="$token = 'x'">
<xsl:value-of select="date:date($date)"/>
</xsl:when>
<xsl:when test="$token = 'X'">
<xsl:value-of select="date:time($date)"/>
</xsl:when>
<xsl:when test="$token = 'Y'">
<xsl:value-of select="date:year($date)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$token"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:message>
Timestamp processing requires an XSLT processor with support
for the EXSLT node-set() function.
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,372 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ng="http://docbook.org/docbook-ng"
xmlns:db="http://docbook.org/ns/docbook"
xmlns:saxon="http://icl.com/saxon"
xmlns:NodeInfo="http://org.apache.xalan.lib.NodeInfo"
xmlns:exsl="http://exslt.org/common"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="db ng exsl saxon NodeInfo xlink"
version='1.0'>
<!-- ********************************************************************
$Id: stripns.xsl 9016 2011-06-07 12:09:34Z nwalsh $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- put an xml:base attribute on the root element -->
<xsl:template match="/*" mode="stripNS">
<xsl:choose>
<xsl:when test="self::ng:* or self::db:*">
<xsl:element name="{local-name(.)}">
<xsl:copy-of select="@*[not(name(.) = 'xml:id')
and not(name(.) = 'version')]"/>
<xsl:if test="@xml:id">
<xsl:attribute name="id">
<xsl:value-of select="@xml:id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="add-xml-base"/>
<xsl:apply-templates mode="stripNS"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:copy-of select="@*[not(name(.) = 'xml:id')
and not(name(.) = 'version')]"/>
<xsl:if test="@xml:id">
<xsl:attribute name="id">
<xsl:value-of select="@xml:id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="add-xml-base"/>
<xsl:apply-templates mode="stripNS"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="stripNS">
<xsl:choose>
<xsl:when test="self::ng:* or self::db:*">
<xsl:element name="{local-name(.)}">
<xsl:copy-of select="@*[not(name(.) = 'xml:id')
and not(name(.) = 'version')]"/>
<xsl:if test="@xml:id">
<xsl:attribute name="id">
<xsl:value-of select="@xml:id"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates mode="stripNS"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:copy-of select="@*[not(name(.) = 'xml:id')
and not(name(.) = 'version')]"/>
<xsl:if test="@xml:id">
<xsl:attribute name="id">
<xsl:value-of select="@xml:id"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates mode="stripNS"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="db:info" mode="stripNS">
<xsl:variable name="info">
<xsl:choose>
<xsl:when test="parent::db:article
|parent::db:appendix
|parent::db:bibliography
|parent::db:book
|parent::db:chapter
|parent::db:glossary
|parent::db:index
|parent::db:part
|parent::db:preface
|parent::db:refentry
|parent::db:reference
|parent::db:refsect1
|parent::db:refsect2
|parent::db:refsect3
|parent::db:refsection
|parent::db:refsynopsisdiv
|parent::db:sect1
|parent::db:sect2
|parent::db:sect3
|parent::db:sect4
|parent::db:sect5
|parent::db:section
|parent::db:setindex
|parent::db:set
|parent::db:slides
|parent::db:sidebar">
<xsl:value-of select="local-name(parent::*)"/>
<xsl:text>info</xsl:text>
</xsl:when>
<xsl:when test="parent::db:audioobject
|parent::db:imageobject
|parent::db:inlinemediaobject
|parent::db:mediaobject
|parent::db:mediaobjectco
|parent::db:textobject
|parent::db:videoobject">
<xsl:text>objectinfo</xsl:text>
</xsl:when>
<xsl:otherwise>blockinfo</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="{$info}">
<xsl:copy-of select="@*[not(name(.) = 'xml:id')
and not(name(.) = 'version')]"/>
<xsl:if test="@xml:id">
<xsl:attribute name="id">
<xsl:value-of select="@xml:id"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates mode="stripNS"/>
</xsl:element>
<xsl:if test="(not(../db:title) and not(../ng:title))
and ($info = 'prefaceinfo'
or $info = 'chapterinfo'
or $info = 'sectioninfo'
or $info = 'sect1info'
or $info = 'sect2info'
or $info = 'sect3info'
or $info = 'sect4info'
or $info = 'sect5info'
or $info = 'refsectioninfo'
or $info = 'refsect1info'
or $info = 'refsect2info'
or $info = 'refsect3info'
or $info = 'blockinfo'
or $info = 'appendixinfo')">
<xsl:apply-templates select="db:title|ng:title" mode="stripNS"/>
</xsl:if>
</xsl:template>
<xsl:template match="ng:tag|db:tag" mode="stripNS">
<xsl:choose>
<xsl:when test="@xlink:href">
<ulink url="{@xlink:href}">
<sgmltag>
<xsl:copy-of select="@*[not(name(.) = 'xml:id')
and not(name(.) = 'version')
and not(local-name(.) = 'href')]"/>
<xsl:if test="@xml:id">
<xsl:attribute name="id">
<xsl:value-of select="@xml:id"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates mode="stripNS"/>
</sgmltag>
</ulink>
</xsl:when>
<xsl:otherwise>
<sgmltag>
<xsl:copy-of select="@*[not(name(.) = 'xml:id')
and not(name(.) = 'version')]"/>
<xsl:if test="@xml:id">
<xsl:attribute name="id">
<xsl:value-of select="@xml:id"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates mode="stripNS"/>
</sgmltag>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="db:link[@xlink:href]" mode="stripNS">
<ulink url="{@xlink:href}">
<xsl:if test="@role">
<xsl:attribute name="role">
<xsl:value-of select="@role"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates mode="stripNS"/>
</ulink>
</xsl:template>
<xsl:template match="db:citetitle[@xlink:href]" mode="stripNS">
<ulink url="{@xlink:href}">
<citetitle>
<xsl:copy-of select="@*[not(name(.) = 'xml:id')
and not(name(.) = 'version')
and not(local-name(.) = 'href')]"/>
<xsl:if test="@xml:id">
<xsl:attribute name="id">
<xsl:value-of select="@xml:id"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates mode="stripNS"/>
</citetitle>
</ulink>
</xsl:template>
<xsl:template match="db:citetitle[@linkend]" mode="stripNS">
<citetitle>
<xsl:copy-of select="@*[not(name(.) = 'xml:id')
and not(name(.) = 'version')
and not(name(.) = 'linkend')
and not(local-name(.) = 'href')]"/>
<xsl:if test="@xml:id">
<xsl:attribute name="id">
<xsl:value-of select="@xml:id"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates mode="stripNS"/>
</citetitle>
</xsl:template>
<xsl:template match="db:alt" mode="stripNS"/>
<xsl:template match="ng:textdata|db:textdata
|ng:imagedata|db:imagedata
|ng:videodata|db:videodata
|ng:audiodata|db:audiodata" mode="stripNS">
<xsl:element name="{local-name(.)}">
<xsl:copy-of select="@*[not(name(.) = 'xml:id')
and not(name(.) = 'version')
and not(name(.) = 'entityref')]"/>
<xsl:if test="@xml:id">
<xsl:attribute name="id">
<xsl:value-of select="@xml:id"/>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="@entityref">
<xsl:attribute name="fileref">
<xsl:value-of select="unparsed-entity-uri(@entityref)"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:apply-templates mode="stripNS"/>
</xsl:element>
</xsl:template>
<xsl:template name="add-xml-base">
<xsl:if test="not(@xml:base)">
<xsl:variable name="base">
<xsl:choose>
<xsl:when test="function-available('saxon:systemId')">
<xsl:value-of select="saxon:systemId()"/>
</xsl:when>
<xsl:when test="function-available('NodeInfo:systemId')">
<xsl:value-of select="NodeInfo:systemId()"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>WARNING: cannot add @xml:base to node </xsl:text>
<xsl:text>set root element. </xsl:text>
<xsl:text>Relative paths may not work.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- debug
<xsl:message>base is <xsl:value-of select="$base"/></xsl:message>
-->
<xsl:if test="$base != ''">
<xsl:attribute name="xml:base">
<xsl:call-template name="systemIdToBaseURI">
<xsl:with-param name="systemId">
<!-- file: seems to confuse some processors. -->
<xsl:choose>
<!-- however, windows paths must use file:///c:/path -->
<xsl:when test="starts-with($base, 'file:///') and
substring($base, 10, 1) = ':'">
<xsl:value-of select="$base"/>
</xsl:when>
<xsl:when test="starts-with($base, 'file:/')
and substring($base, 8, 1) = ':'">
<xsl:value-of select="concat('file:///',
substring-after($base,'file:/'))"/>
</xsl:when>
<xsl:when test="starts-with($base, 'file:///')">
<xsl:value-of select="substring-after($base,'file://')"/>
</xsl:when>
<xsl:when test="starts-with($base, 'file://')">
<xsl:value-of select="substring-after($base,'file:/')"/>
</xsl:when>
<xsl:when test="starts-with($base, 'file:/')">
<xsl:value-of select="substring-after($base,'file:')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$base"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:attribute>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template name="systemIdToBaseURI">
<xsl:param name="systemId" select="''"/>
<xsl:if test="contains($systemId,'/')">
<xsl:value-of select="substring-before($systemId,'/')"/>
<xsl:text>/</xsl:text>
<xsl:call-template name="systemIdToBaseURI">
<xsl:with-param name="systemId"
select="substring-after($systemId,'/')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="comment()|processing-instruction()|text()" mode="stripNS">
<xsl:copy/>
</xsl:template>
<xsl:template match="/" priority="-1">
<!-- need a local version of this variable because this module imported many places-->
<xsl:variable name="local.exsl.node.set.available">
<xsl:choose>
<xsl:when exsl:foo="" xmlns:exsl="http://exslt.org/common"
test="function-available('exsl:node-set') or
contains(system-property('xsl:vendor'),
'Apache Software Foundation')">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$local.exsl.node.set.available != 0
and (*/self::ng:* or */self::db:*)">
<xsl:message>
<xsl:text>Stripping namespace from DocBook 5 document. </xsl:text>
<xsl:text>It is suggested to use namespaced version of the stylesheets </xsl:text>
<xsl:text>available in distribution file 'docbook-xsl-ns' </xsl:text>
<xsl:text>at //http://sourceforge.net/projects/docbook/files/</xsl:text>
<xsl:text> which does not require namespace stripping step.</xsl:text>
</xsl:message>
<xsl:variable name="nons">
<xsl:apply-templates mode="stripNS"/>
</xsl:variable>
<xsl:message>Processing stripped document.</xsl:message>
<xsl:apply-templates select="exsl:node-set($nons)"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="node()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,180 +0,0 @@
<?xml version='1.0'?>
<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'>
<!-- ********************************************************************
$Id: subtitles.xsl 9286 2012-04-19 10:10:58Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- subtitle markup -->
<doc:mode mode="subtitle.markup" xmlns="">
<refpurpose>Provides access to element subtitles</refpurpose>
<refdescription id="subtitle.markup-desc">
<para>Processing an element in the
<literal role="mode">subtitle.markup</literal> mode produces the
subtitle of the element.
</para>
</refdescription>
</doc:mode>
<xsl:template match="*" mode="subtitle.markup">
<xsl:param name="verbose" select="1"/>
<xsl:if test="$verbose != 0">
<xsl:message>
<xsl:text>Request for subtitle of unexpected element: </xsl:text>
<xsl:value-of select="local-name(.)"/>
</xsl:message>
<xsl:text>???SUBTITLE???</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="subtitle" mode="subtitle.markup">
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="verbose" select="1"/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="set" mode="subtitle.markup">
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="verbose" select="1"/>
<xsl:apply-templates select="(setinfo/subtitle|info/subtitle|subtitle)[1]"
mode="subtitle.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="book" mode="subtitle.markup">
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="verbose" select="1"/>
<xsl:apply-templates select="(bookinfo/subtitle|info/subtitle|subtitle)[1]"
mode="subtitle.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="part" mode="subtitle.markup">
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="verbose" select="1"/>
<xsl:apply-templates select="(partinfo/subtitle
|docinfo/subtitle
|info/subtitle
|subtitle)[1]"
mode="subtitle.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="preface|chapter|appendix" mode="subtitle.markup">
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="verbose" select="1"/>
<xsl:apply-templates select="(docinfo/subtitle
|info/subtitle
|prefaceinfo/subtitle
|chapterinfo/subtitle
|appendixinfo/subtitle
|subtitle)[1]"
mode="subtitle.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="article" mode="subtitle.markup">
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="verbose" select="1"/>
<xsl:apply-templates select="(artheader/subtitle
|articleinfo/subtitle
|info/subtitle
|subtitle)[1]"
mode="subtitle.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="dedication|colophon" mode="subtitle.markup">
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="verbose" select="1"/>
<xsl:apply-templates select="(subtitle|info/subtitle)[1]"
mode="subtitle.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="reference" mode="subtitle.markup">
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="verbose" select="1"/>
<xsl:apply-templates select="(referenceinfo/subtitle
|docinfo/subtitle
|info/subtitle
|subtitle)[1]"
mode="subtitle.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="qandaset" mode="subtitle.markup">
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="verbose" select="1"/>
<xsl:apply-templates select="(blockinfo/subtitle|info/subtitle)[1]"
mode="subtitle.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="refentry" mode="subtitle.markup">
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="verbose" select="1"/>
<xsl:apply-templates select="(refentryinfo/subtitle
|info/subtitle
|docinfo/subtitle)[1]"
mode="subtitle.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="section
|sect1|sect2|sect3|sect4|sect5
|refsect1|refsect2|refsect3
|topic
|simplesect"
mode="subtitle.markup">
<xsl:param name="allow-anchors" select="'0'"/>
<xsl:param name="verbose" select="1"/>
<xsl:apply-templates select="(info/subtitle
|sectioninfo/subtitle
|sect1info/subtitle
|sect2info/subtitle
|sect3info/subtitle
|sect4info/subtitle
|sect5info/subtitle
|refsect1info/subtitle
|refsect2info/subtitle
|refsect3info/subtitle
|subtitle)[1]"
mode="subtitle.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,514 +0,0 @@
<?xml version="1.0"?>
<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">
<!-- ********************************************************************
$Id: table.xsl 8392 2009-04-01 08:47:55Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template name="blank.spans">
<xsl:param name="cols" select="1"/>
<xsl:if test="$cols &gt; 0">
<xsl:text>0:</xsl:text>
<xsl:call-template name="blank.spans">
<xsl:with-param name="cols" select="$cols - 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="calculate.following.spans">
<xsl:param name="colspan" select="1"/>
<xsl:param name="spans" select="''"/>
<xsl:choose>
<xsl:when test="$colspan &gt; 0">
<xsl:call-template name="calculate.following.spans">
<xsl:with-param name="colspan" select="$colspan - 1"/>
<xsl:with-param name="spans" select="substring-after($spans,':')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$spans"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="finaltd">
<xsl:param name="spans"/>
<xsl:param name="col" select="0"/>
<xsl:if test="$spans != ''">
<xsl:choose>
<xsl:when test="starts-with($spans,'0:')">
<xsl:call-template name="empty.table.cell">
<xsl:with-param name="colnum" select="$col"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
<xsl:call-template name="finaltd">
<xsl:with-param name="spans" select="substring-after($spans,':')"/>
<xsl:with-param name="col" select="$col+1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="sfinaltd">
<xsl:param name="spans"/>
<xsl:if test="$spans != ''">
<xsl:choose>
<xsl:when test="starts-with($spans,'0:')">0:</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring-before($spans,':')-1"/>
<xsl:text>:</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="sfinaltd">
<xsl:with-param name="spans" select="substring-after($spans,':')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="entry.colnum">
<xsl:param name="entry" select="."/>
<xsl:choose>
<xsl:when test="$entry/@spanname">
<xsl:variable name="spanname" select="$entry/@spanname"/>
<xsl:variable name="spanspec"
select="($entry/ancestor::tgroup/spanspec[@spanname=$spanname]
|$entry/ancestor::entrytbl/spanspec[@spanname=$spanname])[last()]"/>
<xsl:variable name="colspec"
select="($entry/ancestor::tgroup/colspec[@colname=$spanspec/@namest]
|$entry/ancestor::entrytbl/colspec[@colname=$spanspec/@namest])[last()]"/>
<xsl:call-template name="colspec.colnum">
<xsl:with-param name="colspec" select="$colspec"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$entry/@colname">
<xsl:variable name="colname" select="$entry/@colname"/>
<xsl:variable name="colspec"
select="($entry/ancestor::tgroup/colspec[@colname=$colname]
|$entry/ancestor::entrytbl/colspec[@colname=$colname])[last()]"/>
<xsl:call-template name="colspec.colnum">
<xsl:with-param name="colspec" select="$colspec"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$entry/@namest">
<xsl:variable name="namest" select="$entry/@namest"/>
<xsl:variable name="colspec"
select="($entry/ancestor::tgroup/colspec[@colname=$namest]
|$entry/ancestor::entrytbl/colspec[@colname=$namest])[last()]"/>
<xsl:call-template name="colspec.colnum">
<xsl:with-param name="colspec" select="$colspec"/>
</xsl:call-template>
</xsl:when>
<!-- no idea, return 0 -->
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<doc:template name="entry.colnum" xmlns="">
<refpurpose>Determine the column number in which a given entry occurs</refpurpose>
<refdescription id="entry.colnum-desc">
<para>If an <tag>entry</tag> has a
<tag class="attribute">colname</tag> or
<tag class="attribute">namest</tag> attribute, this template
will determine the number of the column in which the entry should occur.
For other <tag>entry</tag>s, nothing is returned.</para>
</refdescription>
<refparameter id="entry.colnum-params">
<variablelist>
<varlistentry><term>entry</term>
<listitem>
<para>The <tag>entry</tag>-element which is to be tested.</para>
</listitem>
</varlistentry>
</variablelist>
</refparameter>
<refreturn id="entry.colnum-returns">
<para>This template returns the column number if it can be determined,
or 0 (the empty string)</para>
</refreturn>
</doc:template>
<xsl:template name="colspec.colnum">
<xsl:param name="colspec" select="."/>
<xsl:choose>
<xsl:when test="$colspec/@colnum">
<xsl:value-of select="$colspec/@colnum"/>
</xsl:when>
<xsl:when test="$colspec/preceding-sibling::colspec">
<xsl:variable name="prec.colspec.colnum">
<xsl:call-template name="colspec.colnum">
<xsl:with-param name="colspec"
select="$colspec/preceding-sibling::colspec[1]"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$prec.colspec.colnum + 1"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="calculate.colspan">
<xsl:param name="entry" select="."/>
<xsl:variable name="spanname" select="$entry/@spanname"/>
<xsl:variable name="spanspec"
select="($entry/ancestor::tgroup/spanspec[@spanname=$spanname]
|$entry/ancestor::entrytbl/spanspec[@spanname=$spanname])[last()]"/>
<xsl:variable name="namest">
<xsl:choose>
<xsl:when test="@spanname">
<xsl:value-of select="$spanspec/@namest"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$entry/@namest"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="nameend">
<xsl:choose>
<xsl:when test="@spanname">
<xsl:value-of select="$spanspec/@nameend"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$entry/@nameend"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="scol">
<xsl:call-template name="colspec.colnum">
<xsl:with-param name="colspec"
select="($entry/ancestor::tgroup/colspec[@colname=$namest]
|$entry/ancestor::entrytbl/colspec[@colname=$namest])[last()]"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="ecol">
<xsl:call-template name="colspec.colnum">
<xsl:with-param name="colspec"
select="($entry/ancestor::tgroup/colspec[@colname=$nameend]
|$entry/ancestor::entrytbl/colspec[@colname=$nameend])[last()]"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$namest != '' and $nameend != ''">
<xsl:choose>
<xsl:when test="number($ecol) &gt;= number($scol)">
<xsl:value-of select="number($ecol) - number($scol) + 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="number($scol) - number($ecol) + 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="calculate.rowsep">
<xsl:param name="entry" select="."/>
<xsl:param name="colnum" select="0"/>
<xsl:call-template name="inherited.table.attribute">
<xsl:with-param name="entry" select="$entry"/>
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="attribute" select="'rowsep'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="calculate.colsep">
<xsl:param name="entry" select="."/>
<xsl:param name="colnum" select="0"/>
<xsl:call-template name="inherited.table.attribute">
<xsl:with-param name="entry" select="$entry"/>
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="attribute" select="'colsep'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="inherited.table.attribute">
<xsl:param name="entry" select="."/>
<xsl:param name="row" select="$entry/ancestor-or-self::row[1]"/>
<xsl:param name="colnum" select="0"/>
<xsl:param name="attribute" select="'colsep'"/>
<xsl:variable name="tgroup" select="$row/parent::*/parent::tgroup[1]"/>
<xsl:variable name="tbody" select="$row/parent::*[1]"/>
<xsl:variable name="table" select="($tgroup/ancestor::table
|$tgroup/ancestor::informaltable
|$entry/ancestor::entrytbl)[last()]"/>
<xsl:variable name="entry.value">
<xsl:call-template name="get-attribute">
<xsl:with-param name="element" select="$entry"/>
<xsl:with-param name="attribute" select="$attribute"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="row.value">
<xsl:call-template name="get-attribute">
<xsl:with-param name="element" select="$row"/>
<xsl:with-param name="attribute" select="$attribute"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="span.value">
<xsl:if test="$entry/@spanname">
<xsl:variable name="spanname" select="$entry/@spanname"/>
<xsl:variable name="spanspec"
select="$tgroup/spanspec[@spanname=$spanname]"/>
<xsl:variable name="span.colspec"
select="$tgroup/colspec[@colname=$spanspec/@namest]"/>
<xsl:variable name="spanspec.value">
<xsl:call-template name="get-attribute">
<xsl:with-param name="element" select="$spanspec"/>
<xsl:with-param name="attribute" select="$attribute"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="scolspec.value">
<xsl:call-template name="get-attribute">
<xsl:with-param name="element" select="$span.colspec"/>
<xsl:with-param name="attribute" select="$attribute"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$spanspec.value != ''">
<xsl:value-of select="$spanspec.value"/>
</xsl:when>
<xsl:when test="$scolspec.value != ''">
<xsl:value-of select="$scolspec.value"/>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:variable>
<xsl:variable name="namest.value">
<xsl:if test="$entry/@namest">
<xsl:variable name="namest" select="$entry/@namest"/>
<xsl:variable name="colspec"
select="$tgroup/colspec[@colname=$namest]"/>
<xsl:variable name="inner.namest.value">
<xsl:call-template name="get-attribute">
<xsl:with-param name="element" select="$colspec"/>
<xsl:with-param name="attribute" select="$attribute"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$inner.namest.value">
<xsl:value-of select="$inner.namest.value"/>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:variable>
<xsl:variable name="tgroup.value">
<xsl:call-template name="get-attribute">
<xsl:with-param name="element" select="$tgroup"/>
<xsl:with-param name="attribute" select="$attribute"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tbody.value">
<xsl:call-template name="get-attribute">
<xsl:with-param name="element" select="$tbody"/>
<xsl:with-param name="attribute" select="$attribute"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="table.value">
<xsl:call-template name="get-attribute">
<xsl:with-param name="element" select="$table"/>
<xsl:with-param name="attribute" select="$attribute"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="default.value">
<!-- This section used to say that rowsep and colsep have defaults based -->
<!-- on the frame setting. Further reflection and closer examination of the -->
<!-- CALS spec reveals I was mistaken. The default is "1" for rowsep and colsep. -->
<!-- For everything else, the default is the tgroup value -->
<xsl:choose>
<xsl:when test="$tgroup.value != ''">
<xsl:value-of select="$tgroup.value"/>
</xsl:when>
<xsl:when test="$attribute = 'rowsep'">1</xsl:when>
<xsl:when test="$attribute = 'colsep'">1</xsl:when>
<xsl:otherwise><!-- empty --></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="calc.colvalue">
<xsl:if test="$colnum &gt; 0">
<xsl:call-template name="colnum.colspec">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="attribute" select="$attribute"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="$entry.value != ''">
<xsl:value-of select="$entry.value"/>
</xsl:when>
<xsl:when test="$row.value != ''">
<xsl:value-of select="$row.value"/>
</xsl:when>
<xsl:when test="$span.value != ''">
<xsl:value-of select="$span.value"/>
</xsl:when>
<xsl:when test="$namest.value != ''">
<xsl:value-of select="$namest.value"/>
</xsl:when>
<xsl:when test="$calc.colvalue != ''">
<xsl:value-of select="$calc.colvalue"/>
</xsl:when>
<xsl:when test="$tbody.value != ''">
<xsl:value-of select="$tbody.value"/>
</xsl:when>
<xsl:when test="$tgroup.value != ''">
<xsl:value-of select="$tgroup.value"/>
</xsl:when>
<xsl:when test="$table.value != ''">
<xsl:value-of select="$table.value"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$default.value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="colnum.colspec">
<xsl:param name="colnum" select="0"/>
<xsl:param name="attribute" select="'colname'"/>
<xsl:param name="colspec.ancestor"
select="(ancestor::tgroup|ancestor::entrytbl)
[position() = last()]"/>
<xsl:param name="colspecs" select="$colspec.ancestor/colspec"/>
<xsl:param name="count" select="1"/>
<xsl:choose>
<xsl:when test="not($colspecs) or $count &gt; $colnum">
<!-- nop -->
</xsl:when>
<xsl:when test="$colspecs[1]/@colnum">
<xsl:choose>
<xsl:when test="$colspecs[1]/@colnum = $colnum">
<xsl:call-template name="get-attribute">
<xsl:with-param name="element" select="$colspecs[1]"/>
<xsl:with-param name="attribute" select="$attribute"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="colnum.colspec">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="colspecs"
select="$colspecs[position()&gt;1]"/>
<xsl:with-param name="count"
select="$colspecs[1]/@colnum+1"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$count = $colnum">
<xsl:call-template name="get-attribute">
<xsl:with-param name="element" select="$colspecs[1]"/>
<xsl:with-param name="attribute" select="$attribute"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="colnum.colspec">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="colspecs"
select="$colspecs[position()&gt;1]"/>
<xsl:with-param name="count" select="$count+1"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="get-attribute">
<xsl:param name="element" select="."/>
<xsl:param name="attribute" select="''"/>
<xsl:for-each select="$element/@*">
<xsl:if test="local-name(.) = $attribute">
<xsl:value-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template name="consume-row">
<xsl:param name="spans"/>
<xsl:if test="contains($spans,':')">
<xsl:value-of select="substring-before($spans,':') - 1"/>
<xsl:text>:</xsl:text>
<xsl:call-template name="consume-row">
<xsl:with-param name="spans" select="substring-after($spans,':')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- Returns the table style for the context element -->
<xsl:template name="tabstyle">
<xsl:param name="node" select="."/>
<xsl:variable name="tgroup" select="$node/tgroup[1] |
$node/ancestor-or-self::tgroup[1]"/>
<xsl:variable name="table"
select="($node/ancestor-or-self::table |
$node/ancestor-or-self::informaltable)[last()]"/>
<xsl:variable name="tabstyle">
<xsl:choose>
<xsl:when test="$table/@tabstyle != ''">
<xsl:value-of select="normalize-space($table/@tabstyle)"/>
</xsl:when>
<xsl:when test="$tgroup/@tgroupstyle != ''">
<xsl:value-of select="normalize-space($tgroup/@tgroupstyle)"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$tabstyle"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,337 +0,0 @@
<?xml version='1.0'?>
<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 exsl"
version='1.0'>
<!-- ********************************************************************
$Id: targets.xsl 9286 2012-04-19 10:10:58Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- cross reference target collection -->
<doc:mode mode="collect.targets" xmlns="">
<refpurpose>Collects information for potential cross reference targets</refpurpose>
<refdescription id="collect.targets-desc">
<para>Processing the root element in the
<literal role="mode">collect.targets</literal> mode produces
a set of target database elements that can be used by
the olink mechanism to resolve external cross references.
The collection process is controlled by the <literal>
collect.xref.targets</literal> parameter, which can be
<literal>yes</literal> to collect targets and process
the document for output, <literal>only</literal> to
only collect the targets, and <literal>no</literal>
(default) to not collect the targets and only process the document.
</para>
<para>
A <literal>targets.filename</literal> parameter must be
specified to receive the output if
<literal>collect.xref.targets</literal> is
set to <literal>yes</literal> so as to
redirect the target data to a file separate from the
document output.
</para>
</refdescription>
</doc:mode>
<!-- ============================================================ -->
<xsl:template match="*" mode="collect.targets">
<xsl:choose>
<xsl:when test="$collect.xref.targets = 'yes' and $targets.filename = ''">
<xsl:message>
Must specify a $targets.filename parameter when
$collect.xref.targets is set to 'yes'.
The xref targets were not collected.
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$targets.filename">
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename" select="$targets.filename"/>
<xsl:with-param name="method" select="'xml'"/>
<xsl:with-param name="encoding" select="'utf-8'"/>
<xsl:with-param name="omit-xml-declaration" select="'yes'"/>
<xsl:with-param name="doctype-public" select="''"/>
<xsl:with-param name="doctype-system" select="''"/>
<xsl:with-param name="indent" select="'no'"/>
<xsl:with-param name="quiet" select="0"/>
<xsl:with-param name="content">
<xsl:apply-templates select="." mode="olink.mode"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<!-- Else write to standard output -->
<xsl:apply-templates select="." mode="olink.mode"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="olink.href.target">
<xsl:param name="nd" select="."/>
<xsl:value-of select="$olink.base.uri"/>
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$nd"/>
<xsl:with-param name="context" select="NOTANODE"/>
</xsl:call-template>
</xsl:template>
<!-- Templates for extracting cross reference information
from a document for use in an xref database.
-->
<xsl:template name="attrs">
<xsl:param name="nd" select="."/>
<xsl:attribute name="element">
<xsl:value-of select="local-name(.)"/>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:call-template name="olink.href.target">
<xsl:with-param name="nd" select="$nd"/>
</xsl:call-template>
</xsl:attribute>
<xsl:variable name="num">
<xsl:apply-templates select="$nd" mode="label.markup">
<xsl:with-param name="verbose" select="0"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:if test="$num">
<xsl:attribute name="number">
<xsl:value-of select="$num"/>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="$nd/@id">
<xsl:attribute name="targetptr">
<xsl:value-of select="$nd/@id"/>
</xsl:attribute>
</xsl:when>
<xsl:when test="$nd/@xml:id">
<xsl:attribute name="targetptr">
<xsl:value-of select="$nd/@xml:id"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:if test="$nd/@lang">
<xsl:attribute name="lang">
<xsl:value-of select="$nd/@lang"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template name="div">
<xsl:param name="nd" select="."/>
<div>
<xsl:call-template name="attrs">
<xsl:with-param name="nd" select="$nd"/>
</xsl:call-template>
<ttl>
<xsl:apply-templates select="$nd" mode="title.markup">
<xsl:with-param name="verbose" select="0"/>
</xsl:apply-templates>
</ttl>
<xreftext>
<xsl:choose>
<xsl:when test="$nd/@xreflabel">
<xsl:call-template name="xref.xreflabel">
<xsl:with-param name="target" select="$nd"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$nd" mode="xref-to">
<xsl:with-param name="verbose" select="0"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xreftext>
<xsl:apply-templates mode="olink.mode"/>
</div>
</xsl:template>
<xsl:template name="obj">
<xsl:param name="nd" select="."/>
<obj>
<xsl:call-template name="attrs">
<xsl:with-param name="nd" select="$nd"/>
</xsl:call-template>
<ttl>
<xsl:apply-templates select="$nd" mode="title.markup">
<xsl:with-param name="verbose" select="0"/>
</xsl:apply-templates>
</ttl>
<xreftext>
<xsl:choose>
<xsl:when test="$nd/@xreflabel">
<xsl:call-template name="xref.xreflabel">
<xsl:with-param name="target" select="$nd"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$nd" mode="xref-to">
<xsl:with-param name="verbose" select="0"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xreftext>
</obj>
</xsl:template>
<xsl:template match="text()|processing-instruction()|comment()"
mode="olink.mode">
<!-- nop -->
</xsl:template>
<!--
<xsl:template match="*" mode="olink.mode">
</xsl:template>
-->
<xsl:template match="set" mode="olink.mode">
<xsl:call-template name="div"/>
</xsl:template>
<xsl:template match="book" mode="olink.mode">
<xsl:call-template name="div"/>
</xsl:template>
<xsl:template match="preface|chapter|appendix" mode="olink.mode">
<xsl:call-template name="div"/>
</xsl:template>
<xsl:template match="part|reference" mode="olink.mode">
<xsl:call-template name="div"/>
</xsl:template>
<xsl:template match="article" mode="olink.mode">
<xsl:call-template name="div"/>
</xsl:template>
<xsl:template match="topic" mode="olink.mode">
<xsl:call-template name="div"/>
</xsl:template>
<xsl:template match="bibliography|bibliodiv" mode="olink.mode">
<xsl:call-template name="div"/>
</xsl:template>
<xsl:template match="biblioentry|bibliomixed" mode="olink.mode">
<xsl:call-template name="obj"/>
</xsl:template>
<xsl:template match="refentry" mode="olink.mode">
<xsl:call-template name="div"/>
</xsl:template>
<xsl:template match="section|sect1|sect2|sect3|sect4|sect5" mode="olink.mode">
<xsl:call-template name="div"/>
</xsl:template>
<xsl:template match="refsection|refsect1|refsect2|refsect3" mode="olink.mode">
<xsl:call-template name="div"/>
</xsl:template>
<xsl:template match="figure|example|table" mode="olink.mode">
<xsl:call-template name="obj"/>
<xsl:apply-templates mode="olink.mode"/>
</xsl:template>
<xsl:template match="equation[title or info/title]" mode="olink.mode">
<xsl:call-template name="obj"/>
</xsl:template>
<xsl:template match="qandaset|qandaentry" mode="olink.mode">
<xsl:call-template name="div"/>
</xsl:template>
<!-- handle an glossary collection -->
<xsl:template match="glossary[@role='auto']" mode="olink.mode" priority="2">
<xsl:variable name="collection" select="document($glossary.collection, .)"/>
<xsl:if test="$glossary.collection = ''">
<xsl:message>
<xsl:text>Warning: processing automatic glossary </xsl:text>
<xsl:text>without a glossary.collection file.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="not($collection) and $glossary.collection != ''">
<xsl:message>
<xsl:text>Warning: processing automatic glossary but unable to </xsl:text>
<xsl:text>open glossary.collection file '</xsl:text>
<xsl:value-of select="$glossary.collection"/>
<xsl:text>'</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="$exsl.node.set.available != 0">
<xsl:variable name="auto.glossary">
<xsl:apply-templates select="." mode="assemble.auto.glossary"/>
</xsl:variable>
<xsl:variable name="auto.glossary.nodeset" select="exsl:node-set($auto.glossary)"/>
<xsl:apply-templates select="$auto.glossary.nodeset/*" mode="olink.mode"/>
</xsl:if>
</xsl:template>
<!-- construct a glossary in memory -->
<xsl:template match="glossary" mode="assemble.auto.glossary">
<xsl:copy>
<xsl:copy-of select="@*[not(local-name() = 'role')]"/>
<xsl:apply-templates select="node()" mode="assemble.auto.glossary"/>
<xsl:call-template name="select.glossentries"/>
</xsl:copy>
</xsl:template>
<xsl:template name="select.glossentries">
<xsl:param name="collection" select="document($glossary.collection, .)"/>
<xsl:param name="terms" select="//glossterm[not(parent::glossdef)]|//firstterm"/>
<xsl:for-each select="$collection//glossentry">
<xsl:variable name="cterm" select="glossterm"/>
<xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
<xsl:copy-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="glossentry" mode="assemble.auto.glossary">
<!-- skip the dummy entries -->
</xsl:template>
<xsl:template match="*" mode="assemble.auto.glossary">
<!-- pass through any titles and intro stuff -->
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="*" mode="olink.mode">
<xsl:if test="@id or @xml:id">
<xsl:call-template name="obj"/>
</xsl:if>
<xsl:apply-templates mode="olink.mode"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,807 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="doc"
version='1.0'>
<!-- ********************************************************************
$Id: titles.xsl 9286 2012-04-19 10:10:58Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- title markup -->
<doc:mode mode="title.markup" xmlns="">
<refpurpose>Provides access to element titles</refpurpose>
<refdescription id="title.markup-desc">
<para>Processing an element in the
<literal role="mode">title.markup</literal> mode produces the
title of the element. This does not include the label.
</para>
</refdescription>
</doc:mode>
<xsl:template match="*" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:param name="verbose" select="1"/>
<xsl:choose>
<!-- * FIXME: this should handle other *info elements as well -->
<!-- * but this is good enough for now. -->
<xsl:when test="title|info/title">
<xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="local-name(.) = 'partintro'">
<!-- partintro's don't have titles, use the parent (part or reference)
title instead. -->
<xsl:apply-templates select="parent::*" mode="title.markup"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$verbose != 0">
<xsl:message>
<xsl:text>Request for title of element with no title: </xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:choose>
<xsl:when test="@id">
<xsl:text> (id="</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>")</xsl:text>
</xsl:when>
<xsl:when test="@xml:id">
<xsl:text> (xml:id="</xsl:text>
<xsl:value-of select="@xml:id"/>
<xsl:text>")</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:message>
</xsl:if>
<xsl:text>???TITLE???</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="title" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:choose>
<xsl:when test="$allow-anchors != 0">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="no.anchor.mode"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- only occurs in HTML Tables! -->
<xsl:template match="caption" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:choose>
<xsl:when test="$allow-anchors != 0">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="no.anchor.mode"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="set" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:apply-templates select="(setinfo/title|info/title|title)[1]"
mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="book" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:apply-templates select="(bookinfo/title|info/title|title)[1]"
mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="part" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:apply-templates select="(partinfo/title|info/title|docinfo/title|title)[1]"
mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="preface|chapter|appendix" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<!--
<xsl:message>
<xsl:value-of select="local-name(.)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$allow-anchors"/>
</xsl:message>
-->
<xsl:variable name="title" select="(docinfo/title
|info/title
|prefaceinfo/title
|chapterinfo/title
|appendixinfo/title
|title)[1]"/>
<xsl:apply-templates select="$title" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="dedication" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:choose>
<xsl:when test="title|info/title">
<xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Dedication'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="acknowledgements" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:choose>
<xsl:when test="title|info/title">
<xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Acknowledgements'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="colophon" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:choose>
<xsl:when test="title|info/title">
<xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Colophon'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="article" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:variable name="title" select="(artheader/title
|articleinfo/title
|info/title
|title)[1]"/>
<xsl:apply-templates select="$title" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="reference" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:apply-templates select="(referenceinfo/title|docinfo/title|info/title|title)[1]"
mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="refentry" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:variable name="refmeta" select=".//refmeta"/>
<xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
<xsl:variable name="refnamediv" select=".//refnamediv"/>
<xsl:variable name="refname" select="$refnamediv//refname"/>
<xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="$refentrytitle">
<xsl:apply-templates select="$refentrytitle[1]" mode="title.markup"/>
</xsl:when>
<xsl:when test="$refdesc">
<xsl:apply-templates select="$refdesc" mode="title.markup"/>
</xsl:when>
<xsl:when test="$refname">
<xsl:apply-templates select="$refname[1]" mode="title.markup"/>
</xsl:when>
<xsl:otherwise>REFENTRY WITHOUT TITLE???</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:copy-of select="$title"/>
</xsl:template>
<xsl:template match="refentrytitle|refname|refdescriptor" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:choose>
<xsl:when test="$allow-anchors != 0">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="no.anchor.mode"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="section
|sect1|sect2|sect3|sect4|sect5
|refsect1|refsect2|refsect3|refsection
|topic
|simplesect"
mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:variable name="title" select="(info/title
|sectioninfo/title
|sect1info/title
|sect2info/title
|sect3info/title
|sect4info/title
|sect5info/title
|refsect1info/title
|refsect2info/title
|refsect3info/title
|refsectioninfo/title
|title)[1]"/>
<xsl:apply-templates select="$title" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="bridgehead" mode="title.markup">
<xsl:apply-templates mode="title.markup"/>
</xsl:template>
<xsl:template match="refsynopsisdiv" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:choose>
<xsl:when test="title|info/title">
<xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'RefSynopsisDiv'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="bibliography" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:variable name="title" select="(bibliographyinfo/title|info/title|title)[1]"/>
<xsl:choose>
<xsl:when test="$title">
<xsl:apply-templates select="$title" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Bibliography'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="glossary" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:variable name="title" select="(glossaryinfo/title|info/title|title)[1]"/>
<xsl:choose>
<xsl:when test="$title">
<xsl:apply-templates select="$title" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.element.name">
<xsl:with-param name="element.name" select="local-name(.)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="glossdiv" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:variable name="title" select="(info/title|title)[1]"/>
<xsl:choose>
<xsl:when test="$title">
<xsl:apply-templates select="$title" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:message>ERROR: glossdiv missing its required title</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="glossentry" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:apply-templates select="glossterm" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="glossterm|firstterm" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:choose>
<xsl:when test="$allow-anchors != 0">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="no.anchor.mode"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="index" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:variable name="title" select="(indexinfo/title|info/title|title)[1]"/>
<xsl:choose>
<xsl:when test="$title">
<xsl:apply-templates select="$title" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Index'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="setindex" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:variable name="title" select="(setindexinfo/title|info/title|title)[1]"/>
<xsl:choose>
<xsl:when test="$title">
<xsl:apply-templates select="$title" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'SetIndex'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="figure|example|equation" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="table" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:apply-templates select="(title|info/title|caption)[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="procedure" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="task" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="sidebar" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:apply-templates select="(info/title|sidebarinfo/title|title)[1]"
mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="abstract" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:choose>
<xsl:when test="title|info/title">
<xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Abstract'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="caution|tip|warning|important|note" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:variable name="title" select="(title|info/title)[1]"/>
<xsl:choose>
<xsl:when test="$title">
<xsl:apply-templates select="$title" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key">
<xsl:choose>
<xsl:when test="local-name(.)='note'">Note</xsl:when>
<xsl:when test="local-name(.)='important'">Important</xsl:when>
<xsl:when test="local-name(.)='caution'">Caution</xsl:when>
<xsl:when test="local-name(.)='warning'">Warning</xsl:when>
<xsl:when test="local-name(.)='tip'">Tip</xsl:when>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="question" mode="title.markup">
<!-- questions don't have titles -->
<xsl:text>Question</xsl:text>
</xsl:template>
<xsl:template match="answer" mode="title.markup">
<!-- answers don't have titles -->
<xsl:text>Answer</xsl:text>
</xsl:template>
<xsl:template match="qandaentry" mode="title.markup">
<!-- qandaentrys are represented by the first question in them -->
<xsl:text>Question</xsl:text>
</xsl:template>
<xsl:template match="qandaset" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:variable name="title" select="(info/title|
blockinfo/title|
title)[1]"/>
<xsl:choose>
<xsl:when test="$title">
<xsl:apply-templates select="$title" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'QandASet'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="legalnotice" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:choose>
<xsl:when test="title|info/title">
<xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'LegalNotice'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ============================================================ -->
<xsl:template match="*" mode="titleabbrev.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:param name="verbose" select="1"/>
<xsl:choose>
<xsl:when test="titleabbrev">
<xsl:apply-templates select="titleabbrev[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="info/titleabbrev">
<xsl:apply-templates select="info/titleabbrev[1]" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="book|preface|chapter|appendix" mode="titleabbrev.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:param name="verbose" select="1"/>
<xsl:variable name="titleabbrev" select="(docinfo/titleabbrev
|bookinfo/titleabbrev
|info/titleabbrev
|prefaceinfo/titleabbrev
|chapterinfo/titleabbrev
|appendixinfo/titleabbrev
|titleabbrev)[1]"/>
<xsl:choose>
<xsl:when test="$titleabbrev">
<xsl:apply-templates select="$titleabbrev" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="article" mode="titleabbrev.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:param name="verbose" select="1"/>
<xsl:variable name="titleabbrev" select="(artheader/titleabbrev
|articleinfo/titleabbrev
|info/titleabbrev
|titleabbrev)[1]"/>
<xsl:choose>
<xsl:when test="$titleabbrev">
<xsl:apply-templates select="$titleabbrev" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="section
|sect1|sect2|sect3|sect4|sect5
|refsect1|refsect2|refsect3
|topic
|simplesect"
mode="titleabbrev.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:param name="verbose" select="1"/>
<xsl:variable name="titleabbrev" select="(info/titleabbrev
|sectioninfo/titleabbrev
|sect1info/titleabbrev
|sect2info/titleabbrev
|sect3info/titleabbrev
|sect4info/titleabbrev
|sect5info/titleabbrev
|refsect1info/titleabbrev
|refsect2info/titleabbrev
|refsect3info/titleabbrev
|titleabbrev)[1]"/>
<xsl:choose>
<xsl:when test="$titleabbrev">
<xsl:apply-templates select="$titleabbrev" mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="title.markup">
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
<xsl:with-param name="verbose" select="$verbose"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="titleabbrev" mode="title.markup">
<xsl:param name="allow-anchors" select="0"/>
<xsl:choose>
<xsl:when test="$allow-anchors != 0">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="no.anchor.mode"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ============================================================ -->
<xsl:template match="*" mode="no.anchor.mode">
<!-- Switch to normal mode if no links -->
<xsl:choose>
<xsl:when test="descendant-or-self::footnote or
descendant-or-self::anchor or
descendant-or-self::ulink or
descendant-or-self::link or
descendant-or-self::olink or
descendant-or-self::xref or
descendant-or-self::indexterm or
(ancestor::title and (@id or @xml:id))">
<xsl:apply-templates mode="no.anchor.mode"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="footnote" mode="no.anchor.mode">
<!-- nop, suppressed -->
</xsl:template>
<xsl:template match="anchor" mode="no.anchor.mode">
<!-- nop, suppressed -->
</xsl:template>
<xsl:template match="ulink" mode="no.anchor.mode">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="link" mode="no.anchor.mode">
<xsl:choose>
<xsl:when test="count(child::node()) &gt; 0">
<!-- If it has content, use it -->
<xsl:apply-templates/>
</xsl:when>
<!-- look for an endterm -->
<xsl:when test="@endterm">
<xsl:variable name="etargets" select="key('id',@endterm)"/>
<xsl:variable name="etarget" select="$etargets[1]"/>
<xsl:choose>
<xsl:when test="count($etarget) = 0">
<xsl:message>
<xsl:value-of select="count($etargets)"/>
<xsl:text>Endterm points to nonexistent ID: </xsl:text>
<xsl:value-of select="@endterm"/>
</xsl:message>
<xsl:text>???</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$etarget" mode="endterm"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="olink" mode="no.anchor.mode">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="indexterm" mode="no.anchor.mode">
<!-- nop, suppressed -->
</xsl:template>
<xsl:template match="xref" mode="no.anchor.mode">
<xsl:variable name="targets" select="key('id',@linkend)|key('id',substring-after(@xlink:href,'#'))"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:variable name="refelem" select="local-name($target)"/>
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="@linkend"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="count($target) = 0">
<xsl:message>
<xsl:text>XRef to nonexistent id: </xsl:text>
<xsl:value-of select="@linkend"/>
<xsl:value-of select="@xlink:href"/>
</xsl:message>
<xsl:text>???</xsl:text>
</xsl:when>
<xsl:when test="@endterm">
<xsl:variable name="etargets" select="key('id',@endterm)"/>
<xsl:variable name="etarget" select="$etargets[1]"/>
<xsl:choose>
<xsl:when test="count($etarget) = 0">
<xsl:message>
<xsl:value-of select="count($etargets)"/>
<xsl:text>Endterm points to nonexistent ID: </xsl:text>
<xsl:value-of select="@endterm"/>
</xsl:message>
<xsl:text>???</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$etarget" mode="endterm"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$target/@xreflabel">
<xsl:call-template name="xref.xreflabel">
<xsl:with-param name="target" select="$target"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<!-- Watch out for the case when there is a xref or link inside
a title. See bugs #1811721 and #1838136. -->
<xsl:when test="not(ancestor::*[@id = $target/@id] or ancestor::*[@xml:id = $target/@xml:id])">
<xsl:apply-templates select="$target" mode="xref-to-prefix"/>
<xsl:apply-templates select="$target" mode="xref-to">
<xsl:with-param name="referrer" select="."/>
<xsl:with-param name="xrefstyle">
<xsl:choose>
<xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
<xsl:value-of select="@role"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@xrefstyle"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="$target" mode="xref-to-suffix"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ============================================================ -->
</xsl:stylesheet>

View File

@ -1,290 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
xmlns:dyn="http://exslt.org/dynamic"
xmlns:saxon="http://icl.com/saxon"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="doc dyn saxon"
version='1.0'>
<!-- ********************************************************************
$Id: utility.xsl 7101 2007-07-20 15:32:12Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<doc:reference xmlns="" xml:id="utility">
<info>
<title>Common » Utility Template Reference</title>
<releaseinfo role="meta">
$Id: utility.xsl 7101 2007-07-20 15:32:12Z xmldoc $
</releaseinfo>
</info>
<!-- * yes, partintro is a valid child of a reference... -->
<partintro xml:id="partintro">
<title>Introduction</title>
<para>This is technical reference documentation for the
miscellaneous utility templates in the DocBook XSL
Stylesheets.</para>
<note>
<para>These templates are defined in a separate file from the set
of “common” templates because some of the common templates
reference DocBook XSL stylesheet parameters, requiring the
entire set of parameters to be imported/included in any
stylesheet that imports/includes the common templates.</para>
<para>The utility templates dont import or include any DocBook
XSL stylesheet parameters, so the utility templates can be used
without importing the whole set of parameters.</para>
</note>
<para>This is not intended to be user documentation. It is
provided for developers writing customization layers for the
stylesheets.</para>
</partintro>
</doc:reference>
<!-- ====================================================================== -->
<doc:template name="log.message" xmlns="">
<refpurpose>Logs/emits formatted notes and warnings</refpurpose>
<refdescription id="log.message-desc">
<para>The <function>log.message</function> template is a utility
template for logging/emitting formatted messages&#xa0; that is,
notes and warnings, along with a given log “level” and an
identifier for the “source” that the message relates to.</para>
</refdescription>
<refparameter id="log.message-params">
<variablelist>
<varlistentry><term>level</term>
<listitem>
<para>Text to log/emit in the message-level field to
indicate the message level
(<literal>Note</literal> or
<literal>Warning</literal>)</para>
</listitem>
</varlistentry>
<varlistentry><term>source</term>
<listitem>
<para>Text to log/emit in the source field to identify the
“source” to which the notification/warning relates.
This can be any arbitrary string, but because the
message lacks line and column numbers to identify the
exact part of the source document to which it
relates, the intention is that the value you pass
into the <literal>source</literal> parameter should
give the user some way to identify the portion of
their source document on which to take potentially
take action in response to the log message (for
example, to edit, change, or add content).</para>
<para>So the <literal>source</literal> value should be,
for example, an ID, book/chapter/article title, title
of some formal object, or even a string giving an
XPath expression.</para>
</listitem>
</varlistentry>
<varlistentry><term>context-desc</term>
<listitem>
<para>Text to log/emit in the context-description field to
describe the context for the message.</para>
</listitem>
</varlistentry>
<varlistentry><term>context-desc-field-length</term>
<listitem>
<para>Specifies length of the context-description field
(in characters); default is 12</para>
<para>If the text specified by the
<literal>context-desc</literal> parameter is longer
than the number of characters specified in
<literal>context-desc-field-length</literal>, it is
truncated to <literal>context-desc-field-length</literal>
(12 characters by default).</para>
<para>If the specified text is shorter than
<literal>context-desc-field-length</literal>,
it is right-padded out to
<literal>context-desc-field-length</literal> (12 by
default).</para>
<para>If no value has been specified for the
<literal>context-desc</literal> parameter, the field is
left empty and the text of the log message begins with
the value of the <literal>message</literal>
parameter.</para>
</listitem>
</varlistentry>
<varlistentry><term>message</term>
<listitem>
<para>Text to log/emit in the actual message field</para>
</listitem>
</varlistentry>
<varlistentry><term>message-field-length</term>
<listitem>
<para>Specifies length of the message
field (in characters); default is 45</para>
</listitem>
</varlistentry>
</variablelist>
</refparameter>
<refreturn id="log.message-returns">
<para>Outputs a message (generally, to standard error).</para></refreturn>
</doc:template>
<xsl:template name="log.message">
<xsl:param name="level"/>
<xsl:param name="source"/>
<xsl:param name="context-desc"/>
<xsl:param name="context-desc-field-length">12</xsl:param>
<xsl:param name="context-desc-padded">
<xsl:if test="not($context-desc = '')">
<xsl:call-template name="pad-string">
<xsl:with-param name="leftRight">right</xsl:with-param>
<xsl:with-param name="padVar"
select="substring($context-desc, 1, $context-desc-field-length)"/>
<xsl:with-param name="length" select="$context-desc-field-length"/>
</xsl:call-template>
</xsl:if>
</xsl:param>
<xsl:param name="message"/>
<xsl:param name="message-field-length" select="45"/>
<xsl:param name="message-padded">
<xsl:variable name="spaces-for-blank-level">
<!-- * if the level field is blank, we'll need to pad out -->
<!-- * the message field with spaces to compensate -->
<xsl:choose>
<xsl:when test="$level = ''">
<xsl:value-of select="4 + 2"/>
<!-- * 4 = hard-coded length of comment text ("Note" or "Warn") -->
<!-- * + 2 = length of colon-plus-space separator ": " -->
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="spaces-for-blank-context-desc">
<!-- * if the context-description field is blank, we'll need -->
<!-- * to pad out the message field with spaces to compensate -->
<xsl:choose>
<xsl:when test="$context-desc = ''">
<xsl:value-of select="$context-desc-field-length + 2"/>
<!-- * + 2 = length of colon-plus-space separator ": " -->
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="extra-spaces"
select="$spaces-for-blank-level + $spaces-for-blank-context-desc"/>
<xsl:call-template name="pad-string">
<xsl:with-param name="leftRight">right</xsl:with-param>
<xsl:with-param name="padVar"
select="substring($message, 1, ($message-field-length + $extra-spaces))"/>
<xsl:with-param name="length"
select="$message-field-length + $extra-spaces"/>
</xsl:call-template>
</xsl:param>
<!-- * emit the actual log message -->
<xsl:message>
<xsl:if test="not($level = '')">
<xsl:value-of select="$level"/>
<xsl:text>: </xsl:text>
</xsl:if>
<xsl:if test="not($context-desc = '')">
<xsl:value-of select="$context-desc-padded"/>
<xsl:text>: </xsl:text>
</xsl:if>
<xsl:value-of select="$message-padded"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$source"/>
</xsl:message>
</xsl:template>
<!-- ===================================== -->
<doc:template name="get.doc.title" xmlns="">
<refpurpose>Gets a title from the current document</refpurpose>
<refdescription id="get.doc.title-desc">
<para>The <function>get.doc.title</function> template is a
utility template for returning the first title found in the
current document.</para>
</refdescription>
<refreturn id="get.doc.title-returns">
<para>Returns a string containing some identifying title for the
current document .</para></refreturn>
</doc:template>
<xsl:template name="get.doc.title">
<xsl:choose>
<xsl:when test="//*[local-name() = 'title'
or local-name() = 'refname']">
<xsl:value-of select="//*[local-name() = 'title'
or local-name() = 'refname'][1]"/>
</xsl:when>
<xsl:when test="substring(local-name(*[1]),
string-length(local-name(*[1])-3) = 'info')
and *[1]/*[local-name() = 'title']">
<xsl:value-of select="*[1]/*[local-name() = 'title'][1]"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- ===================================== -->
<doc:template name="pad-string" xmlns="">
<refpurpose>Right-pads or left-pads a string out to a certain length</refpurpose>
<refdescription id="pad-string-desc">
<para>This function takes string <parameter>padVar</parameter> and
pads it out in the direction <parameter>rightLeft</parameter> to
the string-length <parameter>length</parameter>, using string
<parameter>padChar</parameter> (a space character by default) as
the padding string (note that <parameter>padChar</parameter> can
be a string; it is not limited to just being a single
character).</para>
<note>
<para>This function began as a copy of Nate Austin's
<function>prepend-pad</function> function in the <link
xlink:href="http://www.dpawson.co.uk/xsl/sect2/padding.html" >Padding
Content</link> section of Dave Pawson's <link
xlink:href="http://www.dpawson.co.uk/xsl/index.html" >XSLT
FAQ</link>.</para>
</note>
</refdescription>
<refreturn id="pad-string-returns">
<para>Returns a (padded) string.</para></refreturn>
</doc:template>
<xsl:template name="pad-string">
<!-- * recursive template to right/left pad the value with -->
<!-- * whatever padChar is passed in -->
<xsl:param name="padChar" select="' '"/>
<xsl:param name="leftRight">left</xsl:param>
<xsl:param name="padVar"/>
<xsl:param name="length"/>
<xsl:choose>
<xsl:when test="string-length($padVar) &lt; $length">
<xsl:call-template name="pad-string">
<xsl:with-param name="padChar" select="$padChar"/>
<xsl:with-param name="leftRight" select="$leftRight"/>
<xsl:with-param name="padVar">
<xsl:choose>
<!-- * determine whether string should be -->
<!-- * right- or left-padded -->
<xsl:when test="$leftRight = 'left'">
<!-- * pad it to left -->
<xsl:value-of select="concat($padChar,$padVar)"/>
</xsl:when>
<xsl:otherwise>
<!-- * otherwise, right-pad the string -->
<xsl:value-of select="concat($padVar,$padChar)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="length" select="$length"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="substring($padVar,string-length($padVar) - $length + 1)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,139 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: admon.xsl 9352 2012-05-12 23:17:11Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:template match="*" mode="admon.graphic.width">
<xsl:param name="node" select="."/>
<xsl:text>25</xsl:text>
</xsl:template>
<xsl:template match="note|important|warning|caution|tip">
<xsl:choose>
<xsl:when test="$admon.graphics != 0">
<xsl:call-template name="graphical.admonition"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="nongraphical.admonition"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="admon.graphic">
<xsl:param name="node" select="."/>
<xsl:value-of select="$admon.graphics.path"/>
<xsl:choose>
<xsl:when test="local-name($node)='note'">note</xsl:when>
<xsl:when test="local-name($node)='warning'">warning</xsl:when>
<xsl:when test="local-name($node)='caution'">caution</xsl:when>
<xsl:when test="local-name($node)='tip'">tip</xsl:when>
<xsl:when test="local-name($node)='important'">important</xsl:when>
<xsl:otherwise>note</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$admon.graphics.extension"/>
</xsl:template>
<xsl:template name="graphical.admonition">
<xsl:variable name="admon.type">
<xsl:choose>
<xsl:when test="local-name(.)='note'">Note</xsl:when>
<xsl:when test="local-name(.)='warning'">Warning</xsl:when>
<xsl:when test="local-name(.)='caution'">Caution</xsl:when>
<xsl:when test="local-name(.)='tip'">Tip</xsl:when>
<xsl:when test="local-name(.)='important'">Important</xsl:when>
<xsl:otherwise>Note</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="alt">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="$admon.type"/>
</xsl:call-template>
</xsl:variable>
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:if test="$admon.style != ''">
<xsl:attribute name="style">
<xsl:value-of select="$admon.style"/>
</xsl:attribute>
</xsl:if>
<table border="{$table.border.off}">
<!-- omit summary attribute in html5 output -->
<xsl:if test="$div.element != 'section'">
<xsl:attribute name="summary">
<xsl:value-of select="$admon.type"/>
<xsl:if test="title|info/title">
<xsl:text>: </xsl:text>
<xsl:value-of select="(title|info/title)[1]"/>
</xsl:if>
</xsl:attribute>
</xsl:if>
<tr>
<td rowspan="2" align="center" valign="top">
<xsl:attribute name="width">
<xsl:apply-templates select="." mode="admon.graphic.width"/>
</xsl:attribute>
<img alt="[{$alt}]">
<xsl:attribute name="src">
<xsl:call-template name="admon.graphic"/>
</xsl:attribute>
</img>
</td>
<th align="{$direction.align.start}">
<xsl:call-template name="anchor"/>
<xsl:if test="$admon.textlabel != 0 or title or info/title">
<xsl:apply-templates select="." mode="object.title.markup"/>
</xsl:if>
</th>
</tr>
<tr>
<td align="{$direction.align.start}" valign="top">
<xsl:apply-templates/>
</td>
</tr>
</table>
</div>
</xsl:template>
<xsl:template name="nongraphical.admonition">
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute"/>
<xsl:if test="$admon.style">
<xsl:attribute name="style">
<xsl:value-of select="$admon.style"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$admon.textlabel != 0 or title or info/title">
<h3 class="title">
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="." mode="object.title.markup"/>
</h3>
</xsl:if>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="note/title"></xsl:template>
<xsl:template match="important/title"></xsl:template>
<xsl:template match="warning/title"></xsl:template>
<xsl:template match="caution/title"></xsl:template>
<xsl:template match="tip/title"></xsl:template>
</xsl:stylesheet>

View File

@ -1,169 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<xsl:template name="add.annotation.links">
<xsl:param name="scripts" select="normalize-space($annotation.js)"/>
<xsl:choose>
<xsl:when test="contains($scripts, ' ')">
<script type="text/javascript" src="{substring-before($scripts, ' ')}"/>
<xsl:call-template name="add.annotation.links">
<xsl:with-param name="scripts" select="substring-after($scripts, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<script type="text/javascript" src="{$scripts}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="annotation"/>
<xsl:template name="apply-annotations">
<xsl:if test="$annotation.support != 0">
<!-- do any annotations apply to the context node? -->
<xsl:variable name="id" select="(@id|@xml:id)[1]"/>
<xsl:variable name="aids">
<xsl:for-each select="//annotation">
<xsl:if test="@annotates=$id
or starts-with(@annotates, concat($id, ' '))
or contains(@annotates, concat(' ', $id, ' '))
or substring(@annotates, string-length(@annotates)-3)
= concat(' ', $id)">
<xsl:value-of select="generate-id()"/>
<xsl:text> </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:if test="normalize-space(@annotations) != ''">
<xsl:call-template name="annotations-pointed-to">
<xsl:with-param name="annotations"
select="normalize-space(@annotations)"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:if test="$aids != ''">
<xsl:call-template name="apply-annotations-by-gid">
<xsl:with-param name="gids" select="normalize-space($aids)"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template name="annotations-pointed-to">
<xsl:param name="annotations"/>
<xsl:choose>
<xsl:when test="contains($annotations, ' ')">
<xsl:variable name='a'
select="key('id', substring-before($annotations, ' '))"/>
<xsl:if test="$a">
<xsl:value-of select="generate-id($a)"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:call-template name="annotations-pointed-to">
<xsl:with-param name="annotations"
select="substring-after($annotations, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name='a'
select="key('id', $annotations)"/>
<xsl:if test="$a">
<xsl:value-of select="generate-id($a)"/>
<xsl:text> </xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="apply-annotations-by-gid">
<xsl:param name="gids"/>
<xsl:choose>
<xsl:when test="contains($gids, ' ')">
<xsl:variable name="gid" select="substring-before($gids, ' ')"/>
<xsl:apply-templates select="key('gid', $gid)"
mode="annotation-inline"/>
<xsl:call-template name="apply-annotations-by-gid">
<xsl:with-param name="gids"
select="substring-after($gids, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="key('gid', $gids)"
mode="annotation-inline"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="annotation" mode="annotation-inline">
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="title">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>[Annotation #</xsl:text>
<xsl:number count="annotation" level="any" format="1"/>
<xsl:text>]</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a href="#annot-{generate-id(.)}" title="{$title}"
name="anch-{generate-id(.)}" id="anch-{generate-id(.)}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:attribute name="onClick">
<xsl:text>popup_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>.showPopup('anch-</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>'); return false;</xsl:text>
</xsl:attribute>
<img src="{$annotation.graphic.open}" border="0" alt="{$title}"/>
</a>
</xsl:template>
<xsl:template match="annotation" mode="annotation-popup">
<div class="annotation-nocss">
<p>
<a name="annot-{generate-id(.)}"/>
<xsl:text>Annotation #</xsl:text>
<xsl:number count="annotation" level="any" format="1"/>
<xsl:text>:</xsl:text>
</p>
</div>
<div id="popup-{generate-id(.)}" class="annotation-popup">
<xsl:if test="string-length(.) &gt; 300">
<xsl:attribute name="style">width:400px</xsl:attribute>
</xsl:if>
<xsl:call-template name="annotation-title"/>
<div class="annotation-body">
<xsl:apply-templates select="*[local-name(.) != 'title']"/>
</div>
<div class="annotation-close">
<a href="#" onclick="popup_{generate-id(.)}.hidePopup();return false;">
<xsl:apply-templates select="." mode="class.attribute"/>
<img src="{$annotation.graphic.close}" alt="X" border="0"/>
</a>
</div>
</div>
</xsl:template>
<xsl:template name="annotation-title">
<div class="annotation-title">
<xsl:choose>
<xsl:when test="title">
<xsl:apply-templates select="title/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>Annotation</xsl:text>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,797 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY % common.entities SYSTEM "../common/entities.ent">
%common.entities;
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exslt="http://exslt.org/common"
extension-element-prefixes="exslt"
exclude-result-prefixes="exslt"
version="1.0">
<!-- ********************************************************************
$Id: autoidx.xsl 9376 2012-05-24 18:32:40Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- The "basic" method derived from Jeni Tennison's work. -->
<!-- The "kosek" method contributed by Jirka Kosek. -->
<!-- The "kimber" method contributed by Eliot Kimber of Innodata Isogen. -->
<xsl:variable name="kimber.imported" select="0"/>
<xsl:variable name="kosek.imported" select="0"/>
<xsl:key name="letter"
match="indexterm"
use="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
<xsl:key name="primary"
match="indexterm"
use="&primary;"/>
<xsl:key name="secondary"
match="indexterm"
use="concat(&primary;, &sep;, &secondary;)"/>
<xsl:key name="tertiary"
match="indexterm"
use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/>
<xsl:key name="endofrange"
match="indexterm[@class='endofrange']"
use="@startref"/>
<xsl:key name="primary-section"
match="indexterm[not(secondary) and not(see)]"
use="concat(&primary;, &sep;, &section.id;)"/>
<xsl:key name="secondary-section"
match="indexterm[not(tertiary) and not(see)]"
use="concat(&primary;, &sep;, &secondary;, &sep;, &section.id;)"/>
<xsl:key name="tertiary-section"
match="indexterm[not(see)]"
use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, &section.id;)"/>
<xsl:key name="see-also"
match="indexterm[seealso]"
use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso)"/>
<xsl:key name="see"
match="indexterm[see]"
use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see)"/>
<xsl:key name="sections" match="*[@id or @xml:id]" use="@id|@xml:id"/>
<xsl:template name="generate-index">
<xsl:param name="scope" select="(ancestor::book|/)[last()]"/>
<xsl:choose>
<xsl:when test="$index.method = 'kosek'">
<xsl:call-template name="generate-kosek-index">
<xsl:with-param name="scope" select="$scope"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$index.method = 'kimber'">
<xsl:call-template name="generate-kimber-index">
<xsl:with-param name="scope" select="$scope"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="generate-basic-index">
<xsl:with-param name="scope" select="$scope"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="generate-basic-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:variable name="role">
<xsl:if test="$index.on.role != 0">
<xsl:value-of select="@role"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="type">
<xsl:if test="$index.on.type != 0">
<xsl:value-of select="@type"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="terms"
select="//indexterm
[count(.|key('letter',
translate(substring(&primary;, 1, 1),
&lowercase;,
&uppercase;))
[&scope;][1]) = 1
and not(@class = 'endofrange')]"/>
<xsl:variable name="alphabetical"
select="$terms[contains(concat(&lowercase;, &uppercase;),
substring(&primary;, 1, 1))]"/>
<xsl:variable name="others" select="$terms[not(contains(concat(&lowercase;,
&uppercase;),
substring(&primary;, 1, 1)))]"/>
<div class="index">
<xsl:if test="$others">
<xsl:choose>
<xsl:when test="normalize-space($type) != '' and
$others[@type = $type][count(.|key('primary', &primary;)[&scope;][1]) = 1]">
<div class="indexdiv">
<h3>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'index symbols'"/>
</xsl:call-template>
</h3>
<dl>
<xsl:apply-templates select="$others[count(.|key('primary', &primary;)[&scope;][1]) = 1]"
mode="index-symbol-div">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</dl>
</div>
</xsl:when>
<xsl:when test="normalize-space($type) != ''">
<!-- Output nothing, as there isn't a match for $other using this $type -->
</xsl:when>
<xsl:otherwise>
<div class="indexdiv">
<h3>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'index symbols'"/>
</xsl:call-template>
</h3>
<dl>
<xsl:apply-templates select="$others[count(.|key('primary',
&primary;)[&scope;][1]) = 1]"
mode="index-symbol-div">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</dl>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:apply-templates select="$alphabetical[count(.|key('letter',
translate(substring(&primary;, 1, 1),
&lowercase;,&uppercase;))[&scope;][1]) = 1]"
mode="index-div-basic">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</div>
</xsl:template>
<!-- This template not used if html/autoidx-kosek.xsl is imported -->
<xsl:template name="generate-kosek-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:if test="contains($vendor, 'libxslt')">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method does not </xsl:text>
<xsl:text>work with the xsltproc XSLT processor.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="$exsl.node.set.available = 0">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method requires the </xsl:text>
<xsl:text>exslt:node-set() function. Use a processor that </xsl:text>
<xsl:text>has it, or use a different index method.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="$kosek.imported = 0">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method requires the&#xA;</xsl:text>
<xsl:text>kosek index extensions be imported:&#xA;</xsl:text>
<xsl:text> xsl:import href="html/autoidx-kosek.xsl"</xsl:text>
</xsl:message>
</xsl:if>
</xsl:template>
<!-- This template not used if html/autoidx-kimber.xsl is imported -->
<xsl:template name="generate-kimber-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:if test="not(contains($vendor, 'SAXON '))">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kimber' index method requires the </xsl:text>
<xsl:text>Saxon version 6 or 8 XSLT processor.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="$kimber.imported = 0">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kimber' index method requires the&#xA;</xsl:text>
<xsl:text>kimber index extensions be imported:&#xA;</xsl:text>
<xsl:text> xsl:import href="html/autoidx-kimber.xsl"</xsl:text>
</xsl:message>
</xsl:if>
</xsl:template>
<xsl:template match="indexterm" mode="index-div-basic">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:variable name="key"
select="translate(substring(&primary;, 1, 1),
&lowercase;,&uppercase;)"/>
<xsl:if test="key('letter', $key)[&scope;]
[count(.|key('primary', &primary;)[&scope;][1]) = 1]">
<div class="indexdiv">
<xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
<h3>
<xsl:value-of select="translate($key, &lowercase;, &uppercase;)"/>
</h3>
</xsl:if>
<dl>
<xsl:apply-templates select="key('letter', $key)[&scope;]
[count(.|key('primary', &primary;)
[&scope;][1])=1]"
mode="index-primary">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</dl>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="indexterm" mode="index-symbol-div">
<xsl:param name="scope" select="/"/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:variable name="key" select="translate(substring(&primary;, 1, 1),
&lowercase;,&uppercase;)"/>
<xsl:apply-templates select="key('letter', $key)
[&scope;][count(.|key('primary', &primary;)[1]) = 1]"
mode="index-primary">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="indexterm" mode="index-primary">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:variable name="key" select="&primary;"/>
<xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
<dt>
<xsl:for-each select="$refs/primary">
<xsl:if test="@id or @xml:id">
<xsl:choose>
<xsl:when test="$generate.id.attributes = 0">
<a name="{(@id|@xml:id)[1]}"/>
</xsl:when>
<xsl:otherwise>
<span>
<xsl:call-template name="id.attribute"/>
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="primary"/>
<xsl:choose>
<xsl:when test="$index.links.to.section = 1">
<xsl:for-each select="$refs[@zone != '' or generate-id() = generate-id(key('primary-section', concat($key, &sep;, &section.id;))[&scope;][1])]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$refs[not(see)
and not(secondary)][&scope;]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$refs[not(secondary)]/*[self::see]">
<xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[&scope;][1])]"
mode="index-see">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</xsl:if>
</dt>
<xsl:choose>
<xsl:when test="$refs/secondary or $refs[not(secondary)]/*[self::seealso]">
<dd>
<dl>
<xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &sep;, &sep;, seealso))[&scope;][1])]"
mode="index-seealso">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
<xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]"
mode="index-secondary">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</dl>
</dd>
</xsl:when>
<!-- HTML5 requires dd for each dt -->
<xsl:when test="$div.element = 'section'">
<dd></dd>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="indexterm" mode="index-secondary">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
<xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
<dt>
<xsl:for-each select="$refs/secondary">
<xsl:if test="@id or @xml:id">
<xsl:choose>
<xsl:when test="$generate.id.attributes = 0">
<a name="{(@id|@xml:id)[1]}"/>
</xsl:when>
<xsl:otherwise>
<span>
<xsl:call-template name="id.attribute"/>
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="secondary"/>
<xsl:choose>
<xsl:when test="$index.links.to.section = 1">
<xsl:for-each select="$refs[@zone != '' or generate-id() = generate-id(key('secondary-section', concat($key, &sep;, &section.id;))[&scope;][1])]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$refs[not(see)
and not(tertiary)][&scope;]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$refs[not(tertiary)]/*[self::see]">
<xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, see))[&scope;][1])]"
mode="index-see">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</xsl:if>
</dt>
<xsl:choose>
<xsl:when test="$refs/tertiary or $refs[not(tertiary)]/*[self::seealso]">
<dd>
<dl>
<xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, seealso))[&scope;][1])]"
mode="index-seealso">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
<xsl:apply-templates select="$refs[tertiary and count(.|key('tertiary', concat($key, &sep;, &tertiary;))[&scope;][1]) = 1]"
mode="index-tertiary">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&tertiary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</dl>
</dd>
</xsl:when>
<!-- HTML5 requires dd for each dt -->
<xsl:when test="$div.element = 'section'">
<dd></dd>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="indexterm" mode="index-tertiary">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/>
<xsl:variable name="refs" select="key('tertiary', $key)[&scope;]"/>
<dt>
<xsl:for-each select="$refs/tertiary">
<xsl:if test="@id or @xml:id">
<xsl:choose>
<xsl:when test="$generate.id.attributes = 0">
<a name="{(@id|@xml:id)[1]}"/>
</xsl:when>
<xsl:otherwise>
<span>
<xsl:call-template name="id.attribute"/>
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="tertiary"/>
<xsl:choose>
<xsl:when test="$index.links.to.section = 1">
<xsl:for-each select="$refs[@zone != '' or generate-id() = generate-id(key('tertiary-section', concat($key, &sep;, &section.id;))[&scope;][1])]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$refs[not(see)][&scope;]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$refs/see">
<xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see))[&scope;][1])]"
mode="index-see">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</xsl:if>
</dt>
<xsl:choose>
<xsl:when test="$refs/seealso">
<dd>
<dl>
<xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso))[&scope;][1])]"
mode="index-seealso">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</dl>
</dd>
</xsl:when>
<!-- HTML5 requires dd for each dt -->
<xsl:when test="$div.element = 'section'">
<dd></dd>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="indexterm" mode="reference">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:param name="position"/>
<xsl:param name="separator" select="''"/>
<xsl:variable name="term.separator">
<xsl:call-template name="index.separator">
<xsl:with-param name="key" select="'index.term.separator'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="number.separator">
<xsl:call-template name="index.separator">
<xsl:with-param name="key" select="'index.number.separator'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="range.separator">
<xsl:call-template name="index.separator">
<xsl:with-param name="key" select="'index.range.separator'"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$separator != ''">
<xsl:value-of select="$separator"/>
</xsl:when>
<xsl:when test="$position = 1">
<xsl:value-of select="$term.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$number.separator"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="@zone and string(@zone)">
<xsl:call-template name="reference">
<xsl:with-param name="zones" select="normalize-space(@zone)"/>
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<a>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="&section;/titleabbrev and $index.prefer.titleabbrev != 0">
<xsl:apply-templates select="&section;" mode="titleabbrev.markup"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="&section;" mode="title.markup"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="$index.links.to.section = 1">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="&section;"/>
<xsl:with-param name="context"
select="(//index[&scope;] | //setindex[&scope;])[1]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
<xsl:with-param name="context"
select="(//index[&scope;] | //setindex[&scope;])[1]"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="$title"/> <!-- text only -->
</a>
<xsl:variable name="id" select="(@id|@xml:id)[1]"/>
<xsl:if test="key('endofrange', $id)[&scope;]">
<xsl:apply-templates select="key('endofrange', $id)[&scope;][last()]"
mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:with-param name="separator" select="$range.separator"/>
</xsl:apply-templates>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="reference">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:param name="zones"/>
<xsl:choose>
<xsl:when test="contains($zones, ' ')">
<xsl:variable name="zone" select="substring-before($zones, ' ')"/>
<xsl:variable name="target" select="key('sections', $zone)"/>
<a>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="id.attribute"/>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target[1]"/>
<xsl:with-param name="context" select="//index[&scope;][1]"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$target[1]" mode="index-title-content"/>
</a>
<xsl:text>, </xsl:text>
<xsl:call-template name="reference">
<xsl:with-param name="zones" select="substring-after($zones, ' ')"/>
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="zone" select="$zones"/>
<xsl:variable name="target" select="key('sections', $zone)"/>
<a>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="id.attribute"/>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target[1]"/>
<xsl:with-param name="context" select="//index[&scope;][1]"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$target[1]" mode="index-title-content"/>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="indexterm" mode="index-see">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:text> (</xsl:text>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'see'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:value-of select="see"/>
<xsl:text>)</xsl:text>
</xsl:template>
<xsl:template match="indexterm" mode="index-seealso">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:for-each select="seealso">
<xsl:sort select="translate(., &lowercase;, &uppercase;)"/>
<dt>
<xsl:text>(</xsl:text>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'seealso'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:value-of select="."/>
<xsl:text>)</xsl:text>
</dt>
<xsl:if test="$div.element = 'section'">
<dd></dd>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="*" mode="index-title-content">
<xsl:variable name="title">
<xsl:apply-templates select="&section;" mode="title.markup"/>
</xsl:variable>
<xsl:value-of select="$title"/>
</xsl:template>
<xsl:template name="index.separator">
<xsl:param name="key" select="''"/>
<xsl:param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:param>
<xsl:choose>
<xsl:when test="$key = 'index.term.separator'">
<xsl:choose>
<!-- Use the override if not blank -->
<xsl:when test="$index.term.separator != ''">
<xsl:copy-of select="$index.term.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="lang" select="$lang"/>
<xsl:with-param name="context">index</xsl:with-param>
<xsl:with-param name="name">term-separator</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$key = 'index.number.separator'">
<xsl:choose>
<!-- Use the override if not blank -->
<xsl:when test="$index.number.separator != ''">
<xsl:copy-of select="$index.number.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="lang" select="$lang"/>
<xsl:with-param name="context">index</xsl:with-param>
<xsl:with-param name="name">number-separator</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$key = 'index.range.separator'">
<xsl:choose>
<!-- Use the override if not blank -->
<xsl:when test="$index.range.separator != ''">
<xsl:copy-of select="$index.range.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="lang" select="$lang"/>
<xsl:with-param name="context">index</xsl:with-param>
<xsl:with-param name="name">range-separator</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,726 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: autotoc.xsl 9295 2012-04-19 19:05:29Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:variable name="toc.listitem.type">
<xsl:choose>
<xsl:when test="$toc.list.type = 'dl'">dt</xsl:when>
<xsl:otherwise>li</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- this is just hack because dl and ul aren't completely isomorphic -->
<xsl:variable name="toc.dd.type">
<xsl:choose>
<xsl:when test="$toc.list.type = 'dl'">dd</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:template name="make.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
<xsl:param name="nodes" select="/NOT-AN-ELEMENT"/>
<xsl:variable name="nodes.plus" select="$nodes | qandaset"/>
<xsl:variable name="toc.title">
<xsl:if test="$toc.title.p">
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<div class="toc-title">
<xsl:call-template name="gentext">
<xsl:with-param name="key">TableofContents</xsl:with-param>
</xsl:call-template>
</div>
</xsl:when>
<xsl:otherwise>
<p>
<b>
<xsl:call-template name="gentext">
<xsl:with-param name="key">TableofContents</xsl:with-param>
</xsl:call-template>
</b>
</p>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="$manual.toc != ''">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:variable name="toc" select="document($manual.toc, .)"/>
<xsl:variable name="tocentry" select="$toc//tocentry[@linkend=$id]"/>
<xsl:if test="$tocentry and $tocentry/*">
<div class="toc">
<xsl:copy-of select="$toc.title"/>
<xsl:element name="{$toc.list.type}">
<xsl:call-template name="manual-toc">
<xsl:with-param name="tocentry" select="$tocentry/*[1]"/>
</xsl:call-template>
</xsl:element>
</div>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$qanda.in.toc != 0">
<xsl:if test="$nodes.plus">
<div class="toc">
<xsl:copy-of select="$toc.title"/>
<xsl:element name="{$toc.list.type}">
<xsl:apply-templates select="$nodes.plus" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</xsl:element>
</div>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$nodes">
<div class="toc">
<xsl:copy-of select="$toc.title"/>
<xsl:element name="{$toc.list.type}">
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</xsl:element>
</div>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="make.lots">
<xsl:param name="toc.params" select="''"/>
<xsl:param name="toc"/>
<xsl:if test="contains($toc.params, 'toc')">
<xsl:copy-of select="$toc"/>
</xsl:if>
<xsl:if test="contains($toc.params, 'figure')">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'figure'"/>
<xsl:with-param name="nodes" select=".//figure"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="contains($toc.params, 'table')">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'table'"/>
<xsl:with-param name="nodes" select=".//table[not(@tocentry = 0)]"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="contains($toc.params, 'example')">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'example'"/>
<xsl:with-param name="nodes" select=".//example"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="contains($toc.params, 'equation')">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'equation'"/>
<xsl:with-param name="nodes" select=".//equation[title or info/title]"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="contains($toc.params, 'procedure')">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'procedure'"/>
<xsl:with-param name="nodes" select=".//procedure[title]"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- ====================================================================== -->
<xsl:template name="set.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
<xsl:call-template name="make.toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
<xsl:with-param name="nodes" select="book|setindex|set"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="division.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
<xsl:call-template name="make.toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
<xsl:with-param name="nodes" select="part|reference
|preface|chapter|appendix
|article
|topic
|bibliography|glossary|index
|refentry
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="component.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
<xsl:call-template name="make.toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
<xsl:with-param name="nodes" select="section|sect1
|simplesect[$simplesect.in.toc != 0]
|topic
|refentry
|article|bibliography|glossary
|appendix|index
|bridgehead[not(@renderas)
and $bridgehead.in.toc != 0]
|.//bridgehead[@renderas='sect1'
and $bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="component.toc.separator">
<!-- Customize to output something between
component.toc and first output -->
</xsl:template>
<xsl:template name="section.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
<xsl:call-template name="make.toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
<xsl:with-param name="nodes"
select="section|sect1|sect2|sect3|sect4|sect5|refentry
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="section.toc.separator">
<!-- Customize to output something between
section.toc and first output -->
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="subtoc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="nodes" select="NOT-AN-ELEMENT"/>
<xsl:variable name="nodes.plus" select="$nodes | qandaset"/>
<xsl:variable name="subtoc">
<xsl:element name="{$toc.list.type}">
<xsl:choose>
<xsl:when test="$qanda.in.toc != 0">
<xsl:apply-templates mode="toc" select="$nodes.plus">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="toc" select="$nodes">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:variable>
<xsl:variable name="depth">
<xsl:choose>
<xsl:when test="local-name(.) = 'section'">
<xsl:value-of select="count(ancestor::section) + 1"/>
</xsl:when>
<xsl:when test="local-name(.) = 'sect1'">1</xsl:when>
<xsl:when test="local-name(.) = 'sect2'">2</xsl:when>
<xsl:when test="local-name(.) = 'sect3'">3</xsl:when>
<xsl:when test="local-name(.) = 'sect4'">4</xsl:when>
<xsl:when test="local-name(.) = 'sect5'">5</xsl:when>
<xsl:when test="local-name(.) = 'refsect1'">1</xsl:when>
<xsl:when test="local-name(.) = 'refsect2'">2</xsl:when>
<xsl:when test="local-name(.) = 'refsect3'">3</xsl:when>
<xsl:when test="local-name(.) = 'topic'">1</xsl:when>
<xsl:when test="local-name(.) = 'simplesect'">
<!-- sigh... -->
<xsl:choose>
<xsl:when test="local-name(..) = 'section'">
<xsl:value-of select="count(ancestor::section)"/>
</xsl:when>
<xsl:when test="local-name(..) = 'sect1'">2</xsl:when>
<xsl:when test="local-name(..) = 'sect2'">3</xsl:when>
<xsl:when test="local-name(..) = 'sect3'">4</xsl:when>
<xsl:when test="local-name(..) = 'sect4'">5</xsl:when>
<xsl:when test="local-name(..) = 'sect5'">6</xsl:when>
<xsl:when test="local-name(..) = 'topic'">2</xsl:when>
<xsl:when test="local-name(..) = 'refsect1'">2</xsl:when>
<xsl:when test="local-name(..) = 'refsect2'">3</xsl:when>
<xsl:when test="local-name(..) = 'refsect3'">4</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
<xsl:variable name="subtoc.list">
<xsl:choose>
<xsl:when test="$toc.dd.type = ''">
<xsl:copy-of select="$subtoc"/>
</xsl:when>
<xsl:otherwise>
<xsl:element name="{$toc.dd.type}">
<xsl:copy-of select="$subtoc"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="{$toc.listitem.type}">
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
<xsl:if test="$toc.listitem.type = 'li' and
( (self::set or self::book or self::part) or
$toc.section.depth > $depth) and
( ($qanda.in.toc = 0 and count($nodes)&gt;0) or
($qanda.in.toc != 0 and count($nodes.plus)&gt;0) )
and $toc.max.depth > $depth.from.context">
<xsl:copy-of select="$subtoc.list"/>
</xsl:if>
</xsl:element>
<xsl:if test="$toc.listitem.type != 'li' and
( (self::set or self::book or self::part) or
$toc.section.depth > $depth) and
( ($qanda.in.toc = 0 and count($nodes)&gt;0) or
($qanda.in.toc != 0 and count($nodes.plus)&gt;0) )
and $toc.max.depth > $depth.from.context">
<xsl:copy-of select="$subtoc.list"/>
</xsl:if>
</xsl:template>
<xsl:template name="toc.line">
<xsl:param name="toc-context" select="."/>
<xsl:param name="depth" select="1"/>
<xsl:param name="depth.from.context" select="8"/>
<span>
<xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
<!-- * if $autotoc.label.in.hyperlink is zero, then output the label -->
<!-- * before the hyperlinked title (as the DSSSL stylesheet does) -->
<xsl:if test="$autotoc.label.in.hyperlink = 0">
<xsl:variable name="label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
<xsl:copy-of select="$label"/>
<xsl:if test="$label != ''">
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
</xsl:if>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="context" select="$toc-context"/>
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:attribute>
<!-- * if $autotoc.label.in.hyperlink is non-zero, then output the label -->
<!-- * as part of the hyperlinked title -->
<xsl:if test="not($autotoc.label.in.hyperlink = 0)">
<xsl:variable name="label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
<xsl:copy-of select="$label"/>
<xsl:if test="$label != ''">
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
</xsl:if>
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
</a>
</span>
</xsl:template>
<xsl:template match="book" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="part|reference
|preface|chapter|appendix
|article
|topic
|bibliography|glossary|index
|refentry
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="setindex" mode="toc">
<xsl:param name="toc-context" select="."/>
<!-- If the setindex tag is not empty, it should be it in the TOC -->
<xsl:if test="* or $generate.index != 0">
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="part|reference" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="appendix|chapter|article|topic
|index|glossary|bibliography
|preface|reference|refentry
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="preface|chapter|appendix|article|topic" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="section|sect1
|simplesect[$simplesect.in.toc != 0]
|topic
|refentry
|glossary|bibliography|index
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect1" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="sect2
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect2" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="sect3
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect3" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="sect4
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect4" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="sect5
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect5" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="simplesect" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="section" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="section|refentry
|simplesect[$simplesect.in.toc != 0]
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="topic" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="section|refentry
|simplesect[$simplesect.in.toc != 0]
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="bridgehead" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:if test="$bridgehead.in.toc != 0">
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="bibliography|glossary" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="index" mode="toc">
<xsl:param name="toc-context" select="."/>
<!-- If the index tag is not empty, it should be it in the TOC -->
<xsl:if test="* or $generate.index != 0">
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="refentry" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:variable name="refmeta" select=".//refmeta"/>
<xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
<xsl:variable name="refnamediv" select=".//refnamediv"/>
<xsl:variable name="refname" select="$refnamediv//refname"/>
<xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="$refentrytitle">
<xsl:apply-templates select="$refentrytitle[1]"
mode="titleabbrev.markup"/>
</xsl:when>
<xsl:when test="$refdesc">
<xsl:apply-templates select="$refdesc"
mode="titleabbrev.markup"/>
</xsl:when>
<xsl:when test="$refname">
<xsl:apply-templates select="$refname[1]"
mode="titleabbrev.markup"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:element name="{$toc.listitem.type}">
<span class='refentrytitle'>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:attribute>
<xsl:copy-of select="$title"/>
</a>
</span>
<span class='refpurpose'>
<xsl:if test="$annotate.toc != 0">
<!-- * DocBook 5 says inlinemediaobject (among other things) -->
<!-- * is allowed in refpurpose; so we need to run -->
<!-- * apply-templates on refpurpose here, instead of value-of -->
<xsl:apply-templates select="refnamediv/refpurpose" mode="no.anchor.mode"/>
</xsl:if>
</span>
</xsl:element>
</xsl:template>
<xsl:template match="title" mode="toc">
<xsl:param name="toc-context" select="."/>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select=".."/>
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template name="manual-toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="tocentry"/>
<!-- be careful, we don't want to change the current document to the other tree! -->
<xsl:if test="$tocentry">
<xsl:variable name="node" select="key('id', $tocentry/@linkend)"/>
<xsl:element name="{$toc.listitem.type}">
<xsl:variable name="label">
<xsl:apply-templates select="$node" mode="label.markup"/>
</xsl:variable>
<xsl:copy-of select="$label"/>
<xsl:if test="$label != ''">
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$node"/>
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$node" mode="titleabbrev.markup"/>
</a>
</xsl:element>
<xsl:if test="$tocentry/*">
<xsl:element name="{$toc.list.type}">
<xsl:call-template name="manual-toc">
<xsl:with-param name="tocentry" select="$tocentry/*[1]"/>
</xsl:call-template>
</xsl:element>
</xsl:if>
<xsl:if test="$tocentry/following-sibling::*">
<xsl:call-template name="manual-toc">
<xsl:with-param name="tocentry" select="$tocentry/following-sibling::*[1]"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="list.of.titles">
<xsl:param name="toc-context" select="."/>
<xsl:param name="titles" select="'table'"/>
<xsl:param name="nodes" select=".//table"/>
<xsl:if test="$nodes">
<div class="list-of-{$titles}s">
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<div class="toc-title">
<xsl:call-template name="gentext">
<xsl:with-param name="key">
<xsl:choose>
<xsl:when test="$titles='table'">ListofTables</xsl:when>
<xsl:when test="$titles='figure'">ListofFigures</xsl:when>
<xsl:when test="$titles='equation'">ListofEquations</xsl:when>
<xsl:when test="$titles='example'">ListofExamples</xsl:when>
<xsl:when test="$titles='procedure'">ListofProcedures</xsl:when>
<xsl:otherwise>ListofUnknown</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</div>
</xsl:when>
<xsl:otherwise>
<p>
<b>
<xsl:call-template name="gentext">
<xsl:with-param name="key">
<xsl:choose>
<xsl:when test="$titles='table'">ListofTables</xsl:when>
<xsl:when test="$titles='figure'">ListofFigures</xsl:when>
<xsl:when test="$titles='equation'">ListofEquations</xsl:when>
<xsl:when test="$titles='example'">ListofExamples</xsl:when>
<xsl:when test="$titles='procedure'">ListofProcedures</xsl:when>
<xsl:otherwise>ListofUnknown</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</b>
</p>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="{$toc.list.type}">
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</xsl:element>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="figure|table|example|equation|procedure" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:element name="{$toc.listitem.type}">
<xsl:variable name="label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
<xsl:copy-of select="$label"/>
<xsl:if test="$label != ''">
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
</a>
</xsl:element>
</xsl:template>
<!-- Used only if qanda.in.toc parameter is non-zero -->
<xsl:template match="qandaset" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="qandadiv | qandaentry"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="qandadiv|qandaentry" mode="toc">
<xsl:apply-templates select="." mode="qandatoc.mode"/>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,568 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: block.xsl 9353 2012-05-12 23:24:54Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- What should we do about styling blockinfo? -->
<xsl:template match="blockinfo|info">
<!-- suppress -->
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="block.object">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="para">
<xsl:call-template name="paragraph">
<xsl:with-param name="class">
<xsl:if test="@role and $para.propagates.style != 0">
<xsl:value-of select="@role"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="content">
<xsl:if test="position() = 1 and parent::listitem">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="parent::listitem"/>
</xsl:call-template>
</xsl:if>
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="paragraph">
<xsl:param name="class" select="''"/>
<xsl:param name="content"/>
<xsl:variable name="p">
<p>
<xsl:call-template name="id.attribute"/>
<xsl:choose>
<xsl:when test="$class != ''">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="class" select="$class"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="class" select="''"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:copy-of select="$content"/>
</p>
</xsl:variable>
<xsl:choose>
<xsl:when test="$html.cleanup != 0">
<xsl:call-template name="unwrap.p">
<xsl:with-param name="p" select="$p"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$p"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="simpara">
<!-- see also listitem/simpara in lists.xsl -->
<p>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="locale.html.attributes"/>
<xsl:if test="@role and $para.propagates.style != 0">
<xsl:apply-templates select="." mode="class.attribute">
<xsl:with-param name="class" select="@role"/>
</xsl:apply-templates>
</xsl:if>
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="formalpara">
<xsl:call-template name="paragraph">
<xsl:with-param name="class">
<xsl:if test="@role and $para.propagates.style != 0">
<xsl:value-of select="@role"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="content">
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- Only use title from info -->
<xsl:template match="formalpara/info">
<xsl:apply-templates select="title"/>
</xsl:template>
<xsl:template match="formalpara/title|formalpara/info/title">
<xsl:variable name="titleStr">
<xsl:apply-templates/>
</xsl:variable>
<xsl:variable name="lastChar">
<xsl:if test="$titleStr != ''">
<xsl:value-of select="substring($titleStr,string-length($titleStr),1)"/>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<span class="formalpara-title">
<xsl:copy-of select="$titleStr"/>
<xsl:if test="$lastChar != ''
and not(contains($runinhead.title.end.punct, $lastChar))">
<xsl:value-of select="$runinhead.default.title.end.punct"/>
</xsl:if>
<xsl:text>&#160;</xsl:text>
</span>
</xsl:when>
<xsl:otherwise>
<b>
<xsl:copy-of select="$titleStr"/>
<xsl:if test="$lastChar != ''
and not(contains($runinhead.title.end.punct, $lastChar))">
<xsl:value-of select="$runinhead.default.title.end.punct"/>
</xsl:if>
<xsl:text>&#160;</xsl:text>
</b>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="formalpara/para">
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="blockquote">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor"/>
<xsl:choose>
<xsl:when test="attribution">
<table border="{$table.border.off}" class="blockquote">
<xsl:if test="$css.decoration != 0">
<xsl:attribute name="style">
<xsl:text>width: 100%; cellspacing: 0; cellpadding: 0;</xsl:text>
</xsl:attribute>
</xsl:if>
<xsl:if test="$div.element != 'section'">
<xsl:attribute name="summary">Block quote</xsl:attribute>
</xsl:if>
<tr>
<td width="10%" valign="top">&#160;</td>
<td width="80%" valign="top">
<xsl:apply-templates select="child::*[local-name(.)!='attribution']"/>
</td>
<td width="10%" valign="top">&#160;</td>
</tr>
<tr>
<td width="10%" valign="top">&#160;</td>
<td colspan="2" align="{$direction.align.end}" valign="top">
<xsl:text>--</xsl:text>
<xsl:apply-templates select="attribution"/>
</td>
</tr>
</table>
</xsl:when>
<xsl:otherwise>
<blockquote>
<xsl:call-template name="common.html.attributes"/>
<xsl:apply-templates/>
</blockquote>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
<xsl:template match="blockquote/title|blockquote/info/title">
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<div class="blockquote-title">
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:otherwise>
<div class="blockquote-title">
<p>
<b>
<xsl:apply-templates/>
</b>
</p>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Use an em dash per Chicago Manual of Style and https://sourceforge.net/tracker/index.php?func=detail&aid=2793878&group_id=21935&atid=373747 -->
<xsl:template match="epigraph">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:apply-templates select="para|simpara|formalpara|literallayout"/>
<xsl:if test="attribution">
<div class="attribution">
<span>&#x2014;<xsl:apply-templates select="attribution"/></span>
</div>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="attribution">
<span>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="abstract|sidebar">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor"/>
<xsl:call-template name="sidebar.titlepage"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="abstract/title|sidebar/title">
</xsl:template>
<xsl:template match="sidebar/sidebarinfo|sidebar/info"/>
<!-- ==================================================================== -->
<xsl:template match="msgset">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgentry">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="simplemsgentry">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msg">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msgmain">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgmain/title">
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<span class="msgmain-title">
<xsl:apply-templates/>
</span>
</xsl:when>
<xsl:otherwise>
<b><xsl:apply-templates/></b>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="msgsub">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgsub/title">
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<span class="msgsub-title">
<xsl:apply-templates/>
</span>
</xsl:when>
<xsl:otherwise>
<b><xsl:apply-templates/></b>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="msgrel">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgrel/title">
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<span class="msgrel-title">
<xsl:apply-templates/>
</span>
</xsl:when>
<xsl:otherwise>
<b><xsl:apply-templates/></b>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="msgtext">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msginfo">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msglevel">
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<div class="msglevel">
<span class="msglevel-title">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgLevel'"/>
</xsl:call-template>
</span>
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:otherwise>
<p>
<b>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgLevel'"/>
</xsl:call-template>
</b>
<xsl:apply-templates/>
</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="msgorig">
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<div class="msgorig">
<span class="msgorig-title">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgOrig'"/>
</xsl:call-template>
</span>
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:otherwise>
<p>
<b>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgOrig'"/>
</xsl:call-template>
</b>
<xsl:apply-templates/>
</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="msgaud">
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<div class="msgaud">
<span class="msgaud-title">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgAud'"/>
</xsl:call-template>
</span>
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:otherwise>
<p>
<b>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgAud'"/>
</xsl:call-template>
</b>
<xsl:apply-templates/>
</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="msgexplan">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msgexplan/title">
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<div class="msgexplan">
<span class="msgexplan-title">
<xsl:apply-templates/>
</span>
</div>
</xsl:when>
<xsl:otherwise>
<p>
<b>
<xsl:apply-templates/>
</b>
</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="revhistory">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<table>
<xsl:if test="$css.decoration != 0">
<xsl:attribute name="style">
<xsl:text>border-style:solid; width:100%;</xsl:text>
</xsl:attribute>
</xsl:if>
<!-- include summary attribute if not HTML5 -->
<xsl:if test="$div.element != 'section'">
<xsl:attribute name="summary">
<xsl:call-template name="gentext">
<xsl:with-param name="key">revhistory</xsl:with-param>
</xsl:call-template>
</xsl:attribute>
</xsl:if>
<tr>
<th align="{$direction.align.start}" valign="top" colspan="3">
<b>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'RevHistory'"/>
</xsl:call-template>
</b>
</th>
</tr>
<xsl:apply-templates/>
</table>
</div>
</xsl:template>
<xsl:template match="revhistory/revision">
<xsl:variable name="revnumber" select="revnumber"/>
<xsl:variable name="revdate" select="date"/>
<xsl:variable name="revauthor" select="authorinitials|author"/>
<xsl:variable name="revremark" select="revremark|revdescription"/>
<tr>
<td align="{$direction.align.start}">
<xsl:if test="$revnumber">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Revision'"/>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:apply-templates select="$revnumber"/>
</xsl:if>
</td>
<td align="{$direction.align.start}">
<xsl:apply-templates select="$revdate"/>
</td>
<xsl:choose>
<xsl:when test="count($revauthor)=0">
<td align="{$direction.align.start}">
<xsl:call-template name="dingbat">
<xsl:with-param name="dingbat">nbsp</xsl:with-param>
</xsl:call-template>
</td>
</xsl:when>
<xsl:otherwise>
<td align="{$direction.align.start}">
<xsl:for-each select="$revauthor">
<xsl:apply-templates select="."/>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</td>
</xsl:otherwise>
</xsl:choose>
</tr>
<xsl:if test="$revremark">
<tr>
<td align="{$direction.align.start}" colspan="3">
<xsl:apply-templates select="$revremark"/>
</td>
</tr>
</xsl:if>
</xsl:template>
<xsl:template match="revision/revnumber">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/date">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/authorinitials">
<xsl:text>, </xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/authorinitials[1]" priority="2">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/revremark">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/revdescription">
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="ackno|acknowledgements[parent::article]">
<xsl:call-template name="block.object"/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="highlights">
<xsl:call-template name="block.object"/>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@ -1,222 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim"
xmlns:xverb="xalan://com.nwalsh.xalan.Verbatim"
xmlns:lxslt="http://xml.apache.org/xslt"
exclude-result-prefixes="sverb xverb lxslt"
version='1.0'>
<!-- ********************************************************************
$Id: callout.xsl 9305 2012-04-27 21:50:53Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<lxslt:component prefix="xverb"
functions="insertCallouts"/>
<xsl:template match="programlistingco|screenco">
<xsl:variable name="verbatim" select="programlisting|screen"/>
<xsl:choose>
<xsl:when test="$use.extensions != '0'
and $callouts.extension != '0'">
<xsl:variable name="rtf">
<xsl:apply-templates select="$verbatim">
<xsl:with-param name="suppress-numbers" select="'1'"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:variable name="rtf-with-callouts">
<xsl:choose>
<xsl:when test="function-available('sverb:insertCallouts')">
<xsl:copy-of select="sverb:insertCallouts(areaspec,$rtf)"/>
</xsl:when>
<xsl:when test="function-available('xverb:insertCallouts')">
<xsl:copy-of select="xverb:insertCallouts(areaspec,$rtf)"/>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>No insertCallouts function is available.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$verbatim/@linenumbering = 'numbered'
and $linenumbering.extension != '0'">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="number.rtf.lines">
<xsl:with-param name="rtf" select="$rtf-with-callouts"/>
<xsl:with-param name="pi.context"
select="programlisting|screen"/>
</xsl:call-template>
<xsl:apply-templates select="calloutlist"/>
</div>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:copy-of select="$rtf-with-callouts"/>
<xsl:apply-templates select="calloutlist"/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:apply-templates/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="areaspec|areaset|area">
</xsl:template>
<xsl:template match="areaset" mode="conumber">
<xsl:number count="area|areaset" format="1"/>
</xsl:template>
<xsl:template match="area" mode="conumber">
<xsl:number count="area|areaset" format="1"/>
</xsl:template>
<xsl:template match="co" name="co">
<!-- Support a single linkend in HTML -->
<xsl:variable name="targets" select="key('id', @linkends)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:choose>
<xsl:when test="$target">
<a>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:choose>
<xsl:when test="$generate.id.attributes = 0">
<!-- force an id attribute here -->
<xsl:if test="@id or @xml:id">
<xsl:attribute name="name">
<xsl:value-of select="(@id|@xml:id)[1]"/>
</xsl:attribute>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="id.attribute"/>
</xsl:otherwise>
</xsl:choose>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="." mode="callout-bug"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$generate.id.attributes != 0">
<xsl:if test="@id or @xml:id">
<span>
<xsl:attribute name="id">
<xsl:value-of select="(@id|@xml:id)[1]"/>
</xsl:attribute>
</span>
</xsl:if>
</xsl:if>
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="." mode="callout-bug"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="coref">
<!-- tricky; this relies on the fact that we can process the "co" that's -->
<!-- "over there" as if it were "right here" -->
<xsl:variable name="co" select="key('id', @linkend)"/>
<xsl:choose>
<xsl:when test="not($co)">
<xsl:message>
<xsl:text>Error: coref link is broken: </xsl:text>
<xsl:value-of select="@linkend"/>
</xsl:message>
</xsl:when>
<xsl:when test="local-name($co) != 'co'">
<xsl:message>
<xsl:text>Error: coref doesn't point to a co: </xsl:text>
<xsl:value-of select="@linkend"/>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$co"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="co" mode="callout-bug">
<xsl:call-template name="callout-bug">
<xsl:with-param name="conum">
<xsl:number count="co"
level="any"
from="programlisting|screen|literallayout|synopsis"
format="1"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="callout-bug">
<xsl:param name="conum" select='1'/>
<xsl:choose>
<xsl:when test="$callout.graphics != 0
and $conum &lt;= $callout.graphics.number.limit">
<!-- Added span to make valid in XHTML 1 -->
<span><img src="{$callout.graphics.path}{$conum}{$callout.graphics.extension}"
alt="{$conum}" border="0"/></span>
</xsl:when>
<xsl:when test="$callout.unicode != 0
and $conum &lt;= $callout.unicode.number.limit">
<xsl:choose>
<xsl:when test="$callout.unicode.start.character = 10102">
<xsl:choose>
<xsl:when test="$conum = 1">&#10102;</xsl:when>
<xsl:when test="$conum = 2">&#10103;</xsl:when>
<xsl:when test="$conum = 3">&#10104;</xsl:when>
<xsl:when test="$conum = 4">&#10105;</xsl:when>
<xsl:when test="$conum = 5">&#10106;</xsl:when>
<xsl:when test="$conum = 6">&#10107;</xsl:when>
<xsl:when test="$conum = 7">&#10108;</xsl:when>
<xsl:when test="$conum = 8">&#10109;</xsl:when>
<xsl:when test="$conum = 9">&#10110;</xsl:when>
<xsl:when test="$conum = 10">&#10111;</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Don't know how to generate Unicode callouts </xsl:text>
<xsl:text>when $callout.unicode.start.character is </xsl:text>
<xsl:value-of select="$callout.unicode.start.character"/>
</xsl:message>
<xsl:text>(</xsl:text>
<xsl:value-of select="$conum"/>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>(</xsl:text>
<xsl:value-of select="$conum"/>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,452 +0,0 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://icl.com/saxon"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="http://xml.apache.org/xalan/redirect"
xmlns:exsl="http://exslt.org/common"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
version="1.0"
exclude-result-prefixes="saxon lxslt redirect exsl doc"
extension-element-prefixes="saxon redirect lxslt exsl">
<!-- ********************************************************************
$Id: chunker.xsl 9147 2011-11-12 00:05:44Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- This stylesheet works with XSLT implementations that support -->
<!-- exsl:document, saxon:output, or Xalan's redirect:write -->
<!-- Note: Only Saxon 6.4.2 or later is supported. -->
<xsl:param name="chunker.output.method" select="'html'"/>
<xsl:param name="chunker.output.encoding" select="'ISO-8859-1'"/>
<xsl:param name="chunker.output.indent" select="'no'"/>
<xsl:param name="chunker.output.omit-xml-declaration" select="'no'"/>
<xsl:param name="chunker.output.standalone" select="'no'"/>
<xsl:param name="chunker.output.doctype-public" select="''"/>
<xsl:param name="chunker.output.doctype-system" select="''"/>
<xsl:param name="chunker.output.media-type" select="''"/>
<xsl:param name="chunker.output.cdata-section-elements" select="''"/>
<!-- Make sure base.dir has a trailing slash now -->
<xsl:param name="chunk.base.dir">
<xsl:choose>
<xsl:when test="string-length($base.dir) = 0"></xsl:when>
<!-- make sure to add trailing slash if omitted by user -->
<xsl:when test="substring($base.dir, string-length($base.dir), 1) = '/'">
<xsl:value-of select="$base.dir"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($base.dir, '/')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="saxon.character.representation" select="'entity;decimal'"/>
<!-- ==================================================================== -->
<xsl:template name="make-relative-filename">
<xsl:param name="base.dir" select="'./'"/>
<xsl:param name="base.name" select="''"/>
<xsl:choose>
<!-- put Saxon first to work around a bug in libxslt -->
<xsl:when test="element-available('saxon:output')">
<!-- Saxon doesn't make the chunks relative -->
<xsl:value-of select="concat($chunk.base.dir,$base.name)"/>
</xsl:when>
<xsl:when test="element-available('exsl:document')">
<!-- EXSL document does make the chunks relative, I think -->
<xsl:choose>
<xsl:when test="count(parent::*) = 0">
<xsl:value-of select="concat($chunk.base.dir,$base.name)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$base.name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="element-available('redirect:write')">
<!-- Xalan doesn't make the chunks relative -->
<xsl:value-of select="concat($chunk.base.dir,$base.name)"/>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>Don't know how to chunk with </xsl:text>
<xsl:value-of select="system-property('xsl:vendor')"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="write.chunk">
<xsl:param name="filename" select="''"/>
<xsl:param name="quiet" select="$chunk.quietly"/>
<xsl:param name="suppress-context-node-name" select="0"/>
<xsl:param name="message-prolog"/>
<xsl:param name="message-epilog"/>
<xsl:param name="method" select="$chunker.output.method"/>
<xsl:param name="encoding" select="$chunker.output.encoding"/>
<xsl:param name="indent" select="$chunker.output.indent"/>
<xsl:param name="omit-xml-declaration"
select="$chunker.output.omit-xml-declaration"/>
<xsl:param name="standalone" select="$chunker.output.standalone"/>
<xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
<xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
<xsl:param name="media-type" select="$chunker.output.media-type"/>
<xsl:param name="cdata-section-elements"
select="$chunker.output.cdata-section-elements"/>
<xsl:param name="content"/>
<xsl:if test="$quiet = 0">
<xsl:message>
<xsl:if test="not($message-prolog = '')">
<xsl:value-of select="$message-prolog"/>
</xsl:if>
<xsl:text>Writing </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:if test="name(.) != '' and $suppress-context-node-name = 0">
<xsl:text> for </xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:if test="@id or @xml:id">
<xsl:text>(</xsl:text>
<xsl:value-of select="(@id|@xml:id)[1]"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:if>
<xsl:if test="not($message-epilog = '')">
<xsl:value-of select="$message-epilog"/>
</xsl:if>
</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="element-available('exsl:document')">
<xsl:choose>
<!-- Handle the permutations ... -->
<xsl:when test="$media-type != ''">
<xsl:choose>
<xsl:when test="$doctype-public != '' and $doctype-system != ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-public="{$doctype-public}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:when test="$doctype-public != '' and $doctype-system = ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-public="{$doctype-public}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:when test="$doctype-public = '' and $doctype-system != ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$doctype-public != '' and $doctype-system != ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-public="{$doctype-public}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:when test="$doctype-public != '' and $doctype-system = ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-public="{$doctype-public}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:when test="$doctype-public = '' and $doctype-system != ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="element-available('saxon:output')">
<xsl:choose>
<!-- Handle the permutations ... -->
<xsl:when test="$media-type != ''">
<xsl:choose>
<xsl:when test="$doctype-public != '' and $doctype-system != ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-public="{$doctype-public}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="$doctype-public != '' and $doctype-system = ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-public="{$doctype-public}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="$doctype-public = '' and $doctype-system != ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$doctype-public != '' and $doctype-system != ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-public="{$doctype-public}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="$doctype-public != '' and $doctype-system = ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-public="{$doctype-public}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="$doctype-public = '' and $doctype-system != ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="element-available('redirect:write')">
<!-- Xalan uses redirect -->
<redirect:write file="{$filename}">
<xsl:copy-of select="$content"/>
</redirect:write>
</xsl:when>
<xsl:otherwise>
<!-- it doesn't matter since we won't be making chunks... -->
<xsl:message terminate="yes">
<xsl:text>Can't make chunks with </xsl:text>
<xsl:value-of select="system-property('xsl:vendor')"/>
<xsl:text>'s processor.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="write.chunk.with.doctype">
<xsl:param name="filename" select="''"/>
<xsl:param name="quiet" select="$chunk.quietly"/>
<xsl:param name="method" select="$chunker.output.method"/>
<xsl:param name="encoding" select="$chunker.output.encoding"/>
<xsl:param name="indent" select="$chunker.output.indent"/>
<xsl:param name="omit-xml-declaration"
select="$chunker.output.omit-xml-declaration"/>
<xsl:param name="standalone" select="$chunker.output.standalone"/>
<xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
<xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
<xsl:param name="media-type" select="$chunker.output.media-type"/>
<xsl:param name="cdata-section-elements"
select="$chunker.output.cdata-section-elements"/>
<xsl:param name="content"/>
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename" select="$filename"/>
<xsl:with-param name="quiet" select="$quiet"/>
<xsl:with-param name="method" select="$method"/>
<xsl:with-param name="encoding" select="$encoding"/>
<xsl:with-param name="indent" select="$indent"/>
<xsl:with-param name="omit-xml-declaration" select="$omit-xml-declaration"/>
<xsl:with-param name="standalone" select="$standalone"/>
<xsl:with-param name="doctype-public" select="$doctype-public"/>
<xsl:with-param name="doctype-system" select="$doctype-system"/>
<xsl:with-param name="media-type" select="$media-type"/>
<xsl:with-param name="cdata-section-elements" select="$cdata-section-elements"/>
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="write.text.chunk">
<xsl:param name="filename" select="''"/>
<xsl:param name="quiet" select="$chunk.quietly"/>
<xsl:param name="suppress-context-node-name" select="0"/>
<xsl:param name="message-prolog"/>
<xsl:param name="message-epilog"/>
<xsl:param name="method" select="'text'"/>
<xsl:param name="encoding" select="$chunker.output.encoding"/>
<xsl:param name="media-type" select="$chunker.output.media-type"/>
<xsl:param name="content"/>
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename" select="$filename"/>
<xsl:with-param name="quiet" select="$quiet"/>
<xsl:with-param name="suppress-context-node-name" select="$suppress-context-node-name"/>
<xsl:with-param name="message-prolog" select="$message-prolog"/>
<xsl:with-param name="message-epilog" select="$message-epilog"/>
<xsl:with-param name="method" select="$method"/>
<xsl:with-param name="encoding" select="$encoding"/>
<xsl:with-param name="indent" select="'no'"/>
<xsl:with-param name="omit-xml-declaration" select="'no'"/>
<xsl:with-param name="standalone" select="'no'"/>
<xsl:with-param name="doctype-public"/>
<xsl:with-param name="doctype-system"/>
<xsl:with-param name="media-type" select="$media-type"/>
<xsl:with-param name="cdata-section-elements"/>
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,471 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: component.xsl 9356 2012-05-12 23:33:15Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- Set to 2 for backwards compatibility -->
<xsl:param name="component.heading.level" select="2"/>
<xsl:template name="component.title">
<xsl:param name="node" select="."/>
<!-- This handles the case where a component (bibliography, for example)
occurs inside a section; will we need parameters for this? -->
<!-- This "level" is a section level. To compute <h> level, add 1. -->
<xsl:variable name="level">
<xsl:choose>
<!-- chapters and other book children should get <h1> -->
<xsl:when test="$node/parent::book">0</xsl:when>
<xsl:when test="ancestor::section">
<xsl:value-of select="count(ancestor::section)+1"/>
</xsl:when>
<xsl:when test="ancestor::sect5">6</xsl:when>
<xsl:when test="ancestor::sect4">5</xsl:when>
<xsl:when test="ancestor::sect3">4</xsl:when>
<xsl:when test="ancestor::sect2">3</xsl:when>
<xsl:when test="ancestor::sect1">2</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="h{$level+1}">
<xsl:attribute name="class">title</xsl:attribute>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates select="$node" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</xsl:element>
</xsl:template>
<xsl:template name="component.subtitle">
<xsl:param name="node" select="."/>
<xsl:variable name="subtitle"
select="($node/docinfo/subtitle
|$node/info/subtitle
|$node/prefaceinfo/subtitle
|$node/chapterinfo/subtitle
|$node/appendixinfo/subtitle
|$node/articleinfo/subtitle
|$node/artheader/subtitle
|$node/subtitle)[1]"/>
<xsl:if test="$subtitle">
<h3 class="subtitle">
<xsl:call-template name="id.attribute"/>
<i>
<xsl:apply-templates select="$node" mode="object.subtitle.markup"/>
</i>
</h3>
</xsl:if>
</xsl:template>
<xsl:template name="component.separator">
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="dedication" mode="dedication">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="dedication.titlepage"/>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="dedication/title|dedication/info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::dedication[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dedication/subtitle|dedication/info/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::dedication[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dedication"></xsl:template> <!-- see mode="dedication" -->
<xsl:template match="dedication/title"></xsl:template>
<xsl:template match="dedication/subtitle"></xsl:template>
<xsl:template match="dedication/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="acknowledgements" mode="acknowledgements">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="acknowledgements.titlepage"/>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="acknowledgements/title|acknowledgements/info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::acknowledgements[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="acknowledgements/subtitle|acknowledgements/info/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::acknowledgements[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="acknowledgements"></xsl:template> <!-- see mode="acknowledgements" -->
<xsl:template match="acknowledgements/title"></xsl:template>
<xsl:template match="acknowledgements/subtitle"></xsl:template>
<xsl:template match="acknowledgements/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="colophon">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="component.separator"/>
<xsl:call-template name="component.title"/>
<xsl:call-template name="component.subtitle"/>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="colophon/title"></xsl:template>
<xsl:template match="colophon/subtitle"></xsl:template>
<xsl:template match="colophon/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="preface">
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="component.separator"/>
<xsl:call-template name="preface.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')">
<xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="component.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</xsl:element>
</xsl:template>
<xsl:template match="preface/title" mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::preface[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="preface/subtitle
|preface/prefaceinfo/subtitle
|preface/info/subtitle
|preface/docinfo/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::preface[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="preface/docinfo|prefaceinfo"></xsl:template>
<xsl:template match="preface/info"></xsl:template>
<xsl:template match="preface/title"></xsl:template>
<xsl:template match="preface/titleabbrev"></xsl:template>
<xsl:template match="preface/subtitle"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="chapter">
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="component.separator"/>
<xsl:call-template name="chapter.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')">
<xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="component.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</xsl:element>
</xsl:template>
<xsl:template match="chapter/title|chapter/chapterinfo/title|chapter/info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::chapter[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="chapter/subtitle
|chapter/chapterinfo/subtitle
|chapter/info/subtitle
|chapter/docinfo/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::chapter[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="chapter/docinfo|chapterinfo"></xsl:template>
<xsl:template match="chapter/info"></xsl:template>
<xsl:template match="chapter/title"></xsl:template>
<xsl:template match="chapter/titleabbrev"></xsl:template>
<xsl:template match="chapter/subtitle"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="appendix">
<xsl:variable name="ischunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="parent::article and $ischunk = 0">
<xsl:call-template name="section.heading">
<xsl:with-param name="level" select="1"/>
<xsl:with-param name="title">
<xsl:apply-templates select="." mode="object.title.markup"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="component.separator"/>
<xsl:call-template name="appendix.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')">
<xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="component.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:if test="not(parent::article) or $ischunk != 0">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</xsl:element>
</xsl:template>
<xsl:template match="appendix/title|appendix/appendixinfo/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::appendix[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="appendix/subtitle
|appendix/appendixinfo/subtitle
|appendix/info/subtitle
|appendix/docinfo/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::appendix[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="appendix/docinfo|appendixinfo"></xsl:template>
<xsl:template match="appendix/info"></xsl:template>
<xsl:template match="appendix/title"></xsl:template>
<xsl:template match="appendix/titleabbrev"></xsl:template>
<xsl:template match="appendix/subtitle"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="article">
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="article.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="make.lots">
<xsl:with-param name="toc.params" select="$toc.params"/>
<xsl:with-param name="toc">
<xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</xsl:element>
</xsl:template>
<xsl:template match="article/title|article/articleinfo/title" mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::article[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="article/subtitle
|article/articleinfo/subtitle
|article/info/subtitle
|article/artheader/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::article[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="article/artheader|article/articleinfo"></xsl:template>
<xsl:template match="article/info"></xsl:template>
<xsl:template match="article/title"></xsl:template>
<xsl:template match="article/titleabbrev"></xsl:template>
<xsl:template match="article/subtitle"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="topic">
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="topic.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</xsl:element>
</xsl:template>
<xsl:template match="topic/title|topic/info/title" mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::topic[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="topic/subtitle
|topic/info/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::topic[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="topic/info"></xsl:template>
<xsl:template match="topic/title"></xsl:template>
<xsl:template match="topic/titleabbrev"></xsl:template>
<xsl:template match="topic/subtitle"></xsl:template>
</xsl:stylesheet>

View File

@ -1,212 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: division.xsl 9366 2012-05-12 23:44:25Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="set">
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="language.attribute"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="set.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="make.lots">
<xsl:with-param name="toc.params" select="$toc.params"/>
<xsl:with-param name="toc">
<xsl:call-template name="set.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="set/setinfo"></xsl:template>
<xsl:template match="set/title"></xsl:template>
<xsl:template match="set/titleabbrev"></xsl:template>
<xsl:template match="set/subtitle"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="book">
<xsl:call-template name="id.warning"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="book.titlepage"/>
<xsl:apply-templates select="dedication" mode="dedication"/>
<xsl:apply-templates select="acknowledgements" mode="acknowledgements"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="make.lots">
<xsl:with-param name="toc.params" select="$toc.params"/>
<xsl:with-param name="toc">
<xsl:call-template name="division.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="book/bookinfo"></xsl:template>
<xsl:template match="book/info"></xsl:template>
<xsl:template match="book/title"></xsl:template>
<xsl:template match="book/titleabbrev"></xsl:template>
<xsl:template match="book/subtitle"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="part">
<xsl:call-template name="id.warning"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="part.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not(partintro) and contains($toc.params, 'toc')">
<xsl:call-template name="division.toc"/>
</xsl:if>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="part" mode="make.part.toc">
<xsl:call-template name="division.toc"/>
</xsl:template>
<xsl:template match="reference" mode="make.part.toc">
<xsl:call-template name="division.toc"/>
</xsl:template>
<xsl:template match="part/docinfo"></xsl:template>
<xsl:template match="part/partinfo"></xsl:template>
<xsl:template match="part/info"></xsl:template>
<xsl:template match="part/title"></xsl:template>
<xsl:template match="part/titleabbrev"></xsl:template>
<xsl:template match="part/subtitle"></xsl:template>
<xsl:template match="partintro">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="partintro.titlepage"/>
<xsl:apply-templates/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="node" select="parent::*"/>
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')">
<!-- not ancestor::part because partintro appears in reference -->
<xsl:apply-templates select="parent::*" mode="make.part.toc"/>
</xsl:if>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="partintro/title"></xsl:template>
<xsl:template match="partintro/titleabbrev"></xsl:template>
<xsl:template match="partintro/subtitle"></xsl:template>
<xsl:template match="partintro/title" mode="partintro.title.mode">
<h2>
<xsl:apply-templates/>
</h2>
</xsl:template>
<xsl:template match="partintro/subtitle" mode="partintro.title.mode">
<h3>
<i><xsl:apply-templates/></i>
</h3>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="book" mode="division.number">
<xsl:number from="set" count="book" format="1."/>
</xsl:template>
<xsl:template match="part" mode="division.number">
<xsl:number from="book" count="part" format="I."/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="division.title">
<xsl:param name="node" select="."/>
<h1>
<xsl:attribute name="class">title</xsl:attribute>
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates select="$node" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</h1>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,527 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ng="http://docbook.org/docbook-ng"
xmlns:db="http://docbook.org/ns/docbook"
xmlns:exsl="http://exslt.org/common"
xmlns:exslt="http://exslt.org/common"
exclude-result-prefixes="db ng exsl exslt"
version='1.0'>
<xsl:output method="html"
encoding="ISO-8859-1"
indent="no"/>
<!-- ********************************************************************
$Id: docbook.xsl 9396 2012-06-02 21:56:19Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:include href="../VERSION.xsl"/>
<xsl:include href="param.xsl"/>
<xsl:include href="../lib/lib.xsl"/>
<xsl:include href="../common/l10n.xsl"/>
<xsl:include href="../common/common.xsl"/>
<xsl:include href="../common/utility.xsl"/>
<xsl:include href="../common/labels.xsl"/>
<xsl:include href="../common/titles.xsl"/>
<xsl:include href="../common/subtitles.xsl"/>
<xsl:include href="../common/gentext.xsl"/>
<xsl:include href="../common/targets.xsl"/>
<xsl:include href="../common/olink.xsl"/>
<xsl:include href="../common/pi.xsl"/>
<xsl:include href="autotoc.xsl"/>
<xsl:include href="autoidx.xsl"/>
<xsl:include href="lists.xsl"/>
<xsl:include href="callout.xsl"/>
<xsl:include href="verbatim.xsl"/>
<xsl:include href="graphics.xsl"/>
<xsl:include href="xref.xsl"/>
<xsl:include href="formal.xsl"/>
<xsl:include href="table.xsl"/>
<xsl:include href="htmltbl.xsl"/>
<xsl:include href="sections.xsl"/>
<xsl:include href="inline.xsl"/>
<xsl:include href="footnote.xsl"/>
<xsl:include href="html.xsl"/>
<xsl:include href="info.xsl"/>
<xsl:include href="keywords.xsl"/>
<xsl:include href="division.xsl"/>
<xsl:include href="toc.xsl"/>
<xsl:include href="index.xsl"/>
<xsl:include href="refentry.xsl"/>
<xsl:include href="math.xsl"/>
<xsl:include href="admon.xsl"/>
<xsl:include href="component.xsl"/>
<xsl:include href="biblio.xsl"/>
<xsl:include href="biblio-iso690.xsl"/>
<xsl:include href="glossary.xsl"/>
<xsl:include href="block.xsl"/>
<xsl:include href="task.xsl"/>
<xsl:include href="qandaset.xsl"/>
<xsl:include href="synop.xsl"/>
<xsl:include href="titlepage.xsl"/>
<xsl:include href="titlepage.templates.xsl"/>
<xsl:include href="pi.xsl"/>
<xsl:include href="ebnf.xsl"/>
<xsl:include href="chunker.xsl"/>
<xsl:include href="html-rtf.xsl"/>
<xsl:include href="annotations.xsl"/>
<xsl:include href="../common/stripns.xsl"/>
<xsl:param name="stylesheet.result.type" select="'html'"/>
<xsl:param name="htmlhelp.output" select="0"/>
<!-- ==================================================================== -->
<xsl:key name="id" match="*" use="@id|@xml:id"/>
<xsl:key name="gid" match="*" use="generate-id()"/>
<!-- ==================================================================== -->
<xsl:template match="*">
<xsl:message>
<xsl:text>Element </xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text> in namespace '</xsl:text>
<xsl:value-of select="namespace-uri(.)"/>
<xsl:text>' encountered</xsl:text>
<xsl:if test="parent::*">
<xsl:text> in </xsl:text>
<xsl:value-of select="name(parent::*)"/>
</xsl:if>
<xsl:text>, but no template matches.</xsl:text>
</xsl:message>
<span style="color: red">
<xsl:text>&lt;</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text>&gt;</xsl:text>
<xsl:apply-templates/>
<xsl:text>&lt;/</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text>&gt;</xsl:text>
</span>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template name="body.attributes">
<xsl:attribute name="bgcolor">white</xsl:attribute>
<xsl:attribute name="text">black</xsl:attribute>
<xsl:attribute name="link">#0000FF</xsl:attribute>
<xsl:attribute name="vlink">#840084</xsl:attribute>
<xsl:attribute name="alink">#0000FF</xsl:attribute>
<xsl:if test="starts-with($writing.mode, 'rl')">
<xsl:attribute name="dir">rtl</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template name="head.content">
<xsl:param name="node" select="."/>
<xsl:param name="title">
<xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
</xsl:param>
<title>
<xsl:copy-of select="$title"/>
</title>
<xsl:if test="$html.base != ''">
<base href="{$html.base}"/>
</xsl:if>
<!-- Insert links to CSS files or insert literal style elements -->
<xsl:call-template name="generate.css"/>
<xsl:if test="$html.stylesheet != ''">
<xsl:call-template name="output.html.stylesheets">
<xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="$html.script != ''">
<xsl:call-template name="output.html.scripts">
<xsl:with-param name="scripts" select="normalize-space($html.script)"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="$link.mailto.url != ''">
<link rev="made"
href="{$link.mailto.url}"/>
</xsl:if>
<meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
<xsl:if test="$generate.meta.abstract != 0">
<xsl:variable name="info" select="(articleinfo
|bookinfo
|prefaceinfo
|chapterinfo
|appendixinfo
|sectioninfo
|sect1info
|sect2info
|sect3info
|sect4info
|sect5info
|referenceinfo
|refentryinfo
|partinfo
|info
|docinfo)[1]"/>
<xsl:if test="$info and $info/abstract">
<meta name="description">
<xsl:attribute name="content">
<xsl:for-each select="$info/abstract[1]/*">
<xsl:value-of select="normalize-space(.)"/>
<xsl:if test="position() &lt; last()">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:attribute>
</meta>
</xsl:if>
</xsl:if>
<xsl:if test="($draft.mode = 'yes' or
($draft.mode = 'maybe' and
ancestor-or-self::*[@status][1]/@status = 'draft'))
and $draft.watermark.image != ''">
<style type="text/css"><xsl:text>
body { background-image: url('</xsl:text>
<xsl:value-of select="$draft.watermark.image"/><xsl:text>');
background-repeat: no-repeat;
background-position: top left;
/* The following properties make the watermark "fixed" on the page. */
/* I think that's just a bit too distracting for the reader... */
/* background-attachment: fixed; */
/* background-position: center center; */
}</xsl:text>
</style>
</xsl:if>
<xsl:apply-templates select="." mode="head.keywords.content"/>
</xsl:template>
<xsl:template name="output.html.stylesheets">
<xsl:param name="stylesheets" select="''"/>
<xsl:choose>
<xsl:when test="contains($stylesheets, ' ')">
<xsl:variable name="css.filename" select="substring-before($stylesheets, ' ')"/>
<xsl:call-template name="make.css.link">
<xsl:with-param name="css.filename" select="$css.filename"/>
</xsl:call-template>
<xsl:call-template name="output.html.stylesheets">
<xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$stylesheets != ''">
<xsl:call-template name="make.css.link">
<xsl:with-param name="css.filename" select="$stylesheets"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="output.html.scripts">
<xsl:param name="scripts" select="''"/>
<xsl:choose>
<xsl:when test="contains($scripts, ' ')">
<xsl:variable name="script.filename" select="substring-before($scripts, ' ')"/>
<xsl:call-template name="make.script.link">
<xsl:with-param name="script.filename" select="$script.filename"/>
</xsl:call-template>
<xsl:call-template name="output.html.scripts">
<xsl:with-param name="scripts" select="substring-after($scripts, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$scripts != ''">
<xsl:call-template name="make.script.link">
<xsl:with-param name="script.filename" select="$scripts"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- ============================================================ -->
<xsl:template match="*" mode="head.keywords.content">
<xsl:apply-templates select="chapterinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="appendixinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="prefaceinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="bookinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="setinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="articleinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="artheader/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect1info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect2info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect3info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect4info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect5info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sectioninfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="refsect1info/keywordset" mode="html.header"/>
<xsl:apply-templates select="refsect2info/keywordset" mode="html.header"/>
<xsl:apply-templates select="refsect3info/keywordset" mode="html.header"/>
<xsl:apply-templates select="bibliographyinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="glossaryinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="indexinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="refentryinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="partinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="referenceinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="docinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="info/keywordset" mode="html.header"/>
<xsl:if test="$inherit.keywords != 0
and parent::*">
<xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
</xsl:if>
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="system.head.content">
<xsl:param name="node" select="."/>
<!-- FIXME: When chunking, only the annotations actually used
in this chunk should be referenced. I don't think it
does any harm to reference them all, but it adds
unnecessary bloat to each chunk. -->
<xsl:if test="$annotation.support != 0 and //annotation">
<xsl:call-template name="add.annotation.links"/>
<script type="text/javascript">
<xsl:text>&#10;// Create PopupWindow objects</xsl:text>
<xsl:for-each select="//annotation">
<xsl:text>&#10;var popup_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text> = new PopupWindow("popup-</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>");&#10;</xsl:text>
<xsl:text>popup_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>.offsetY = 15;&#10;</xsl:text>
<xsl:text>popup_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>.autoHide();&#10;</xsl:text>
</xsl:for-each>
</script>
<style type="text/css">
<xsl:value-of select="$annotation.css"/>
</style>
</xsl:if>
<!-- system.head.content is like user.head.content, except that
it is called before head.content. This is important because it
means, for example, that <style> elements output by system.head.content
have a lower CSS precedence than the users stylesheet. -->
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="user.preroot">
<!-- Pre-root output, can be used to output comments and PIs. -->
<!-- This must not output any element content! -->
</xsl:template>
<xsl:template name="user.head.content">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template name="user.header.navigation">
<xsl:param name="node" select="."/>
<xsl:param name="prev" select="/foo"/>
<xsl:param name="next" select="/foo"/>
<xsl:param name="nav.context"/>
</xsl:template>
<xsl:template name="user.header.content">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template name="user.footer.content">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template name="user.footer.navigation">
<xsl:param name="node" select="."/>
<xsl:param name="prev" select="/foo"/>
<xsl:param name="next" select="/foo"/>
<xsl:param name="nav.context"/>
</xsl:template>
<!-- To use the same stripped nodeset everywhere, it should
be created as a global variable here.
Used by docbook.xsl, chunk-code.xsl and chunkfast.xsl -->
<xsl:variable name="no.namespace">
<xsl:if test="$exsl.node.set.available != 0
and (*/self::ng:* or */self::db:*)">
<xsl:apply-templates select="/*" mode="stripNS"/>
</xsl:if>
</xsl:variable>
<xsl:template match="/">
<!-- * Get a title for current doc so that we let the user -->
<!-- * know what document we are processing at this point. -->
<xsl:variable name="doc.title">
<xsl:call-template name="get.doc.title"/>
</xsl:variable>
<xsl:choose>
<!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
toss the namespace and continue. Use the docbook5 namespaced
stylesheets for DocBook5 if you don't want to use this feature.-->
<!-- include extra test for Xalan quirk -->
<xsl:when test="$exsl.node.set.available != 0
and (*/self::ng:* or */self::db:*)">
<xsl:call-template name="log.message">
<xsl:with-param name="level">Note</xsl:with-param>
<xsl:with-param name="source" select="$doc.title"/>
<xsl:with-param name="context-desc">
<xsl:text>namesp. cut</xsl:text>
</xsl:with-param>
<xsl:with-param name="message">
<xsl:text>stripped namespace before processing</xsl:text>
</xsl:with-param>
</xsl:call-template>
<!-- DEBUG: to save stripped document.
<xsl:message>Saving stripped document.</xsl:message>
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename" select="'/tmp/stripped.xml'"/>
<xsl:with-param name="method" select="'xml'"/>
<xsl:with-param name="content">
<xsl:copy-of select="exsl:node-set($no.namespace)"/>
</xsl:with-param>
</xsl:call-template>
-->
<xsl:call-template name="log.message">
<xsl:with-param name="level">Note</xsl:with-param>
<xsl:with-param name="source" select="$doc.title"/>
<xsl:with-param name="context-desc">
<xsl:text>namesp. cut</xsl:text>
</xsl:with-param>
<xsl:with-param name="message">
<xsl:text>processing stripped document</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="exsl:node-set($no.namespace)"/>
</xsl:when>
<!-- Can't process unless namespace removed -->
<xsl:when test="*/self::ng:* or */self::db:*">
<xsl:message terminate="yes">
<xsl:text>Unable to strip the namespace from DB5 document,</xsl:text>
<xsl:text> cannot proceed.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$rootid != ''">
<xsl:choose>
<xsl:when test="count(key('id',$rootid)) = 0">
<xsl:message terminate="yes">
<xsl:text>ID '</xsl:text>
<xsl:value-of select="$rootid"/>
<xsl:text>' not found in document.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or
$collect.xref.targets = 'only'">
<xsl:apply-templates select="key('id', $rootid)"
mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="key('id',$rootid)"
mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="key('id',$rootid)"
mode="collect.tex.math"/>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or
$collect.xref.targets = 'only'">
<xsl:apply-templates select="/" mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="/" mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="/" mode="collect.tex.math"/>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="process.root">
<xsl:variable name="doc" select="self::*"/>
<xsl:call-template name="user.preroot"/>
<xsl:call-template name="root.messages"/>
<html>
<xsl:call-template name="root.attributes"/>
<head>
<xsl:call-template name="system.head.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
<xsl:call-template name="head.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
<xsl:call-template name="user.head.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
</head>
<body>
<xsl:call-template name="body.attributes"/>
<xsl:call-template name="user.header.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
<xsl:apply-templates select="."/>
<xsl:call-template name="user.footer.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
</body>
</html>
<xsl:value-of select="$html.append"/>
<!-- Generate any css files only once, not once per chunk -->
<xsl:call-template name="generate.css.files"/>
</xsl:template>
<xsl:template name="root.attributes">
<!-- customize to add attributes to <html> element -->
</xsl:template>
<xsl:template name="root.messages">
<!-- redefine this any way you'd like to output messages -->
<!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="chunk">
<xsl:param name="node" select="."/>
<!-- The default is that we are not chunking... -->
<xsl:text>0</xsl:text>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,331 +0,0 @@
<?xml version='1.0'?>
<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'>
<!-- ********************************************************************
$Id: ebnf.xsl 9358 2012-05-12 23:37:10Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<doc:reference xmlns="">
<referenceinfo>
<releaseinfo role="meta">
$Id: ebnf.xsl 9358 2012-05-12 23:37:10Z bobstayton $
</releaseinfo>
<author><surname>Walsh</surname>
<firstname>Norman</firstname></author>
<copyright><year>1999</year><year>2000</year>
<holder>Norman Walsh</holder>
</copyright>
</referenceinfo>
<title>HTML EBNF Reference</title>
<partintro>
<section><title>Introduction</title>
<para>This is technical reference documentation for the DocBook XSL
Stylesheets; it documents (some of) the parameters, templates, and
other elements of the stylesheets.</para>
<para>This reference describes the templates and parameters relevant
to formatting EBNF markup.</para>
<para>This is not intended to be <quote>user</quote> documentation.
It is provided for developers writing customization layers for the
stylesheets, and for anyone who's interested in <quote>how it
works</quote>.</para>
<para>Although I am trying to be thorough, this documentation is known
to be incomplete. Don't forget to read the source, too :-)</para>
</section>
</partintro>
</doc:reference>
<!-- ==================================================================== -->
<xsl:template match="productionset">
<table width="100%" cellpadding="5">
<xsl:if test="$ebnf.table.bgcolor != ''">
<xsl:attribute name="bgcolor">
<xsl:value-of select="$ebnf.table.bgcolor"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ebnf.table.border != 0">
<xsl:attribute name="border">1</xsl:attribute>
</xsl:if>
<xsl:attribute name="class">
<xsl:value-of select="local-name(.)"/>
</xsl:attribute>
<xsl:attribute name="summary">
<xsl:text>EBNF</xsl:text>
<xsl:if test="title|info/title">
<xsl:text> for </xsl:text>
<xsl:value-of select="title|info/title[1]"/>
</xsl:if>
</xsl:attribute>
<xsl:if test="title|info/title">
<tr>
<th align="{$direction.align.start}" valign="top">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:apply-templates select="title|info/title[1]"/>
</th>
</tr>
</xsl:if>
<tr>
<td>
<table border="0" width="99%" cellpadding="0">
<xsl:if test="$ebnf.table.bgcolor != ''">
<xsl:attribute name="bgcolor">
<xsl:value-of select="$ebnf.table.bgcolor"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="class">
<xsl:value-of select="local-name(.)"/>
</xsl:attribute>
<xsl:attribute name="summary">EBNF productions</xsl:attribute>
<xsl:apply-templates select="production|productionrecap"/>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="productionset/title">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="production">
<xsl:param name="recap" select="false()"/>
<tr>
<td align="{$direction.align.start}" valign="top" width="3%">
<xsl:text>[</xsl:text>
<xsl:number count="production" level="any"/>
<xsl:text>]</xsl:text>
</td>
<td align="{$direction.align.end}" valign="top" width="10%">
<xsl:choose>
<xsl:when test="$recap">
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="lhs"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="lhs"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td valign="top" width="5%" align="center">
<xsl:copy-of select="$ebnf.assignment"/>
</td>
<td valign="top" width="52%">
<xsl:apply-templates select="rhs"/>
<xsl:copy-of select="$ebnf.statement.terminator"/>
</td>
<td align="{$direction.align.start}" valign="top" width="30%">
<xsl:choose>
<xsl:when test="rhs/lineannotation|constraint">
<xsl:apply-templates select="rhs/lineannotation" mode="rhslo"/>
<xsl:apply-templates select="constraint"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>&#160;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<xsl:template match="productionrecap">
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:if test="count($targets)=0">
<xsl:message>
<xsl:text>Error: no ID for productionrecap linkend: </xsl:text>
<xsl:value-of select="@linkend"/>
<xsl:text>.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="count($targets)>1">
<xsl:message>
<xsl:text>Warning: multiple "IDs" for productionrecap linkend: </xsl:text>
<xsl:value-of select="@linkend"/>
<xsl:text>.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:apply-templates select="$target">
<xsl:with-param name="recap" select="true()"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="lhs">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="rhs">
<xsl:apply-templates/>
<xsl:if test="following-sibling::rhs">
<xsl:text> |</xsl:text>
<br/>
</xsl:if>
</xsl:template>
<xsl:template match="nonterminal">
<xsl:variable name="linkend">
<xsl:call-template name="xpointer.idref">
<xsl:with-param name="xpointer" select="@def"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="$linkend"/>
</xsl:call-template>
<xsl:call-template name="check.idref.targets">
<xsl:with-param name="linkend" select="$linkend"/>
<xsl:with-param name="element-list">production</xsl:with-param>
</xsl:call-template>
<!-- If you don't provide content, you can't point outside this doc. -->
<xsl:choose>
<xsl:when test="*|text()"><!--nop--></xsl:when>
<xsl:otherwise>
<xsl:if test="$linkend = ''">
<xsl:message>
<xsl:text>Non-terminals with no content must point to </xsl:text>
<xsl:text>production elements in the current document.</xsl:text>
</xsl:message>
<xsl:message>
<xsl:text>Invalid xpointer for empty nt: </xsl:text>
<xsl:value-of select="@def"/>
</xsl:message>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="href">
<xsl:choose>
<xsl:when test="$linkend != ''">
<xsl:variable name="targets" select="key('id',$linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@def"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a href="{$href}">
<xsl:choose>
<xsl:when test="*|text()">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$linkend != ''">
<xsl:variable name="targets" select="key('id',$linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:apply-templates select="$target/lhs"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>???</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="rhs/lineannotation">
<!--nop-->
</xsl:template>
<xsl:template match="rhs/lineannotation" mode="rhslo">
<xsl:text>/*&#160;</xsl:text>
<xsl:apply-templates/>
<xsl:text>&#160;*/</xsl:text>
<br/>
</xsl:template>
<xsl:template match="constraint">
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="@linkend"/>
</xsl:call-template>
<xsl:call-template name="check.idref.targets">
<xsl:with-param name="linkend" select="@linkend"/>
<xsl:with-param name="element-list">constraintdef</xsl:with-param>
</xsl:call-template>
<xsl:variable name="href">
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:variable>
<xsl:text>[&#160;</xsl:text>
<xsl:choose>
<xsl:when test="@role">
<xsl:value-of select="@role"/>
<xsl:text>: </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:if test="$target/@role">
<xsl:value-of select="$target/@role"/>
<xsl:text>: </xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<a href="{$href}">
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:apply-templates select="$target" mode="title.markup"/>
</a>
<xsl:text>&#160;]</xsl:text>
<xsl:if test="following-sibling::constraint">
<br/>
</xsl:if>
</xsl:template>
<xsl:template match="constraintdef">
<div>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="constraintdef/title">
<p><b><xsl:apply-templates/></b></p>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@ -1,350 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="exsl"
version='1.0'>
<!-- ********************************************************************
$Id: footnote.xsl 9361 2012-05-12 23:39:44Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- This template generates just the footnote marker inline.
The footnote text is handled in name="process.footnote".
The footnote marker gets an id of @id, while the
footnote text gets an id of #ftn.@id. They cross link to each other. -->
<xsl:template match="footnote">
<xsl:variable name="href">
<xsl:text>#ftn.</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:variable>
<a href="{$href}">
<xsl:apply-templates select="." mode="class.attribute"/>
<sup>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:text>[</xsl:text>
<xsl:apply-templates select="." mode="footnote.number"/>
<xsl:text>]</xsl:text>
</sup>
</a>
</xsl:template>
<xsl:template match="footnoteref">
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="footnote" select="$targets[1]"/>
<xsl:if test="not(local-name($footnote) = 'footnote')">
<xsl:message terminate="yes">
ERROR: A footnoteref element has a linkend that points to an element that is not a footnote.
Typically this happens when an id attribute is accidentally applied to the child of a footnote element.
target element: <xsl:value-of select="local-name($footnote)"/>
linkend/id: <xsl:value-of select="@linkend"/>
</xsl:message>
</xsl:if>
<xsl:variable name="target.href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$footnote"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="href">
<xsl:value-of select="substring-before($target.href, '#')"/>
<xsl:text>#ftn.</xsl:text>
<xsl:value-of select="substring-after($target.href, '#')"/>
</xsl:variable>
<a href="{$href}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="id.attribute"/>
<sup>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:text>[</xsl:text>
<xsl:apply-templates select="$footnote" mode="footnote.number"/>
<xsl:text>]</xsl:text>
</sup>
</a>
</xsl:template>
<xsl:template match="footnote" mode="footnote.number">
<xsl:choose>
<xsl:when test="string-length(@label) != 0">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="ancestor::table or ancestor::informaltable">
<xsl:variable name="tfnum">
<xsl:number level="any" from="table|informaltable" format="1"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($table.footnote.number.symbols) &gt;= $tfnum">
<xsl:value-of select="substring($table.footnote.number.symbols, $tfnum, 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:number level="any" from="table | informaltable"
format="{$table.footnote.number.format}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="pfoot" select="preceding::footnote[not(@label)]"/>
<xsl:variable name="ptfoot" select="preceding::table//footnote |
preceding::informaltable//footnote"/>
<xsl:variable name="fnum" select="count($pfoot) - count($ptfoot) + 1"/>
<xsl:choose>
<xsl:when test="string-length($footnote.number.symbols) &gt;= $fnum">
<xsl:value-of select="substring($footnote.number.symbols, $fnum, 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:number value="$fnum" format="{$footnote.number.format}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="footnote/para[1]|footnote/simpara[1]" priority="2">
<!-- this only works if the first thing in a footnote is a para, -->
<!-- which is ok, because it usually is. -->
<xsl:variable name="href">
<xsl:text>#</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="ancestor::footnote"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="paragraph">
<xsl:with-param name="class">
<xsl:if test="@role and $para.propagates.style != 0">
<xsl:value-of select="@role"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="content">
<a href="{$href}">
<xsl:apply-templates select="." mode="class.attribute"/>
<sup>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:text>[</xsl:text>
<xsl:apply-templates select="ancestor::footnote" mode="footnote.number"/>
<xsl:text>] </xsl:text>
</sup>
</a>
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="*" mode="footnote.body.number">
<xsl:variable name="name">
<xsl:text>ftn.</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="ancestor::footnote"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="href">
<xsl:text>#</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="ancestor::footnote"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="footnote.mark">
<a href="{$href}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:choose>
<xsl:when test="$generate.id.attributes = 0">
<xsl:if test="@id or @xml:id">
<xsl:attribute name="name">
<xsl:value-of select="@id|@xml:id"/>
</xsl:attribute>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="id.attribute"/>
</xsl:otherwise>
</xsl:choose>
<sup>
<xsl:text>[</xsl:text>
<xsl:apply-templates select="ancestor::footnote"
mode="footnote.number"/>
<xsl:text>] </xsl:text>
</sup>
</a>
</xsl:variable>
<xsl:variable name="html">
<xsl:apply-templates select="."/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$exsl.node.set.available != 0">
<xsl:variable name="html-nodes" select="exsl:node-set($html)"/>
<xsl:choose>
<xsl:when test="$html-nodes//p">
<xsl:apply-templates select="$html-nodes" mode="insert.html.p">
<xsl:with-param name="mark" select="$footnote.mark"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$html-nodes" mode="insert.html.text">
<xsl:with-param name="mark" select="$footnote.mark"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$html"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<!--
<xsl:template name="count-element-from">
<xsl:param name="from" select=".."/>
<xsl:param name="to" select="."/>
<xsl:param name="count" select="0"/>
<xsl:param name="list" select="$from/following::*[local-name(.)=local-name($to)]
|$from/descendant-or-self::*[local-name(.)=local-name($to)]"/>
<xsl:choose>
<xsl:when test="not($list)">
<xsl:text>-1</xsl:text>
</xsl:when>
<xsl:when test="$list[1] = $to">
<xsl:value-of select="$count + 1"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-->
<!-- ==================================================================== -->
<xsl:template name="process.footnotes">
<xsl:variable name="footnotes" select=".//footnote"/>
<xsl:variable name="table.footnotes"
select=".//table//footnote | .//informaltable//footnote"/>
<!-- Only bother to do this if there's at least one non-table footnote -->
<xsl:if test="count($footnotes)>count($table.footnotes)">
<div class="footnotes">
<xsl:call-template name="footnotes.attributes"/>
<br/>
<hr>
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<xsl:attribute name="class">footnote-hr</xsl:attribute>
</xsl:when>
<xsl:when test="$css.decoration != 0">
<xsl:attribute name="style">
<xsl:value-of select="concat('width:100; align:',
$direction.align.start,
';')"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="width">100</xsl:attribute>
<xsl:attribute name="align"><xsl:value-of
select="$direction.align.start"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</hr>
<xsl:apply-templates select="$footnotes" mode="process.footnote.mode"/>
</div>
</xsl:if>
<xsl:if test="$annotation.support != 0 and //annotation">
<div class="annotation-list">
<div class="annotation-nocss">
<p>The following annotations are from this essay. You are seeing
them here because your browser doesnt support the user-interface
techniques used to make them appear as popups on modern browsers.</p>
</div>
<xsl:apply-templates select="//annotation"
mode="annotation-popup"/>
</div>
</xsl:if>
</xsl:template>
<xsl:template name="footnotes.attributes">
<!-- customizable for footnotes attributes -->
</xsl:template>
<xsl:template name="process.chunk.footnotes">
<!-- nop -->
</xsl:template>
<xsl:template match="footnote" name="process.footnote" mode="process.footnote.mode">
<xsl:variable name="id">
<xsl:text>ftn.</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="local-name(*[1]) = 'para' or local-name(*[1]) = 'simpara'">
<div id="{$id}">
<xsl:call-template name="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:when test="$html.cleanup != 0 and
$exsl.node.set.available != 0">
<div id="{$id}">
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:apply-templates select="*[1]" mode="footnote.body.number"/>
<xsl:apply-templates select="*[position() &gt; 1]"/>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Warning: footnote number may not be generated </xsl:text>
<xsl:text>correctly; </xsl:text>
<xsl:value-of select="local-name(*[1])"/>
<xsl:text> unexpected as first child of footnote.</xsl:text>
</xsl:message>
<div id="{$id}">
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:apply-templates/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="table//footnote | informaltable//footnote"
mode="process.footnote.mode">
</xsl:template>
<xsl:template match="footnote" mode="table.footnote.mode">
<xsl:call-template name="process.footnote"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,507 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: formal.xsl 9297 2012-04-22 03:56:16Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:param name="formal.object.break.after">1</xsl:param>
<xsl:template name="formal.object">
<xsl:param name="placement" select="'before'"/>
<xsl:param name="class">
<xsl:apply-templates select="." mode="class.value"/>
</xsl:param>
<xsl:call-template name="id.warning"/>
<xsl:variable name="content">
<div class="{$class}">
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$placement = 'before'">
<xsl:call-template name="formal.object.heading"/>
<div class="{$class}-contents">
<xsl:apply-templates/>
</div>
<!-- HACK: This doesn't belong inside formal.object; it
should be done by the table template, but I want
the link to be inside the DIV, so... -->
<xsl:if test="local-name(.) = 'table'">
<xsl:call-template name="table.longdesc"/>
</xsl:if>
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
<div class="{$class}-contents"><xsl:apply-templates/></div>
<!-- HACK: This doesn't belong inside formal.object; it
should be done by the table template, but I want
the link to be inside the DIV, so... -->
<xsl:if test="local-name(.) = 'table'">
<xsl:call-template name="table.longdesc"/>
</xsl:if>
<xsl:call-template name="formal.object.heading"/>
</xsl:otherwise>
</xsl:choose>
</div>
<xsl:if test="not($formal.object.break.after = '0')">
<br class="{$class}-break"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="floatstyle">
<xsl:call-template name="floatstyle"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$floatstyle != ''">
<xsl:call-template name="floater">
<xsl:with-param name="class"><xsl:value-of
select="$class"/>-float</xsl:with-param>
<xsl:with-param name="floatstyle" select="$floatstyle"/>
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$content"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="formal.object.heading">
<xsl:param name="object" select="."/>
<xsl:param name="title">
<xsl:apply-templates select="$object" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</xsl:param>
<xsl:choose>
<xsl:when test="$make.clean.html != 0">
<xsl:variable name="html.class" select="concat(local-name($object),'-title')"/>
<div class="{$html.class}">
<xsl:copy-of select="$title"/>
</div>
</xsl:when>
<xsl:otherwise>
<p class="title">
<b>
<xsl:copy-of select="$title"/>
</b>
</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="informal.object">
<xsl:param name="class">
<xsl:apply-templates select="." mode="class.value"/>
</xsl:param>
<xsl:variable name="content">
<div class="{$class}">
<xsl:call-template name="id.attribute"/>
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
<!-- HACK: This doesn't belong inside formal.object; it
should be done by the table template, but I want
the link to be inside the DIV, so... -->
<xsl:if test="local-name(.) = 'informaltable'">
<xsl:call-template name="table.longdesc"/>
</xsl:if>
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
</div>
</xsl:variable>
<xsl:variable name="floatstyle">
<xsl:call-template name="floatstyle"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$floatstyle != ''">
<xsl:call-template name="floater">
<xsl:with-param name="class"><xsl:value-of
select="$class"/>-float</xsl:with-param>
<xsl:with-param name="floatstyle" select="$floatstyle"/>
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$content"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="semiformal.object">
<xsl:param name="placement" select="'before'"/>
<xsl:param name="class" select="local-name(.)"/>
<xsl:choose>
<xsl:when test="title or info/title">
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
<xsl:with-param name="class" select="$class"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="informal.object">
<xsl:with-param name="class" select="$class"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="figure">
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
<xsl:variable name="placement">
<xsl:choose>
<xsl:when test="contains($param.placement, ' ')">
<xsl:value-of select="substring-before($param.placement, ' ')"/>
</xsl:when>
<xsl:when test="$param.placement = ''">before</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$param.placement"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="table">
<xsl:choose>
<xsl:when test="tgroup|mediaobject|graphic">
<xsl:call-template name="calsTable"/>
</xsl:when>
<xsl:when test="caption">
<xsl:call-template name="htmlTable.with.caption"/>
</xsl:when>
<xsl:otherwise>
<!-- do not use xsl:copy because of XHTML's needs -->
<xsl:element name="table" namespace="">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
<xsl:call-template name="htmlTable"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Handle html markup table like formal.object -->
<xsl:template name="htmlTable.with.caption">
<xsl:param name="class">
<xsl:apply-templates select="." mode="class.value"/>
</xsl:param>
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
<xsl:variable name="placement">
<xsl:choose>
<xsl:when test="contains($param.placement, ' ')">
<xsl:value-of select="substring-before($param.placement, ' ')"/>
</xsl:when>
<xsl:when test="$param.placement = ''">before</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$param.placement"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="id.warning"/>
<xsl:variable name="content">
<div class="{$class}">
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$placement = 'before'">
<xsl:call-template name="formal.object.heading"/>
<div class="{$class}-contents">
<xsl:apply-templates select="." mode="htmlTable"/>
</div>
<xsl:call-template name="table.longdesc"/>
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
<div class="{$class}-contents">
<xsl:apply-templates select="." mode="htmlTable"/>
</div>
<xsl:call-template name="table.longdesc"/>
<xsl:call-template name="formal.object.heading"/>
</xsl:otherwise>
</xsl:choose>
</div>
<xsl:if test="not($formal.object.break.after = '0')">
<br class="{$class}-break"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="floatstyle">
<xsl:call-template name="floatstyle"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$floatstyle != ''">
<xsl:call-template name="floater">
<xsl:with-param name="class"><xsl:value-of
select="$class"/>-float</xsl:with-param>
<xsl:with-param name="floatstyle" select="$floatstyle"/>
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$content"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="calsTable">
<xsl:if test="tgroup/tbody/tr
|tgroup/thead/tr
|tgroup/tfoot/tr">
<xsl:message terminate="yes">Broken table: tr descendent of CALS Table.</xsl:message>
</xsl:if>
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
<xsl:variable name="placement">
<xsl:choose>
<xsl:when test="contains($param.placement, ' ')">
<xsl:value-of select="substring-before($param.placement, ' ')"/>
</xsl:when>
<xsl:when test="$param.placement = ''">before</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$param.placement"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="table|informaltable" mode="class.value">
<xsl:choose>
<xsl:when test="@tabstyle">
<xsl:value-of select="@tabstyle"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="local-name(.)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="htmlTable">
<xsl:if test="tgroup/tbody/row
|tgroup/thead/row
|tgroup/tfoot/row">
<xsl:message terminate="yes">Broken table: row descendent of HTML table.</xsl:message>
</xsl:if>
<xsl:apply-templates mode="htmlTable"/>
<xsl:if test=".//footnote|../title//footnote">
<tbody class="footnotes">
<tr>
<td colspan="50">
<xsl:apply-templates select=".//footnote|../title//footnote" mode="table.footnote.mode"/>
</td>
</tr>
</tbody>
</xsl:if>
</xsl:template>
<xsl:template match="example">
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
<xsl:variable name="placement">
<xsl:choose>
<xsl:when test="contains($param.placement, ' ')">
<xsl:value-of select="substring-before($param.placement, ' ')"/>
</xsl:when>
<xsl:when test="$param.placement = ''">before</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$param.placement"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="equation">
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
<xsl:variable name="placement">
<xsl:choose>
<xsl:when test="contains($param.placement, ' ')">
<xsl:value-of select="substring-before($param.placement, ' ')"/>
</xsl:when>
<xsl:when test="$param.placement = ''">before</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$param.placement"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="figure/title"></xsl:template>
<xsl:template match="figure/titleabbrev"></xsl:template>
<xsl:template match="table/title"></xsl:template>
<xsl:template match="table/titleabbrev"></xsl:template>
<xsl:template match="table/textobject"></xsl:template>
<xsl:template match="example/title"></xsl:template>
<xsl:template match="example/titleabbrev"></xsl:template>
<xsl:template match="equation/title"></xsl:template>
<xsl:template match="equation/titleabbrev"></xsl:template>
<xsl:template match="informalfigure">
<xsl:call-template name="informal.object"/>
</xsl:template>
<xsl:template match="informalexample">
<xsl:call-template name="informal.object"/>
</xsl:template>
<xsl:template match="informaltable">
<xsl:choose>
<xsl:when test="tgroup|mediaobject|graphic">
<xsl:call-template name="informal.object"/>
</xsl:when>
<xsl:otherwise>
<xsl:element name="table" namespace="">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
<xsl:call-template name="htmlTable"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="informaltable/textobject"></xsl:template>
<xsl:template name="table.longdesc">
<!-- HACK: This doesn't belong inside formal.objectt; it should be done by -->
<!-- the table template, but I want the link to be inside the DIV, so... -->
<xsl:variable name="longdesc.uri">
<xsl:call-template name="longdesc.uri">
<xsl:with-param name="mediaobject" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="irrelevant">
<!-- write.longdesc returns the filename ... -->
<xsl:call-template name="write.longdesc">
<xsl:with-param name="mediaobject" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$html.longdesc != 0 and $html.longdesc.link != 0
and textobject[not(phrase)]">
<xsl:call-template name="longdesc.link">
<xsl:with-param name="longdesc.uri" select="$longdesc.uri"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="informalequation">
<xsl:call-template name="informal.object"/>
</xsl:template>
<xsl:template name="floatstyle">
<xsl:if test="(@float and @float != '0') or @floatstyle != ''">
<xsl:choose>
<xsl:when test="@floatstyle != ''">
<xsl:value-of select="@floatstyle"/>
</xsl:when>
<xsl:when test="@float = '1'">
<xsl:value-of select="$default.float.class"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@float"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template name="floater">
<xsl:param name="content"/>
<xsl:param name="class" select="'float'"/>
<xsl:param name="floatstyle" select="'left'"/>
<div class="{$class}">
<xsl:if test="$floatstyle = 'left' or $floatstyle = 'right'">
<xsl:attribute name="style">
<xsl:text>float: </xsl:text>
<xsl:value-of select="$floatstyle"/>
<xsl:text>;</xsl:text>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</div>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,521 +0,0 @@
<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY % common.entities SYSTEM "../common/entities.ent">
%common.entities;
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink='http://www.w3.org/1999/xlink'
exclude-result-prefixes="xlink"
version='1.0'>
<!-- ********************************************************************
$Id: glossary.xsl 9364 2012-05-12 23:43:04Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="glossary">
&setup-language-variable;
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="glossary.titlepage"/>
<xsl:choose>
<xsl:when test="glossdiv">
<xsl:apply-templates select="(glossdiv[1]/preceding-sibling::*)"/>
</xsl:when>
<xsl:when test="glossentry">
<xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="glossdiv">
<xsl:apply-templates select="glossdiv"/>
</xsl:when>
<xsl:when test="glossentry">
<dl>
<xsl:choose>
<xsl:when test="$glossary.sort != 0">
<xsl:apply-templates select="glossentry">
<xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="glossentry"/>
</xsl:otherwise>
</xsl:choose>
</dl>
</xsl:when>
<xsl:otherwise>
<!-- empty glossary -->
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not(parent::article)">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</xsl:element>
</xsl:template>
<xsl:template match="glossary/glossaryinfo"></xsl:template>
<xsl:template match="glossary/info"></xsl:template>
<xsl:template match="glossary/title"></xsl:template>
<xsl:template match="glossary/subtitle"></xsl:template>
<xsl:template match="glossary/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="glosslist">
&setup-language-variable;
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor"/>
<xsl:if test="blockinfo/title|info/title|title">
<xsl:call-template name="formal.object.heading"/>
</xsl:if>
<dl>
<xsl:choose>
<xsl:when test="$glossary.sort != 0">
<xsl:apply-templates select="glossentry">
<xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="glossentry"/>
</xsl:otherwise>
</xsl:choose>
</dl>
</div>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="glossdiv">
&setup-language-variable;
<xsl:call-template name="id.warning"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
<dl>
<xsl:choose>
<xsl:when test="$glossary.sort != 0">
<xsl:apply-templates select="glossentry">
<xsl:sort lang="{$language}"
select="translate(glossterm, $lowercase,
$uppercase)"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="glossentry"/>
</xsl:otherwise>
</xsl:choose>
</dl>
</div>
</xsl:template>
<xsl:template match="glossdiv/title">
<h3>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</h3>
</xsl:template>
<!-- ==================================================================== -->
<!--
GlossEntry ::=
GlossTerm, Acronym?, Abbrev?,
(IndexTerm)*,
RevHistory?,
(GlossSee | GlossDef+)
-->
<xsl:template match="glossentry">
<xsl:choose>
<xsl:when test="$glossentry.show.acronym = 'primary'">
<dt>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="acronym|abbrev">
<xsl:apply-templates select="acronym|abbrev"/>
<xsl:text> (</xsl:text>
<xsl:apply-templates select="glossterm"/>
<xsl:text>)</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="glossterm"/>
</xsl:otherwise>
</xsl:choose>
</dt>
</xsl:when>
<xsl:when test="$glossentry.show.acronym = 'yes'">
<dt>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="glossterm"/>
<xsl:if test="acronym|abbrev">
<xsl:text> (</xsl:text>
<xsl:apply-templates select="acronym|abbrev"/>
<xsl:text>)</xsl:text>
</xsl:if>
</dt>
</xsl:when>
<xsl:otherwise>
<dt>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="glossterm"/>
</dt>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="indexterm|revhistory|glosssee|glossdef"/>
</xsl:template>
<xsl:template match="glossentry/glossterm">
<xsl:apply-templates/>
<xsl:if test="following-sibling::glossterm">, </xsl:if>
</xsl:template>
<xsl:template match="glossentry/acronym">
<xsl:apply-templates/>
<xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
</xsl:template>
<xsl:template match="glossentry/abbrev">
<xsl:apply-templates/>
<xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
</xsl:template>
<xsl:template match="glossentry/revhistory">
</xsl:template>
<xsl:template match="glossentry/glosssee">
<xsl:variable name="otherterm" select="@otherterm"/>
<xsl:variable name="targets" select="key('id', $otherterm)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:variable name="xlink" select="@xlink:href"/>
<dd>
<p>
<xsl:variable name="template">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'glossary'"/>
<xsl:with-param name="name" select="'see'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="$target">
<a>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$target" mode="xref-to"/>
</a>
</xsl:when>
<xsl:when test="$xlink">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$otherterm != '' and not($target)">
<xsl:message>
<xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
<xsl:value-of select="$otherterm"/>
</xsl:message>
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="substitute-markup">
<xsl:with-param name="template" select="$template"/>
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
</p>
</dd>
</xsl:template>
<xsl:template match="glossentry/glossdef">
<dd>
<xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/>
<xsl:if test="glossseealso">
<p>
<xsl:variable name="template">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'glossary'"/>
<xsl:with-param name="name" select="'seealso'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="title">
<xsl:apply-templates select="glossseealso"/>
</xsl:variable>
<xsl:call-template name="substitute-markup">
<xsl:with-param name="template" select="$template"/>
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
</p>
</xsl:if>
</dd>
</xsl:template>
<xsl:template match="glossseealso">
<xsl:variable name="otherterm" select="@otherterm"/>
<xsl:variable name="targets" select="key('id', $otherterm)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:variable name="xlink" select="@xlink:href"/>
<xsl:choose>
<xsl:when test="$target">
<a>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$target" mode="xref-to"/>
</a>
</xsl:when>
<xsl:when test="$xlink">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$otherterm != '' and not($target)">
<xsl:message>
<xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
<xsl:value-of select="$otherterm"/>
</xsl:message>
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="position() = last()"/>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'glossary'"/>
<xsl:with-param name="name" select="'seealso-separator'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<!-- Glossary collection -->
<xsl:template match="glossary[@role='auto']" priority="2">
&setup-language-variable;
<xsl:variable name="terms"
select="//glossterm[not(parent::glossdef)]|//firstterm"/>
<xsl:variable name="collection" select="document($glossary.collection, .)"/>
<xsl:call-template name="id.warning"/>
<xsl:if test="$glossary.collection = ''">
<xsl:message>
<xsl:text>Warning: processing automatic glossary </xsl:text>
<xsl:text>without a glossary.collection file.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="not($collection) and $glossary.collection != ''">
<xsl:message>
<xsl:text>Warning: processing automatic glossary but unable to </xsl:text>
<xsl:text>open glossary.collection file '</xsl:text>
<xsl:value-of select="$glossary.collection"/>
<xsl:text>'</xsl:text>
</xsl:message>
</xsl:if>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="glossary.titlepage"/>
<xsl:choose>
<xsl:when test="glossdiv and $collection//glossdiv">
<xsl:for-each select="$collection//glossdiv">
<!-- first see if there are any in this div -->
<xsl:variable name="exist.test">
<xsl:for-each select="glossentry">
<xsl:variable name="cterm" select="glossterm"/>
<xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
<xsl:value-of select="glossterm"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:if test="$exist.test != ''">
<xsl:apply-templates select="." mode="auto-glossary">
<xsl:with-param name="terms" select="$terms"/>
</xsl:apply-templates>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<dl>
<xsl:choose>
<xsl:when test="$glossary.sort != 0">
<xsl:for-each select="$collection//glossentry">
<xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
<xsl:variable name="cterm" select="glossterm"/>
<xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
<xsl:apply-templates select="." mode="auto-glossary"/>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$collection//glossentry">
<xsl:variable name="cterm" select="glossterm"/>
<xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
<xsl:apply-templates select="." mode="auto-glossary"/>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</dl>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not(parent::article)">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="*" mode="auto-glossary">
<!-- pop back out to the default mode for most elements -->
<xsl:apply-templates select="."/>
</xsl:template>
<xsl:template match="glossdiv" mode="auto-glossary">
<xsl:param name="terms" select="."/>
&setup-language-variable;
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
<dl>
<xsl:choose>
<xsl:when test="$glossary.sort != 0">
<xsl:for-each select="glossentry">
<xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
<xsl:variable name="cterm" select="glossterm"/>
<xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
<xsl:apply-templates select="." mode="auto-glossary"/>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="glossentry">
<xsl:variable name="cterm" select="glossterm"/>
<xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
<xsl:apply-templates select="." mode="auto-glossary"/>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</dl>
</div>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@ -1,336 +0,0 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
xmlns:set="http://exslt.org/sets"
exclude-result-prefixes="exsl set"
version="1.0">
<!-- ********************************************************************
$Id: html-rtf.xsl 8345 2009-03-16 06:44:07Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- This module contains templates that match against HTML nodes. It is used
to post-process result tree fragments for some sorts of cleanup.
These templates can only ever be fired by a processor that supports
exslt:node-set(). -->
<!-- ==================================================================== -->
<!-- insert.html.p mode templates insert a particular RTF at the beginning
of the first paragraph in the primary RTF. -->
<xsl:template match="/" mode="insert.html.p">
<xsl:param name="mark" select="'?'"/>
<xsl:apply-templates mode="insert.html.p">
<xsl:with-param name="mark" select="$mark"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*" mode="insert.html.p">
<xsl:param name="mark" select="'?'"/>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="insert.html.p">
<xsl:with-param name="mark" select="$mark"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template xmlns:html="http://www.w3.org/1999/xhtml"
match="html:p|p" mode="insert.html.p">
<xsl:param name="mark" select="'?'"/>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:if test="not(preceding::p|preceding::html:p)">
<xsl:copy-of select="$mark"/>
</xsl:if>
<xsl:apply-templates mode="insert.html.p">
<xsl:with-param name="mark" select="$mark"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="text()|processing-instruction()|comment()" mode="insert.html.p">
<xsl:param name="mark" select="'?'"/>
<xsl:copy/>
</xsl:template>
<!-- ==================================================================== -->
<!-- insert.html.text mode templates insert a particular RTF at the beginning
of the first text-node in the primary RTF. -->
<xsl:template match="/" mode="insert.html.text">
<xsl:param name="mark" select="'?'"/>
<xsl:apply-templates mode="insert.html.text">
<xsl:with-param name="mark" select="$mark"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*" mode="insert.html.text">
<xsl:param name="mark" select="'?'"/>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="insert.html.text">
<xsl:with-param name="mark" select="$mark"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="text()|processing-instruction()|comment()" mode="insert.html.text">
<xsl:param name="mark" select="'?'"/>
<xsl:if test="not(preceding::text())">
<xsl:copy-of select="$mark"/>
</xsl:if>
<xsl:copy/>
</xsl:template>
<xsl:template match="processing-instruction()|comment()" mode="insert.html.text">
<xsl:param name="mark" select="'?'"/>
<xsl:copy/>
</xsl:template>
<!-- ==================================================================== -->
<!-- unwrap.p mode templates remove blocks from HTML p elements (and
other places where blocks aren't allowed) -->
<xsl:template name="unwrap.p">
<xsl:param name="p"/>
<xsl:choose>
<xsl:when test="$exsl.node.set.available != 0
and function-available('set:leading')
and function-available('set:trailing')">
<xsl:apply-templates select="exsl:node-set($p)" mode="unwrap.p"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$p"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template xmlns:html="http://www.w3.org/1999/xhtml"
match="html:p|p" mode="unwrap.p">
<!-- xmlns:html is necessary for the xhtml stylesheet case -->
<xsl:variable name="blocks" xmlns:html="http://www.w3.org/1999/xhtml"
select="address|blockquote|div|hr|h1|h2|h3|h4|h5|h6
|layer|p|pre|table|dl|menu|ol|ul|form
|html:address|html:blockquote|html:div|html:hr
|html:h1|html:h2|html:h3|html:h4|html:h5|html:h6
|html:layer|html:p|html:pre|html:table|html:dl
|html:menu|html:ol|html:ul|html:form"/>
<xsl:choose>
<xsl:when test="$blocks">
<xsl:call-template name="unwrap.p.nodes">
<xsl:with-param name="wrap" select="."/>
<xsl:with-param name="first" select="1"/>
<xsl:with-param name="nodes" select="node()"/>
<xsl:with-param name="blocks" select="$blocks"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="unwrap.p"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="unwrap.p">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="unwrap.p"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()|processing-instruction()|comment()" mode="unwrap.p">
<xsl:copy/>
</xsl:template>
<xsl:template name="unwrap.p.nodes">
<xsl:param name="wrap" select="."/>
<xsl:param name="first" select="0"/>
<xsl:param name="nodes"/>
<xsl:param name="blocks"/>
<xsl:variable name="block" select="$blocks[1]"/>
<!-- This template should never get called if these functions aren't available -->
<!-- but this test is still necessary so that processors don't choke on the -->
<!-- function calls if they don't support the set: functions -->
<xsl:if test="function-available('set:leading')
and function-available('set:trailing')">
<xsl:choose>
<xsl:when test="$blocks">
<xsl:variable name="leading" select="set:leading($nodes,$block)"/>
<xsl:variable name="trailing" select="set:trailing($nodes,$block)"/>
<xsl:if test="(($wrap/@id or $wrap/@xml:id)
and $first = 1) or $leading">
<xsl:element name="{local-name($wrap)}" namespace="{namespace-uri($wrap)}">
<xsl:for-each select="$wrap/@*">
<xsl:if test="$first != 0 or local-name(.) != 'id'">
<xsl:copy/>
</xsl:if>
</xsl:for-each>
<xsl:apply-templates select="$leading" mode="unwrap.p"/>
</xsl:element>
</xsl:if>
<xsl:apply-templates select="$block" mode="unwrap.p"/>
<xsl:if test="$trailing">
<xsl:call-template name="unwrap.p.nodes">
<xsl:with-param name="wrap" select="$wrap"/>
<xsl:with-param name="nodes" select="$trailing"/>
<xsl:with-param name="blocks" select="$blocks[position() &gt; 1]"/>
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="(($wrap/@id or $wrap/@xml:id) and $first = 1) or $nodes">
<xsl:element name="{local-name($wrap)}" namespace="{namespace-uri($wrap)}">
<xsl:for-each select="$wrap/@*">
<xsl:if test="$first != 0 or local-name(.) != 'id'">
<xsl:copy/>
</xsl:if>
</xsl:for-each>
<xsl:apply-templates select="$nodes" mode="unwrap.p"/>
</xsl:element>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<!-- make.verbatim.mode replaces spaces and newlines -->
<xsl:template match="/" mode="make.verbatim.mode">
<xsl:apply-templates mode="make.verbatim.mode"/>
</xsl:template>
<xsl:template match="*" mode="make.verbatim.mode">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="make.verbatim.mode"/>
</xsl:copy>
</xsl:template>
<xsl:template match="processing-instruction()|comment()" mode="make.verbatim.mode">
<xsl:copy/>
</xsl:template>
<xsl:template match="text()" mode="make.verbatim.mode">
<xsl:variable name="text" select="translate(., ' ', '&#160;')"/>
<xsl:choose>
<xsl:when test="not(contains($text, '&#xA;'))">
<xsl:value-of select="$text"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="len" select="string-length($text)"/>
<xsl:choose>
<xsl:when test="$len = 1">
<br/><xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="half" select="$len div 2"/>
<xsl:call-template name="make-verbatim-recursive">
<xsl:with-param name="text" select="substring($text, 1, $half)"/>
</xsl:call-template>
<xsl:call-template name="make-verbatim-recursive">
<xsl:with-param name="text"
select="substring($text, ($half + 1), $len)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="make-verbatim-recursive">
<xsl:param name="text" select="''"/>
<xsl:choose>
<xsl:when test="not(contains($text, '&#xA;'))">
<xsl:value-of select="$text"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="len" select="string-length($text)"/>
<xsl:choose>
<xsl:when test="$len = 1">
<br/><xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="half" select="$len div 2"/>
<xsl:call-template name="make-verbatim-recursive">
<xsl:with-param name="text" select="substring($text, 1, $half)"/>
</xsl:call-template>
<xsl:call-template name="make-verbatim-recursive">
<xsl:with-param name="text"
select="substring($text, ($half + 1), $len)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<!-- remove.empty.div mode templates remove empty blocks -->
<xsl:template name="remove.empty.div">
<xsl:param name="div"/>
<xsl:choose>
<xsl:when test="$exsl.node.set.available != 0">
<xsl:apply-templates select="exsl:node-set($div)" mode="remove.empty.div"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$div"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template xmlns:html="http://www.w3.org/1999/xhtml"
match="html:p|p|html:div|div" mode="remove.empty.div">
<xsl:if test="node()">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="remove.empty.div"/>
</xsl:copy>
</xsl:if>
</xsl:template>
<xsl:template match="*" mode="remove.empty.div">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="remove.empty.div"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()|processing-instruction()|comment()" mode="remove.empty.div">
<xsl:copy/>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@ -1,698 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: html.xsl 9306 2012-04-28 03:49:00Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- These variables set the align attribute value for HTML output based on
the writing-mode specified in the gentext file for the document's lang. -->
<xsl:variable name="direction.align.start">
<xsl:choose>
<xsl:when test="starts-with($writing.mode, 'lr')">left</xsl:when>
<xsl:when test="starts-with($writing.mode, 'rl')">right</xsl:when>
<xsl:otherwise>left</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="direction.align.end">
<xsl:choose>
<xsl:when test="starts-with($writing.mode, 'lr')">right</xsl:when>
<xsl:when test="starts-with($writing.mode, 'rl')">left</xsl:when>
<xsl:otherwise>right</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="direction.mode">
<xsl:choose>
<xsl:when test="starts-with($writing.mode, 'lr')">ltr</xsl:when>
<xsl:when test="starts-with($writing.mode, 'rl')">rtl</xsl:when>
<xsl:otherwise>ltr</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Support switching to <section> for HTML5 stylesheet -->
<!-- This is an internal variable that does not need to be set by a user -->
<xsl:variable name="div.element">div</xsl:variable>
<!-- Support turning off table border with border="" for HTML5 -->
<xsl:variable name="table.border.off">0</xsl:variable>
<!-- The generate.html.title template is currently used for generating HTML -->
<!-- "title" attributes for some inline elements only, but not for any -->
<!-- block elements. It is called in eleven places in the inline.xsl -->
<!-- file. But it's called by all the inline.* templates (e.g., -->
<!-- inline.boldseq), which in turn are called by other (element) -->
<!-- templates, so it results, currently, in supporting generation of the -->
<!-- HTML "title" attribute for a total of about 92 elements. -->
<!-- You can use mode="html.title.attribute" to get a title for -->
<!-- an element specified by a param, including targets of cross references. -->
<xsl:template name="generate.html.title">
<xsl:apply-templates select="." mode="html.title.attribute"/>
</xsl:template>
<xsl:template match="acronym|abbrev" mode="html.title.attribute">
<xsl:if test="alt">
<xsl:attribute name="title">
<xsl:value-of select="normalize-space(alt)"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<!-- Generate a title attribute for the context node -->
<!-- This may be the target of an xref -->
<xsl:template match="*" mode="html.title.attribute">
<xsl:variable name="is.title">
<xsl:call-template name="gentext.template.exists">
<xsl:with-param name="context" select="'title'"/>
<xsl:with-param name="name" select="local-name(.)"/>
<xsl:with-param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is.title-numbered">
<xsl:call-template name="gentext.template.exists">
<xsl:with-param name="context" select="'title-numbered'"/>
<xsl:with-param name="name" select="local-name(.)"/>
<xsl:with-param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is.title-unnumbered">
<xsl:call-template name="gentext.template.exists">
<xsl:with-param name="context" select="'title-unnumbered'"/>
<xsl:with-param name="name" select="local-name(.)"/>
<xsl:with-param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="has.title.markup">
<xsl:apply-templates select="." mode="title.markup">
<xsl:with-param name="verbose" select="0"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:variable name="gentext.title">
<xsl:if test="$has.title.markup != '???TITLE???' and
($is.title != 0 or
$is.title-numbered != 0 or
$is.title-unnumbered != 0)">
<xsl:apply-templates select="."
mode="object.title.markup.textonly"/>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($gentext.title) != 0">
<xsl:attribute name="title">
<xsl:value-of select="$gentext.title"/>
</xsl:attribute>
</xsl:when>
<!-- Fall back to alt if available -->
<xsl:when test="alt">
<xsl:attribute name="title">
<xsl:value-of select="normalize-space(alt)"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="qandaentry" mode="html.title.attribute">
<xsl:apply-templates select="question" mode="html.title.attribute"/>
</xsl:template>
<xsl:template match="question" mode="html.title.attribute">
<xsl:variable name="label.text">
<xsl:apply-templates select="." mode="qanda.label"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($label.text) != 0">
<xsl:attribute name="title">
<xsl:value-of select="$label.text"/>
</xsl:attribute>
</xsl:when>
<!-- Fall back to alt if available -->
<xsl:when test="alt">
<xsl:attribute name="title">
<xsl:value-of select="normalize-space(alt)"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="dir">
<xsl:param name="inherit" select="0"/>
<xsl:variable name="dir">
<xsl:choose>
<xsl:when test="@dir">
<xsl:value-of select="@dir"/>
</xsl:when>
<xsl:when test="$inherit != 0">
<xsl:value-of select="ancestor::*/@dir[1]"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:if test="$dir != ''">
<xsl:attribute name="dir">
<xsl:value-of select="$dir"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template name="anchor">
<xsl:param name="node" select="."/>
<xsl:param name="conditional" select="1"/>
<xsl:choose>
<xsl:when test="$generate.id.attributes != 0">
<!-- No named anchors output when this param is set -->
</xsl:when>
<xsl:when test="$conditional = 0 or $node/@id or $node/@xml:id">
<a>
<xsl:attribute name="name">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$node"/>
</xsl:call-template>
</xsl:attribute>
</a>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="id.attribute">
<xsl:param name="node" select="."/>
<xsl:param name="conditional" select="1"/>
<xsl:choose>
<xsl:when test="$generate.id.attributes = 0">
<!-- No id attributes when this param is zero -->
</xsl:when>
<xsl:when test="$conditional = 0 or $node/@id or $node/@xml:id">
<xsl:attribute name="id">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$node"/>
</xsl:call-template>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="href.target.uri">
<xsl:param name="context" select="."/>
<xsl:param name="object" select="."/>
<xsl:text>#</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$object"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="href.target">
<xsl:param name="context" select="."/>
<xsl:param name="object" select="."/>
<xsl:text>#</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$object"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="href.target.with.base.dir">
<xsl:param name="context" select="."/>
<xsl:param name="object" select="."/>
<xsl:if test="$manifest.in.base.dir = 0">
<xsl:value-of select="$chunk.base.dir"/>
</xsl:if>
<xsl:call-template name="href.target">
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="object" select="$object"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="dingbat">
<xsl:param name="dingbat">bullet</xsl:param>
<xsl:call-template name="dingbat.characters">
<xsl:with-param name="dingbat" select="$dingbat"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="dingbat.characters">
<!-- now that I'm using the real serializer, all that dingbat malarky -->
<!-- isn't necessary anymore... -->
<xsl:param name="dingbat">bullet</xsl:param>
<xsl:choose>
<xsl:when test="$dingbat='bullet'">&#x2022;</xsl:when>
<xsl:when test="$dingbat='copyright'">&#x00A9;</xsl:when>
<xsl:when test="$dingbat='trademark'">&#x2122;</xsl:when>
<xsl:when test="$dingbat='trade'">&#x2122;</xsl:when>
<xsl:when test="$dingbat='registered'">&#x00AE;</xsl:when>
<xsl:when test="$dingbat='service'">(SM)</xsl:when>
<xsl:when test="$dingbat='nbsp'">&#x00A0;</xsl:when>
<xsl:when test="$dingbat='ldquo'">&#x201C;</xsl:when>
<xsl:when test="$dingbat='rdquo'">&#x201D;</xsl:when>
<xsl:when test="$dingbat='lsquo'">&#x2018;</xsl:when>
<xsl:when test="$dingbat='rsquo'">&#x2019;</xsl:when>
<xsl:when test="$dingbat='em-dash'">&#x2014;</xsl:when>
<xsl:when test="$dingbat='mdash'">&#x2014;</xsl:when>
<xsl:when test="$dingbat='en-dash'">&#x2013;</xsl:when>
<xsl:when test="$dingbat='ndash'">&#x2013;</xsl:when>
<xsl:otherwise>
<xsl:text>&#x2022;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="id.warning">
<xsl:if test="$id.warnings != 0 and not(@id) and not(@xml:id) and parent::*">
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="title">
<xsl:value-of select="title[1]"/>
</xsl:when>
<xsl:when test="substring(local-name(*[1]),
string-length(local-name(*[1])-3) = 'info')
and *[1]/title">
<xsl:value-of select="*[1]/title[1]"/>
</xsl:when>
<xsl:when test="refmeta/refentrytitle">
<xsl:value-of select="refmeta/refentrytitle"/>
</xsl:when>
<xsl:when test="refnamediv/refname">
<xsl:value-of select="refnamediv/refname[1]"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:message>
<xsl:text>ID recommended on </xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:if test="$title != ''">
<xsl:text>: </xsl:text>
<xsl:choose>
<xsl:when test="string-length($title) &gt; 40">
<xsl:value-of select="substring($title,1,40)"/>
<xsl:text>...</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:message>
</xsl:if>
</xsl:template>
<xsl:template name="generate.class.attribute">
<xsl:param name="class" select="local-name(.)"/>
<xsl:apply-templates select="." mode="class.attribute">
<xsl:with-param name="class" select="$class"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*" mode="class.attribute">
<xsl:param name="class" select="local-name(.)"/>
<!-- permit customization of class attributes -->
<!-- Use element name by default -->
<xsl:variable name="class.value">
<xsl:apply-templates select="." mode="class.value">
<xsl:with-param name="class" select="$class"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:if test="string-length(normalize-space($class.value)) != 0">
<xsl:attribute name="class">
<xsl:value-of select="$class.value"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template match="*" mode="class.value">
<xsl:param name="class" select="local-name(.)"/>
<!-- permit customization of class value only -->
<!-- Use element name by default -->
<xsl:value-of select="$class"/>
</xsl:template>
<!-- Apply common attributes such as class, lang, dir -->
<xsl:template name="common.html.attributes">
<xsl:param name="inherit" select="0"/>
<xsl:param name="class" select="local-name(.)"/>
<xsl:apply-templates select="." mode="common.html.attributes">
<xsl:with-param name="class" select="$class"/>
<xsl:with-param name="inherit" select="$inherit"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*" mode="common.html.attributes">
<xsl:param name="class" select="local-name(.)"/>
<xsl:param name="inherit" select="0"/>
<xsl:call-template name="generate.html.lang"/>
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="$inherit"/>
</xsl:call-template>
<xsl:apply-templates select="." mode="class.attribute">
<xsl:with-param name="class" select="$class"/>
</xsl:apply-templates>
</xsl:template>
<!-- Apply common attributes not including class -->
<xsl:template name="locale.html.attributes">
<xsl:apply-templates select="." mode="locale.html.attributes"/>
</xsl:template>
<xsl:template match="*" mode="locale.html.attributes">
<xsl:call-template name="generate.html.lang"/>
<xsl:call-template name="dir"/>
</xsl:template>
<!-- Pass through any lang attributes -->
<xsl:template name="generate.html.lang">
<xsl:apply-templates select="." mode="html.lang.attribute"/>
</xsl:template>
<xsl:template match="*" mode="html.lang.attribute">
<!-- match the attribute name to the output type -->
<xsl:choose>
<xsl:when test="@lang and $stylesheet.result.type = 'html'">
<xsl:attribute name="lang">
<xsl:value-of select="@lang"/>
</xsl:attribute>
</xsl:when>
<xsl:when test="@lang and $stylesheet.result.type = 'xhtml'">
<xsl:attribute name="xml:lang">
<xsl:value-of select="@lang"/>
</xsl:attribute>
</xsl:when>
<xsl:when test="@xml:lang and $stylesheet.result.type = 'html'">
<xsl:attribute name="lang">
<xsl:value-of select="@xml:lang"/>
</xsl:attribute>
</xsl:when>
<xsl:when test="@xml:lang and $stylesheet.result.type = 'xhtml'">
<xsl:attribute name="xml:lang">
<xsl:value-of select="@xml:lang"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<!-- Insert link to css or insert literal CSS in head element -->
<xsl:template name="generate.css">
<xsl:choose>
<xsl:when test="$generate.css.header = 0">
<xsl:call-template name="generate.css.links"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="generate.css.headers"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="generate.css.headers">
<xsl:call-template name="generate.default.css.header"/>
<xsl:call-template name="generate.custom.css.header"/>
</xsl:template>
<xsl:template name="generate.default.css.header">
<xsl:if test="$make.clean.html != 0 and
$docbook.css.source != ''">
<!-- Select default file relative to stylesheet -->
<xsl:variable name="css.node" select="document($docbook.css.source)/*[1]"/>
<xsl:call-template name="output.css.header">
<xsl:with-param name="css.node" select="$css.node"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="generate.custom.css.header">
<xsl:if test="$custom.css.source != ''">
<!-- Select custom file relative to document -->
<xsl:variable name="css.node" select="document($custom.css.source,.)/*[1]"/>
<xsl:call-template name="output.css.header">
<xsl:with-param name="css.node" select="$css.node"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="output.css.header">
<xsl:param name="css.node"/>
<xsl:choose>
<xsl:when test="count($css.node) = 0">
</xsl:when>
<xsl:otherwise>
<style type="text/css">
<xsl:copy-of select="$css.node/text()"/>
</style>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="generate.css.links">
<xsl:call-template name="generate.default.css.link"/>
<xsl:call-template name="generate.custom.css.link"/>
</xsl:template>
<xsl:template name="generate.default.css.link">
<xsl:if test="$make.clean.html != 0 and
$docbook.css.link != 0 and
$docbook.css.source != ''">
<xsl:variable name="filename">
<xsl:call-template name="css.output.filename">
<xsl:with-param name="src" select="$docbook.css.source"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="make.css.link">
<xsl:with-param name="css.filename" select="$filename"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="generate.custom.css.link">
<xsl:if test="$custom.css.source != ''">
<xsl:variable name="filename">
<xsl:call-template name="css.output.filename">
<xsl:with-param name="src" select="$custom.css.source"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="make.css.link">
<xsl:with-param name="css.filename" select="$filename"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- a CSS link reference must take into account the relative
path to a CSS file when chunked HTML is output to more than one directory -->
<xsl:template name="make.css.link">
<xsl:param name="css.filename" select="''"/>
<xsl:variable name="href">
<xsl:call-template name="relative.path.link">
<xsl:with-param name="target.pathname" select="$css.filename"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="string-length($css.filename) != 0">
<link rel="stylesheet"
type="text/css"
href="{$href}"/>
</xsl:if>
</xsl:template>
<!-- And the same applies to script links -->
<xsl:template name="make.script.link">
<xsl:param name="script.filename" select="''"/>
<xsl:variable name="src">
<xsl:call-template name="relative.path.link">
<xsl:with-param name="target.pathname" select="$script.filename"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="string-length($script.filename) != 0">
<script>
<xsl:attribute name="src">
<xsl:value-of select="$src"/>
</xsl:attribute>
<xsl:attribute name="type">
<xsl:value-of select="$html.script.type"/>
</xsl:attribute>
<xsl:call-template name="other.script.attributes">
<xsl:with-param name="script.filename" select="$script.filename"/>
</xsl:call-template>
</script>
</xsl:if>
</xsl:template>
<xsl:template name="other.script.attributes">
<xsl:param name="script.filename"/>
<!-- Placeholder template to allow customization to
insert additional script element attributes if needed -->
</xsl:template>
<xsl:template name="relative.path.link">
<xsl:param name="target.pathname"/>
<xsl:variable name="href.to.uri" select="$target.pathname"/>
<xsl:variable name="href.from.uri">
<xsl:call-template name="href.target.uri">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="href.to">
<xsl:call-template name="trim.common.uri.paths">
<xsl:with-param name="uriA" select="$href.to.uri"/>
<xsl:with-param name="uriB" select="$href.from.uri"/>
<xsl:with-param name="return" select="'A'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="href.from">
<xsl:call-template name="trim.common.uri.paths">
<xsl:with-param name="uriA" select="$href.to.uri"/>
<xsl:with-param name="uriB" select="$href.from.uri"/>
<xsl:with-param name="return" select="'B'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="depth">
<xsl:call-template name="count.uri.path.depth">
<xsl:with-param name="filename" select="$href.from"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="href">
<xsl:call-template name="copy-string">
<xsl:with-param name="string" select="'../'"/>
<xsl:with-param name="count" select="$depth"/>
</xsl:call-template>
<xsl:value-of select="$href.to"/>
</xsl:variable>
<xsl:value-of select="$href"/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="generate.css.files">
<xsl:call-template name="generate.default.css.file"/>
<xsl:call-template name="generate.custom.css.file"/>
</xsl:template>
<xsl:template name="generate.default.css.file">
<xsl:if test="$make.clean.html != 0 and
$generate.css.header = 0 and
$docbook.css.source != ''">
<!-- Select default file relative to stylesheet -->
<xsl:variable name="css.node" select="document($docbook.css.source)/*[1]"/>
<xsl:call-template name="generate.css.file">
<xsl:with-param name="src" select="$docbook.css.source"/>
<xsl:with-param name="css.node" select="$css.node"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="generate.custom.css.file">
<xsl:if test="$custom.css.source != '' and
$generate.css.header = 0">
<!-- Select custom file relative to document -->
<xsl:variable name="css.node" select="document($custom.css.source,.)/*[1]"/>
<xsl:call-template name="generate.css.file">
<xsl:with-param name="src" select="$custom.css.source"/>
<xsl:with-param name="css.node" select="$css.node"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="generate.css.file">
<xsl:param name="css.node"/>
<xsl:param name="src" select="''"/>
<xsl:variable name="css.text" select="$css.node/text()"/>
<xsl:choose>
<xsl:when test="count($css.node) = 0">
<xsl:message>
<xsl:text>ERROR: no root element for CSS source file'</xsl:text>
<xsl:value-of select="$src"/>
<xsl:text>'.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="filename">
<xsl:call-template name="css.output.pathname">
<xsl:with-param name="src" select="$src"/>
<xsl:with-param name="content" select="$css.node"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="write.text.chunk">
<xsl:with-param name="filename" select="$filename"/>
<xsl:with-param name="content" select="$css.text"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="css.output.filename">
<xsl:param name="content"/>
<xsl:param name="src" select="''"/>
<xsl:variable name="candidate">
<xsl:choose>
<xsl:when test="string-length($src) = 0">
<xsl:message>
<xsl:text>ERROR: missing CSS input filename.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:when test="substring($src,string-length($src)-3) = '.xml'">
<xsl:value-of select="substring($src, 1, string-length($src) - 4)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$src"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$candidate"/>
</xsl:template>
<xsl:template name="css.output.pathname">
<xsl:param name="content"/>
<xsl:param name="src" select="''"/>
<xsl:variable name="file">
<xsl:call-template name="css.output.filename">
<xsl:with-param name="content" select="$content"/>
<xsl:with-param name="src" select="$src"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="path" select="concat($chunk.base.dir, $file)"/>
<xsl:value-of select="$path"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,136 +0,0 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- ********************************************************************
$Id: htmltbl.xsl 9140 2011-10-30 03:42:11Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="table" mode="htmlTable">
<xsl:element name="table" namespace="">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
<xsl:call-template name="htmlTable"/>
</xsl:element>
</xsl:template>
<xsl:template match="colgroup" mode="htmlTable">
<xsl:element name="{local-name()}" namespace="">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:apply-templates mode="htmlTable"/>
</xsl:element>
</xsl:template>
<xsl:template match="col" mode="htmlTable">
<xsl:element name="{local-name()}" namespace="">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
</xsl:element>
</xsl:template>
<!-- Handled by formal.object.title template -->
<xsl:template match="caption" mode="htmlTable"/>
<xsl:template match="tbody|thead|tfoot|tr" mode="htmlTable">
<xsl:element name="{local-name(.)}">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:apply-templates mode="htmlTable"/>
</xsl:element>
</xsl:template>
<xsl:template match="th|td" mode="htmlTable">
<xsl:element name="{local-name(.)}">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:apply-templates/> <!-- *not* mode=htmlTable -->
</xsl:element>
</xsl:template>
<!-- don't copy through DocBook-specific attributes on HTML table markup -->
<!-- default behavior is to not copy through because there are more
DocBook attributes than HTML attributes -->
<xsl:template mode="htmlTableAtt" match="@*"/>
<!-- copy these through -->
<xsl:template mode="htmlTableAtt"
match="@abbr
| @align
| @axis
| @bgcolor
| @border
| @cellpadding
| @cellspacing
| @char
| @charoff
| @class
| @dir
| @frame
| @headers
| @height
| @lang
| @nowrap
| @onclick
| @ondblclick
| @onkeydown
| @onkeypress
| @onkeyup
| @onmousedown
| @onmousemove
| @onmouseout
| @onmouseover
| @onmouseup
| @rules
| @style
| @summary
| @title
| @valign
| @valign
| @width
| @xml:lang">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="@span|@rowspan|@colspan" mode="htmlTableAtt">
<!-- No need to copy through the DTD's default value "1" of the attribute -->
<xsl:if test="number(.) != 1">
<xsl:attribute name="{local-name(.)}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<!-- map floatstyle to HTML float values -->
<xsl:template match="@floatstyle" mode="htmlTableAtt">
<xsl:attribute name="style">
<xsl:text>float: </xsl:text>
<xsl:choose>
<xsl:when test="contains(., 'left')">left</xsl:when>
<xsl:when test="contains(., 'right')">right</xsl:when>
<xsl:when test="contains(., 'start')">
<xsl:value-of select="$direction.align.start"/>
</xsl:when>
<xsl:when test="contains(., 'end')">
<xsl:value-of select="$direction.align.end"/>
</xsl:when>
<xsl:when test="contains(., 'inside')">
<xsl:value-of select="$direction.align.start"/>
</xsl:when>
<xsl:when test="contains(., 'outside')">
<xsl:value-of select="$direction.align.end"/>
</xsl:when>
<xsl:when test="contains(., 'before')">none</xsl:when>
<xsl:when test="contains(., 'none')">none</xsl:when>
</xsl:choose>
<xsl:text>;</xsl:text>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,279 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: index.xsl 9297 2012-04-22 03:56:16Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="index">
<!-- some implementations use completely empty index tags to indicate -->
<!-- where an automatically generated index should be inserted. so -->
<!-- if the index is completely empty, skip it. Unless generate.index -->
<!-- is non-zero, in which case, this is where the automatically -->
<!-- generated index should go. -->
<xsl:call-template name="id.warning"/>
<xsl:if test="count(*)>0 or $generate.index != '0'">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="index.titlepage"/>
<xsl:choose>
<xsl:when test="indexdiv">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[not(self::indexentry)]"/>
<!-- Because it's actually valid for Index to have neither any -->
<!-- Indexdivs nor any Indexentries, we need to check and make -->
<!-- sure that at least one Indexentry exists, and generate a -->
<!-- wrapper dl if there is at least one; otherwise, do nothing. -->
<xsl:if test="indexentry">
<!-- The indexentry template assumes a parent dl wrapper has -->
<!-- been generated; for Indexes that have Indexdivs, the dl -->
<!-- wrapper is generated by the indexdiv template; however, -->
<!-- for Indexes that lack Indexdivs, if we don't generate a -->
<!-- dl here, HTML output will not be valid. -->
<dl>
<xsl:apply-templates select="indexentry"/>
</dl>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">
<xsl:call-template name="generate-index">
<xsl:with-param name="scope" select="(ancestor::book|/)[last()]"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="not(parent::article)">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="setindex">
<!-- some implementations use completely empty index tags to indicate -->
<!-- where an automatically generated index should be inserted. so -->
<!-- if the index is completely empty, skip it. Unless generate.index -->
<!-- is non-zero, in which case, this is where the automatically -->
<!-- generated index should go. -->
<xsl:call-template name="id.warning"/>
<xsl:if test="count(*)>0 or $generate.index != '0'">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="setindex.titlepage"/>
<xsl:apply-templates/>
<xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">
<xsl:call-template name="generate-index">
<xsl:with-param name="scope" select="/"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="not(parent::article)">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="index/indexinfo"></xsl:template>
<xsl:template match="index/info"></xsl:template>
<xsl:template match="index/title"></xsl:template>
<xsl:template match="index/subtitle"></xsl:template>
<xsl:template match="index/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="indexdiv">
<xsl:call-template name="id.warning"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="*[not(self::indexentry)]"/>
<dl>
<xsl:apply-templates select="indexentry"/>
</dl>
</div>
</xsl:template>
<xsl:template match="indexdiv/title">
<h3>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</h3>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="indexterm">
<!-- this one must have a name, even if it doesn't have an ID -->
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<a class="indexterm" name="{$id}"/>
</xsl:template>
<xsl:template match="primary|secondary|tertiary|see|seealso">
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="indexentry">
<xsl:apply-templates select="primaryie"/>
</xsl:template>
<xsl:template match="primaryie">
<dt>
<xsl:apply-templates/>
</dt>
<dd>
<xsl:apply-templates select="following-sibling::seeie
[not(preceding-sibling::secondaryie)]"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::seealsoie
[not(preceding-sibling::secondaryie)]"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::secondaryie"
mode="indexentry"/>
</dd>
</xsl:template>
<!-- Handled in mode to convert flat list to structured output -->
<xsl:template match="secondaryie">
</xsl:template>
<xsl:template match="tertiaryie">
</xsl:template>
<xsl:template match="seeie|seealsoie">
</xsl:template>
<xsl:template match="secondaryie" mode="indexentry">
<dl>
<dt>
<xsl:apply-templates/>
</dt>
<dd>
<!-- select following see* elements up to next secondaryie or tertiary or end -->
<xsl:variable name="after.this"
select="following-sibling::*"/>
<xsl:variable name="next.entry"
select="(following-sibling::secondaryie|following-sibling::tertiaryie)[1]"/>
<xsl:variable name="before.entry"
select="$next.entry/preceding-sibling::*"/>
<xsl:variable name="see.intersection"
select="$after.this[count(.|$before.entry) = count($before.entry)]
[self::seeie or self::seealsoie]"/>
<xsl:choose>
<xsl:when test="count($see.intersection) != 0">
<xsl:apply-templates select="$see.intersection" mode="indexentry"/>
</xsl:when>
<xsl:when test="count($next.entry) = 0">
<xsl:apply-templates select="following-sibling::seeie"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::seealsoie"
mode="indexentry"/>
</xsl:when>
</xsl:choose>
<!-- now process any tertiaryie before the next secondaryie -->
<xsl:variable name="before.next.secondary"
select="following-sibling::secondaryie[1]/preceding-sibling::*"/>
<xsl:variable name="tertiary.intersection"
select="$after.this[count(.|$before.next.secondary) =
count($before.next.secondary)]
[not(self::seeie) and not(self::seealsoie)]"/>
<xsl:choose>
<xsl:when test="count($tertiary.intersection) != 0">
<xsl:apply-templates select="$tertiary.intersection"
mode="indexentry"/>
</xsl:when>
<xsl:when test="not(following-sibling::secondaryie)">
<xsl:apply-templates select="following-sibling::tertiaryie"
mode="indexentry"/>
</xsl:when>
</xsl:choose>
</dd>
</dl>
</xsl:template>
<xsl:template match="tertiaryie" mode="indexentry">
<dl>
<dt>
<xsl:apply-templates/>
</dt>
<dd>
<!-- select following see* elements up to next secondaryie or tertiary or end -->
<xsl:variable name="after.this"
select="following-sibling::*"/>
<xsl:variable name="next.entry"
select="(following-sibling::secondaryie|following-sibling::tertiaryie)[1]"/>
<xsl:variable name="before.entry"
select="$next.entry/preceding-sibling::*"/>
<xsl:variable name="see.intersection"
select="$after.this[count(.|$before.entry) = count($before.entry)]
[self::seeie or self::seealsoie]"/>
<xsl:choose>
<xsl:when test="count($see.intersection) != 0">
<xsl:apply-templates select="$see.intersection" mode="indexentry"/>
</xsl:when>
<xsl:when test="count($next.entry) = 0">
<xsl:apply-templates select="following-sibling::seeie"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::seealsoie"
mode="indexentry"/>
</xsl:when>
</xsl:choose>
</dd>
</dl>
</xsl:template>
<xsl:template match="seeie" mode="indexentry">
<dt>
<xsl:text>(</xsl:text>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'see'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
<xsl:text>)</xsl:text>
</dt>
</xsl:template>
<xsl:template match="seealsoie" mode="indexentry">
<div>
<xsl:text>(</xsl:text>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'seealso'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
<xsl:text>)</xsl:text>
</div>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,45 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: info.xsl 9297 2012-04-22 03:56:16Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- These templates define the "default behavior" for info
elements. Even if you don't process the *info wrappers,
some of these elements are needed because the elements are
processed from named templates that are called with modes.
Since modes aren't sticky, these rules apply.
(TODO: clarify this comment) -->
<!-- ==================================================================== -->
<!-- called from named templates in a given mode -->
<xsl:template match="corpauthor">
<span>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="jobtitle">
<span>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: keywords.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:template match="keywordset"></xsl:template>
<xsl:template match="subjectset"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="keywordset" mode="html.header">
<meta name="keywords">
<xsl:attribute name="content">
<xsl:apply-templates select="keyword" mode="html.header"/>
</xsl:attribute>
</meta>
</xsl:template>
<xsl:template match="keyword" mode="html.header">
<xsl:apply-templates/>
<xsl:if test="following-sibling::keyword">, </xsl:if>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@ -1,271 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="mml"
version='1.0'>
<!-- ********************************************************************
$Id: math.xsl 9297 2012-04-22 03:56:16Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:template match="inlineequation">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="alt">
</xsl:template>
<xsl:template match="mathphrase">
<span>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<!-- "Support" for MathML -->
<xsl:template match="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<!-- Support for TeX math in alt -->
<xsl:template match="*" mode="collect.tex.math">
<xsl:call-template name="write.text.chunk">
<xsl:with-param name="filename" select="$tex.math.file"/>
<xsl:with-param name="method" select="'text'"/>
<xsl:with-param name="content">
<xsl:choose>
<xsl:when test="$tex.math.in.alt = 'plain'">
<xsl:call-template name="tex.math.plain.head"/>
<xsl:apply-templates select="." mode="collect.tex.math.plain"/>
<xsl:call-template name="tex.math.plain.tail"/>
</xsl:when>
<xsl:when test="$tex.math.in.alt = 'latex'">
<xsl:call-template name="tex.math.latex.head"/>
<xsl:apply-templates select="." mode="collect.tex.math.latex"/>
<xsl:call-template name="tex.math.latex.tail"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
Unsupported TeX math notation:
<xsl:value-of select="$tex.math.in.alt"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="encoding" select="$chunker.output.encoding"/>
</xsl:call-template>
</xsl:template>
<!-- PlainTeX -->
<xsl:template name="tex.math.plain.head">
<xsl:text>\nopagenumbers &#xA;</xsl:text>
</xsl:template>
<xsl:template name="tex.math.plain.tail">
<xsl:text>\bye &#xA;</xsl:text>
</xsl:template>
<xsl:template match="inlineequation" mode="collect.tex.math.plain">
<xsl:variable name="filename">
<xsl:choose>
<xsl:when test="graphic">
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object" select="graphic"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="select.mediaobject.filename">
<xsl:with-param name="olist" select="inlinemediaobject/*"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="output.delims">
<xsl:call-template name="tex.math.output.delims"/>
</xsl:variable>
<xsl:variable name="tex" select="alt[@role='tex'] | inlinemediaobject/textobject[@role='tex']"/>
<xsl:if test="$tex">
<xsl:text>\special{dvi2bitmap outputfile </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>} &#xA;</xsl:text>
<xsl:if test="$output.delims != 0">
<xsl:text>$</xsl:text>
</xsl:if>
<xsl:value-of select="$tex"/>
<xsl:if test="$output.delims != 0">
<xsl:text>$ &#xA;</xsl:text>
</xsl:if>
<xsl:text>\vfill\eject &#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="equation|informalequation" mode="collect.tex.math.plain">
<xsl:variable name="filename">
<xsl:choose>
<xsl:when test="graphic">
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object" select="graphic"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="select.mediaobject.filename">
<xsl:with-param name="olist" select="mediaobject/*"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="output.delims">
<xsl:call-template name="tex.math.output.delims"/>
</xsl:variable>
<xsl:variable name="tex" select="alt[@role='tex'] | mediaobject/textobject[@role='tex']"/>
<xsl:if test="$tex">
<xsl:text>\special{dvi2bitmap outputfile </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>} &#xA;</xsl:text>
<xsl:if test="$output.delims != 0">
<xsl:text>$$</xsl:text>
</xsl:if>
<xsl:value-of select="$tex"/>
<xsl:if test="$output.delims != 0">
<xsl:text>$$ &#xA;</xsl:text>
</xsl:if>
<xsl:text>\vfill\eject &#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="text()" mode="collect.tex.math.plain"/>
<!-- LaTeX -->
<xsl:template name="tex.math.latex.head">
<xsl:text>\documentclass{article} &#xA;</xsl:text>
<xsl:text>\pagestyle{empty} &#xA;</xsl:text>
<xsl:text>\begin{document} &#xA;</xsl:text>
</xsl:template>
<xsl:template name="tex.math.latex.tail">
<xsl:text>\end{document} &#xA;</xsl:text>
</xsl:template>
<xsl:template match="inlineequation" mode="collect.tex.math.latex">
<xsl:variable name="filename">
<xsl:choose>
<xsl:when test="graphic">
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object" select="graphic"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="select.mediaobject.filename">
<xsl:with-param name="olist" select="inlinemediaobject/*"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="output.delims">
<xsl:call-template name="tex.math.output.delims"/>
</xsl:variable>
<xsl:variable name="tex" select="alt[@role='tex'] | inlinemediaobject/textobject[@role='tex']"/>
<xsl:if test="$tex">
<xsl:text>\special{dvi2bitmap outputfile </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>} &#xA;</xsl:text>
<xsl:if test="$output.delims != 0">
<xsl:text>$</xsl:text>
</xsl:if>
<xsl:value-of select="$tex"/>
<xsl:if test="$output.delims != 0">
<xsl:text>$ &#xA;</xsl:text>
</xsl:if>
<xsl:text>\newpage &#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="equation|informalequation" mode="collect.tex.math.latex">
<xsl:variable name="filename">
<xsl:choose>
<xsl:when test="graphic">
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object" select="graphic"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="select.mediaobject.filename">
<xsl:with-param name="olist" select="mediaobject/*"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="output.delims">
<xsl:call-template name="tex.math.output.delims"/>
</xsl:variable>
<xsl:variable name="tex" select="alt[@role='tex'] | mediaobject/textobject[@role='tex']"/>
<xsl:if test="$tex">
<xsl:text>\special{dvi2bitmap outputfile </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>} &#xA;</xsl:text>
<xsl:if test="$output.delims != 0">
<xsl:text>$$</xsl:text>
</xsl:if>
<xsl:value-of select="$tex"/>
<xsl:if test="$output.delims != 0">
<xsl:text>$$ &#xA;</xsl:text>
</xsl:if>
<xsl:text>\newpage &#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="text()" mode="collect.tex.math.latex"/>
<!-- Extracting image filename from mediaobject and graphic elements -->
<xsl:template name="select.mediaobject.filename">
<xsl:param name="olist"
select="imageobject|imageobjectco
|videoobject|audioobject|textobject"/>
<xsl:variable name="mediaobject.index">
<xsl:call-template name="select.mediaobject.index">
<xsl:with-param name="olist" select="$olist"/>
<xsl:with-param name="count" select="1"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$mediaobject.index != ''">
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object"
select="$olist[position() = $mediaobject.index]"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="tex.math.output.delims">
<xsl:variable name="pi.delims">
<xsl:call-template name="pi.dbtex_delims">
<xsl:with-param name="node" select="descendant-or-self::*"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="result">
<xsl:choose>
<xsl:when test="$pi.delims = 'no'">0</xsl:when>
<xsl:when test="$pi.delims = '' and $tex.math.delims = 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$result"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,447 +0,0 @@
<?xml version="1.0"?>
<!-- This file is generated from param.xweb -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- ********************************************************************
$Id: param.xweb 9333 2012-05-06 19:41:03Z dcramer $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:param name="abstract.notitle.enabled" select="0"/>
<xsl:param name="admon.graphics.extension">.png</xsl:param>
<xsl:param name="admon.graphics" select="0"/>
<xsl:param name="admon.graphics.path">images/</xsl:param>
<xsl:param name="admon.style">
<xsl:value-of select="concat('margin-', $direction.align.start, ': 0.5in; margin-', $direction.align.end, ': 0.5in;')"/>
</xsl:param>
<xsl:param name="admon.textlabel" select="1"/>
<xsl:param name="annotate.toc" select="1"/>
<xsl:param name="annotation.css">
/* ======================================================================
Annotations
*/
div.annotation-list { visibility: hidden;
}
div.annotation-nocss { position: absolute;
visibility: hidden;
}
div.annotation-popup { position: absolute;
z-index: 4;
visibility: hidden;
padding: 0px;
margin: 2px;
border-style: solid;
border-width: 1px;
width: 200px;
background-color: white;
}
div.annotation-title { padding: 1px;
font-weight: bold;
border-bottom-style: solid;
border-bottom-width: 1px;
color: white;
background-color: black;
}
div.annotation-body { padding: 2px;
}
div.annotation-body p { margin-top: 0px;
padding-top: 0px;
}
div.annotation-close { position: absolute;
top: 2px;
right: 2px;
}
</xsl:param>
<xsl:param name="annotation.graphic.close">
http://docbook.sourceforge.net/release/images/annot-close.png</xsl:param>
<xsl:param name="annotation.graphic.open">http://docbook.sourceforge.net/release/images/annot-open.png</xsl:param>
<xsl:param name="annotation.js">
<xsl:text>http://docbook.sourceforge.net/release/script/AnchorPosition.js http://docbook.sourceforge.net/release/script/PopupWindow.js</xsl:text></xsl:param>
<xsl:param name="annotation.support" select="0"/>
<xsl:param name="appendix.autolabel">A</xsl:param>
<xsl:param name="author.othername.in.middle" select="1"/>
<xsl:param name="autotoc.label.in.hyperlink" select="1"/>
<xsl:param name="autotoc.label.separator">. </xsl:param>
<xsl:param name="base.dir"/>
<xsl:param name="biblioentry.item.separator">. </xsl:param>
<xsl:param name="bibliography.collection">http://docbook.sourceforge.net/release/bibliography/bibliography.xml</xsl:param>
<xsl:param name="bibliography.numbered" select="0"/>
<xsl:param name="bibliography.style">normal</xsl:param>
<xsl:param name="blurb.on.titlepage.enabled" select="0"/>
<xsl:param name="bridgehead.in.toc" select="0"/>
<xsl:param name="callout.defaultcolumn">60</xsl:param>
<xsl:param name="callout.graphics.extension">.png</xsl:param>
<xsl:param name="callout.graphics" select="1"/>
<xsl:param name="callout.graphics.number.limit">15</xsl:param>
<xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
<xsl:param name="callout.list.table" select="1"/>
<xsl:param name="callout.unicode" select="0"/>
<xsl:param name="callout.unicode.number.limit">10</xsl:param>
<xsl:param name="callout.unicode.start.character">10102</xsl:param>
<xsl:param name="callouts.extension" select="1"/>
<xsl:param name="chapter.autolabel" select="1"/>
<xsl:param name="chunk.append"/>
<xsl:param name="chunk.first.sections" select="0"/>
<xsl:param name="chunk.quietly" select="0"/>
<xsl:param name="chunk.section.depth" select="1"/>
<xsl:param name="chunk.separate.lots" select="0"/>
<xsl:param name="chunk.toc"/>
<xsl:param name="chunk.tocs.and.lots" select="0"/>
<xsl:param name="chunk.tocs.and.lots.has.title" select="1"/>
<xsl:param name="chunked.filename.prefix"/>
<xsl:param name="citerefentry.link" select="0"/>
<xsl:param name="collect.xref.targets">no</xsl:param>
<xsl:param name="component.label.includes.part.label" select="0"/>
<xsl:param name="contrib.inline.enabled">1</xsl:param>
<xsl:param name="css.decoration" select="1"/>
<xsl:param name="current.docid"/>
<xsl:param name="custom.css.source"/>
<xsl:param name="default.float.class">
<xsl:choose>
<xsl:when test="contains($stylesheet.result.type,'html')">left</xsl:when>
<xsl:otherwise>before</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="default.image.width"/>
<xsl:param name="default.table.frame">all</xsl:param>
<xsl:param name="default.table.width"/>
<xsl:param name="docbook.css.link" select="1"/>
<xsl:param name="docbook.css.source">docbook.css.xml</xsl:param>
<xsl:param name="draft.mode">no</xsl:param>
<xsl:param name="draft.watermark.image">images/draft.png</xsl:param>
<xsl:param name="ebnf.assignment">
<code>::=</code>
</xsl:param>
<xsl:param name="ebnf.statement.terminator"/>
<xsl:param name="ebnf.table.bgcolor">#F5DCB3</xsl:param>
<xsl:param name="ebnf.table.border" select="1"/>
<xsl:param name="eclipse.autolabel" select="0"/>
<xsl:param name="eclipse.plugin.id">com.example.help</xsl:param>
<xsl:param name="eclipse.plugin.name">DocBook Online Help Sample</xsl:param>
<xsl:param name="eclipse.plugin.provider">Example provider</xsl:param>
<xsl:param name="editedby.enabled">1</xsl:param>
<xsl:param name="email.delimiters.enabled" select="1"/>
<xsl:param name="emphasis.propagates.style" select="1"/>
<xsl:param name="entry.propagates.style" select="1"/>
<xsl:param name="exsl.node.set.available">
<xsl:choose>
<xsl:when xmlns:exsl="http://exslt.org/common" exsl:foo="" test="function-available('exsl:node-set') or contains(system-property('xsl:vendor'), 'Apache Software Foundation')">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="firstterm.only.link" select="0"/>
<xsl:param name="footer.rule" select="1"/>
<xsl:param name="footnote.number.format">1</xsl:param>
<xsl:param name="footnote.number.symbols"/>
<xsl:param name="formal.procedures" select="1"/>
<xsl:param name="formal.title.placement">
figure before
example before
equation before
table before
procedure before
task before
</xsl:param>
<xsl:param name="funcsynopsis.decoration" select="1"/>
<xsl:param name="funcsynopsis.style">kr</xsl:param>
<xsl:param name="function.parens" select="0"/>
<xsl:param name="generate.consistent.ids" select="0"/>
<xsl:param name="generate.css.header" select="0"/>
<xsl:param name="generate.id.attributes" select="0"/>
<xsl:param name="generate.index" select="1"/>
<xsl:param name="generate.legalnotice.link" select="0"/>
<xsl:param name="generate.manifest" select="0"/>
<xsl:param name="generate.meta.abstract" select="1"/>
<xsl:param name="generate.revhistory.link" select="0"/>
<xsl:param name="generate.section.toc.level" select="0"/>
<xsl:param name="generate.toc">
appendix toc,title
article/appendix nop
article toc,title
book toc,title,figure,table,example,equation
chapter toc,title
part toc,title
preface toc,title
qandadiv toc
qandaset toc
reference toc,title
sect1 toc
sect2 toc
sect3 toc
sect4 toc
sect5 toc
section toc
set toc,title
</xsl:param>
<xsl:param name="glossary.collection"/>
<xsl:param name="glossary.sort" select="0"/>
<xsl:param name="glossentry.show.acronym">no</xsl:param>
<xsl:param name="glossterm.auto.link" select="0"/>
<xsl:param name="graphic.default.extension"/>
<xsl:param name="graphicsize.extension" select="1"/>
<xsl:param name="graphicsize.use.img.src.path" select="0"/>
<xsl:param name="header.rule" select="1"/>
<xsl:param name="highlight.default.language"/>
<xsl:param name="highlight.source" select="0"/>
<xsl:param name="highlight.xslthl.config"/>
<xsl:param name="html.append"/>
<xsl:param name="html.base"/>
<xsl:param name="html.cellpadding"/>
<xsl:param name="html.cellspacing"/>
<xsl:param name="html.cleanup" select="1"/>
<xsl:param name="html.ext">.html</xsl:param>
<xsl:param name="html.extra.head.links" select="0"/>
<xsl:param name="html.head.legalnotice.link.multiple" select="1"/>
<xsl:param name="html.head.legalnotice.link.types">copyright</xsl:param>
<xsl:param name="html.longdesc" select="1"/>
<xsl:param name="html.longdesc.link" select="$html.longdesc"/>
<xsl:param name="html.script"/>
<xsl:param name="html.script.type">text/javascript</xsl:param>
<xsl:param name="html.stylesheet"/>
<xsl:param name="html.stylesheet.type">text/css</xsl:param>
<xsl:param name="htmlhelp.alias.file">alias.h</xsl:param>
<xsl:param name="htmlhelp.autolabel" select="0"/>
<xsl:param name="htmlhelp.button.back" select="1"/>
<xsl:param name="htmlhelp.button.forward" select="0"/>
<xsl:param name="htmlhelp.button.hideshow" select="1"/>
<xsl:param name="htmlhelp.button.home" select="0"/>
<xsl:param name="htmlhelp.button.home.url"/>
<xsl:param name="htmlhelp.button.jump1" select="0"/>
<xsl:param name="htmlhelp.button.jump1.title">User1</xsl:param>
<xsl:param name="htmlhelp.button.jump1.url"/>
<xsl:param name="htmlhelp.button.jump2" select="0"/>
<xsl:param name="htmlhelp.button.jump2.title">User2</xsl:param>
<xsl:param name="htmlhelp.button.jump2.url"/>
<xsl:param name="htmlhelp.button.locate" select="0"/>
<xsl:param name="htmlhelp.button.next" select="1"/>
<xsl:param name="htmlhelp.button.options" select="1"/>
<xsl:param name="htmlhelp.button.prev" select="1"/>
<xsl:param name="htmlhelp.button.print" select="1"/>
<xsl:param name="htmlhelp.button.refresh" select="0"/>
<xsl:param name="htmlhelp.button.stop" select="0"/>
<xsl:param name="htmlhelp.button.zoom" select="0"/>
<xsl:param name="htmlhelp.chm">htmlhelp.chm</xsl:param>
<xsl:param name="htmlhelp.default.topic"/>
<xsl:param name="htmlhelp.display.progress" select="1"/>
<xsl:param name="htmlhelp.encoding">iso-8859-1</xsl:param>
<xsl:param name="htmlhelp.enhanced.decompilation" select="0"/>
<xsl:param name="htmlhelp.enumerate.images" select="0"/>
<xsl:param name="htmlhelp.force.map.and.alias" select="0"/>
<xsl:param name="htmlhelp.hhc.binary" select="1"/>
<xsl:param name="htmlhelp.hhc.folders.instead.books" select="1"/>
<xsl:param name="htmlhelp.hhc">toc.hhc</xsl:param>
<xsl:param name="htmlhelp.hhc.section.depth">5</xsl:param>
<xsl:param name="htmlhelp.hhc.show.root" select="1"/>
<xsl:param name="htmlhelp.hhc.width"/>
<xsl:param name="htmlhelp.hhk">index.hhk</xsl:param>
<xsl:param name="htmlhelp.hhp">htmlhelp.hhp</xsl:param>
<xsl:param name="htmlhelp.hhp.tail"/>
<xsl:param name="htmlhelp.hhp.window">Main</xsl:param>
<xsl:param name="htmlhelp.hhp.windows"/>
<xsl:param name="htmlhelp.map.file">context.h</xsl:param>
<xsl:param name="htmlhelp.only" select="0"/>
<xsl:param name="htmlhelp.remember.window.position" select="0"/>
<xsl:param name="htmlhelp.show.advanced.search" select="0"/>
<xsl:param name="htmlhelp.show.favorities" select="0"/>
<xsl:param name="htmlhelp.show.menu" select="0"/>
<xsl:param name="htmlhelp.show.toolbar.text" select="1"/>
<xsl:param name="htmlhelp.title"/>
<xsl:param name="htmlhelp.use.hhk" select="0"/>
<xsl:param name="htmlhelp.window.geometry"/>
<xsl:param name="id.warnings" select="0"/>
<xsl:param name="ignore.image.scaling" select="0"/>
<xsl:param name="img.src.path"/>
<xsl:param name="index.links.to.section" select="1"/>
<xsl:param name="index.method">basic</xsl:param>
<xsl:param name="index.number.separator"/>
<xsl:param name="index.on.role" select="0"/>
<xsl:param name="index.on.type" select="0"/>
<xsl:param name="index.prefer.titleabbrev" select="0"/>
<xsl:param name="index.range.separator"/>
<xsl:param name="index.term.separator"/>
<xsl:param name="inherit.keywords" select="1"/>
<xsl:param name="insert.olink.page.number">no</xsl:param>
<xsl:param name="insert.olink.pdf.frag" select="0"/>
<xsl:param name="insert.xref.page.number">no</xsl:param>
<xsl:param name="javahelp.encoding">iso-8859-1</xsl:param>
<xsl:param name="keep.relative.image.uris" select="1"/>
<xsl:param name="l10n.gentext.default.language">en</xsl:param>
<xsl:param name="l10n.gentext.language"/>
<xsl:param name="l10n.gentext.use.xref.language" select="0"/>
<xsl:param name="l10n.lang.value.rfc.compliant" select="1"/>
<xsl:param name="label.from.part" select="0"/>
<xsl:param name="linenumbering.everyNth">5</xsl:param>
<xsl:param name="linenumbering.extension" select="1"/>
<xsl:param name="linenumbering.separator"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="linenumbering.width">3</xsl:param>
<xsl:param name="link.mailto.url"/>
<xsl:param name="make.clean.html" select="0"/>
<xsl:param name="make.graphic.viewport" select="1"/>
<xsl:param name="make.single.year.ranges" select="0"/>
<xsl:param name="make.valid.html" select="0"/>
<xsl:param name="make.year.ranges" select="0"/>
<xsl:param name="manifest">HTML.manifest</xsl:param>
<xsl:param name="manifest.in.base.dir" select="0"/>
<xsl:param name="manual.toc"/>
<xsl:param name="menuchoice.menu.separator"></xsl:param>
<xsl:param name="menuchoice.separator">+</xsl:param>
<xsl:param name="navig.graphics.extension">.gif</xsl:param>
<xsl:param name="navig.graphics" select="0"/>
<xsl:param name="navig.graphics.path">images/</xsl:param>
<xsl:param name="navig.showtitles">1</xsl:param>
<xsl:param name="nominal.image.depth" select="4 * $pixels.per.inch"/>
<xsl:param name="nominal.image.width" select="6 * $pixels.per.inch"/>
<xsl:param name="nominal.table.width">6in</xsl:param>
<xsl:param name="olink.base.uri"/>
<xsl:param name="olink.debug" select="0"/>
<xsl:param name="olink.doctitle">no</xsl:param>
<xsl:param name="olink.fragid">fragid=</xsl:param>
<xsl:param name="olink.lang.fallback.sequence"/>
<xsl:param name="olink.outline.ext">.olink</xsl:param>
<xsl:attribute-set name="olink.properties">
<xsl:attribute name="show-destination">replace</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="olink.pubid">pubid</xsl:param>
<xsl:param name="olink.resolver">/cgi-bin/olink</xsl:param>
<xsl:param name="olink.sysid">sysid</xsl:param>
<xsl:param name="othercredit.like.author.enabled">0</xsl:param>
<xsl:param name="para.propagates.style" select="1"/>
<xsl:param name="part.autolabel">I</xsl:param>
<xsl:param name="phrase.propagates.style" select="1"/>
<xsl:param name="pixels.per.inch">90</xsl:param>
<xsl:param name="points.per.em">10</xsl:param>
<xsl:param name="preface.autolabel" select="0"/>
<xsl:param name="prefer.internal.olink" select="0"/>
<xsl:param name="preferred.mediaobject.role"/>
<xsl:param name="process.empty.source.toc" select="0"/>
<xsl:param name="process.source.toc" select="0"/>
<xsl:param name="profile.arch"/>
<xsl:param name="profile.attribute"/>
<xsl:param name="profile.audience"/>
<xsl:param name="profile.condition"/>
<xsl:param name="profile.conformance"/>
<xsl:param name="profile.lang"/>
<xsl:param name="profile.os"/>
<xsl:param name="profile.revision"/>
<xsl:param name="profile.revisionflag"/>
<xsl:param name="profile.role"/>
<xsl:param name="profile.security"/>
<xsl:param name="profile.separator">;</xsl:param>
<xsl:param name="profile.status"/>
<xsl:param name="profile.userlevel"/>
<xsl:param name="profile.value"/>
<xsl:param name="profile.vendor"/>
<xsl:param name="profile.wordsize"/>
<xsl:param name="punct.honorific">.</xsl:param>
<xsl:param name="qanda.defaultlabel">number</xsl:param>
<xsl:param name="qanda.in.toc" select="0"/>
<xsl:param name="qanda.inherit.numeration" select="1"/>
<xsl:param name="qanda.nested.in.toc" select="0"/>
<xsl:param name="qandadiv.autolabel" select="1"/>
<xsl:param name="refclass.suppress" select="0"/>
<xsl:param name="refentry.generate.name" select="1"/>
<xsl:param name="refentry.generate.title" select="0"/>
<xsl:param name="refentry.separator" select="1"/>
<xsl:param name="refentry.xref.manvolnum" select="1"/>
<xsl:param name="reference.autolabel">I</xsl:param>
<xsl:param name="root.filename">index</xsl:param>
<xsl:param name="rootid"/>
<xsl:param name="runinhead.default.title.end.punct">.</xsl:param>
<xsl:param name="runinhead.title.end.punct">.!?:</xsl:param>
<xsl:param name="section.autolabel" select="0"/>
<xsl:param name="section.autolabel.max.depth">8</xsl:param>
<xsl:param name="section.label.includes.component.label" select="0"/>
<xsl:param name="segmentedlist.as.table" select="0"/>
<xsl:param name="shade.verbatim" select="0"/>
<xsl:attribute-set name="shade.verbatim.style">
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="bgcolor">#E0E0E0</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="show.comments" select="1"/>
<xsl:param name="show.revisionflag" select="0"/>
<xsl:param name="simplesect.in.toc" select="0"/>
<xsl:param name="spacing.paras" select="0"/>
<xsl:param name="suppress.footer.navigation">0</xsl:param>
<xsl:param name="suppress.header.navigation" select="0"/>
<xsl:param name="suppress.navigation" select="0"/>
<xsl:param name="table.borders.with.css" select="0"/>
<xsl:param name="table.cell.border.color"/>
<xsl:param name="table.cell.border.style">solid</xsl:param>
<xsl:param name="table.cell.border.thickness">0.5pt</xsl:param>
<xsl:param name="table.footnote.number.format">a</xsl:param>
<xsl:param name="table.footnote.number.symbols"/>
<xsl:param name="table.frame.border.color"/>
<xsl:param name="table.frame.border.style">solid</xsl:param>
<xsl:param name="table.frame.border.thickness">0.5pt</xsl:param>
<xsl:param name="tablecolumns.extension" select="1"/>
<xsl:param name="target.database.document">olinkdb.xml</xsl:param>
<xsl:param name="targets.filename">target.db</xsl:param>
<xsl:param name="tex.math.delims" select="1"/>
<xsl:param name="tex.math.file">tex-math-equations.tex</xsl:param>
<xsl:param name="tex.math.in.alt"/>
<xsl:param name="textdata.default.encoding"/>
<xsl:param name="textinsert.extension" select="1"/>
<xsl:param name="toc.list.type">dl</xsl:param>
<xsl:param name="toc.max.depth">8</xsl:param>
<xsl:param name="toc.section.depth">2</xsl:param>
<xsl:param name="ulink.target">_top</xsl:param>
<xsl:param name="use.embed.for.svg" select="0"/>
<xsl:param name="use.extensions" select="0"/>
<xsl:param name="use.id.as.filename" select="0"/>
<xsl:param name="use.local.olink.style" select="0"/>
<xsl:param name="use.role.as.xrefstyle" select="1"/>
<xsl:param name="use.role.for.mediaobject" select="1"/>
<xsl:param name="use.svg" select="1"/>
<xsl:param name="variablelist.as.table" select="0"/>
<xsl:param name="variablelist.term.break.after">0</xsl:param>
<xsl:param name="variablelist.term.separator">, </xsl:param>
<xsl:param name="webhelp.autolabel">0</xsl:param>
<xsl:param name="webhelp.base.dir">docs</xsl:param>
<xsl:param name="webhelp.common.dir">../common/</xsl:param>
<xsl:param name="webhelp.default.topic">index.html</xsl:param>
<xsl:param name="webhelp.include.search.tab">true</xsl:param>
<xsl:param name="webhelp.indexer.language">en</xsl:param>
<xsl:param name="webhelp.start.filename">index.html</xsl:param>
<xsl:param name="webhelp.tree.cookie.id" select="concat( 'treeview-', count(//node()) )"/>
<xsl:param name="writing.mode">
<xsl:call-template name="gentext">
<xsl:with-param name="key">writing-mode</xsl:with-param>
<xsl:with-param name="lang">
<xsl:call-template name="l10n.language">
<xsl:with-param name="target" select="/*[1]"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<xsl:param name="xref.label-page.separator"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="xref.label-title.separator">: </xsl:param>
<xsl:param name="xref.title-page.separator"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="xref.with.number.and.title" select="1"/>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@ -1,456 +0,0 @@
<?xml version='1.0'?>
<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'>
<!-- ********************************************************************
$Id: qandaset.xsl 9354 2012-05-12 23:29:36Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="qandaset">
<xsl:variable name="title" select="(blockinfo/title|info/title|title)[1]"/>
<xsl:variable name="preamble" select="*[local-name(.) != 'title'
and local-name(.) != 'titleabbrev'
and local-name(.) != 'qandadiv'
and local-name(.) != 'qandaentry']"/>
<xsl:variable name="toc">
<xsl:call-template name="pi.dbhtml_toc"/>
</xsl:variable>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates select="$title"/>
<xsl:if test="not($title)">
<!-- andhor is output on title if there is one -->
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="((contains($toc.params, 'toc') and $toc != '0') or $toc = '1')
and not(ancestor::answer and not($qanda.nested.in.toc=0))">
<xsl:call-template name="process.qanda.toc"/>
</xsl:if>
<xsl:apply-templates select="$preamble"/>
<xsl:call-template name="process.qandaset"/>
</div>
</xsl:template>
<xsl:template match="qandaset/blockinfo/title|
qandaset/info/title|
qandaset/title">
<xsl:variable name="qalevel">
<xsl:call-template name="qanda.section.level"/>
</xsl:variable>
<xsl:element name="h{string(number($qalevel)+1)}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="anchor">
<xsl:with-param name="node" select=".."/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="qandaset/blockinfo|qandaset/info">
<!-- what should this template really do? -->
<xsl:apply-templates select="legalnotice" mode="titlepage.mode"/>
</xsl:template>
<xsl:template match="qandadiv">
<xsl:variable name="preamble" select="*[local-name(.) != 'title'
and local-name(.) != 'titleabbrev'
and local-name(.) != 'qandadiv'
and local-name(.) != 'qandaentry']"/>
<xsl:if test="blockinfo/title|info/title|title">
<tr class="qandadiv">
<td align="{$direction.align.start}" valign="top" colspan="2">
<xsl:apply-templates select="(blockinfo/title|info/title|title)[1]"/>
</td>
</tr>
</xsl:if>
<xsl:variable name="toc">
<xsl:call-template name="pi.dbhtml_toc"/>
</xsl:variable>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'">
<tr class="toc">
<td align="{$direction.align.start}" valign="top" colspan="2">
<xsl:call-template name="process.qanda.toc"/>
</td>
</tr>
</xsl:if>
<xsl:if test="$preamble">
<tr class="toc">
<td align="{$direction.align.start}" valign="top" colspan="2">
<xsl:apply-templates select="$preamble"/>
</td>
</tr>
</xsl:if>
<xsl:apply-templates select="qandadiv|qandaentry"/>
</xsl:template>
<xsl:template match="qandadiv/blockinfo/title|
qandadiv/info/title|
qandadiv/title">
<xsl:variable name="qalevel">
<xsl:call-template name="qandadiv.section.level"/>
</xsl:variable>
<xsl:element name="h{string(number($qalevel)+1)}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="id.attribute">
<xsl:with-param name="node" select=".."/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="node" select=".."/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
<xsl:if test="$qandadiv.autolabel != 0">
<xsl:apply-templates select="." mode="intralabel.punctuation"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="qandaentry">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="question">
<xsl:variable name="deflabel">
<xsl:apply-templates select="." mode="qanda.defaultlabel"/>
</xsl:variable>
<tr>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<!-- capture the id of the quandaentry -->
<xsl:call-template name="id.attribute">
<xsl:with-param name="node" select=".."/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<td align="{$direction.align.start}" valign="top">
<!-- and the id of the question too -->
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="node" select=".."/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:variable name="label.content">
<xsl:apply-templates select="." mode="qanda.label"/>
</xsl:variable>
<xsl:if test="string-length($label.content) &gt; 0">
<p><b>
<xsl:copy-of select="$label.content"/>
</b></p>
</xsl:if>
</td>
<td align="{$direction.align.start}" valign="top">
<xsl:choose>
<xsl:when test="$deflabel = 'none' and not(label)">
<b><xsl:apply-templates select="*[local-name(.) != 'label']"/></b>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[local-name(.) != 'label']"/>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<xsl:template match="*" mode="qanda.defaultlabel">
<xsl:choose>
<xsl:when test="ancestor-or-self::*[@defaultlabel]">
<xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
/@defaultlabel"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$qanda.defaultlabel"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="question" mode="qanda.label">
<xsl:variable name="deflabel">
<xsl:apply-templates select="." mode="qanda.defaultlabel"/>
</xsl:variable>
<xsl:apply-templates select="." mode="label.markup"/>
<xsl:if test="contains($deflabel, 'number') and not(label)">
<xsl:apply-templates select="." mode="intralabel.punctuation"/>
</xsl:if>
</xsl:template>
<xsl:template match="answer">
<xsl:variable name="deflabel">
<xsl:apply-templates select="." mode="qanda.defaultlabel"/>
</xsl:variable>
<tr>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<td align="{$direction.align.start}" valign="top">
<xsl:call-template name="anchor"/>
<xsl:variable name="answer.label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
<xsl:if test="string-length($answer.label) &gt; 0">
<p><b>
<xsl:copy-of select="$answer.label"/>
</b></p>
</xsl:if>
</td>
<td align="{$direction.align.start}" valign="top">
<xsl:apply-templates select="*[local-name(.) != 'label'
and local-name(.) != 'qandaentry']"/>
<!-- * handle nested answer/qandaentry instances -->
<!-- * (bug 1509043 from Daniel Leidert) -->
<xsl:if test="descendant::question">
<xsl:call-template name="process.qandaset"/>
</xsl:if>
</td>
</tr>
</xsl:template>
<xsl:template match="answer" mode="qanda.label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:template>
<xsl:template match="label">
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="process.qanda.toc">
<!-- * if user wants nested qandaset and qandaentry in main Qandaset TOC, -->
<!-- * then don't also include the nested stuff in the sub TOCs -->
<dl>
<xsl:apply-templates select="qandadiv" mode="qandatoc.mode"/>
<xsl:apply-templates select="qandaset|qandaentry" mode="qandatoc.mode"/>
</dl>
</xsl:template>
<xsl:template match="qandadiv" mode="qandatoc.mode">
<dt><xsl:apply-templates select="title" mode="qandatoc.mode"/></dt>
<dd><xsl:call-template name="process.qanda.toc"/></dd>
</xsl:template>
<xsl:template match="qandadiv/blockinfo/title|
qandadiv/info/title|
qandadiv/title" mode="qandatoc.mode">
<xsl:variable name="qalevel">
<xsl:call-template name="qandadiv.section.level"/>
</xsl:variable>
<xsl:variable name="id">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="parent::*"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="div.label">
<xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
</xsl:variable>
<xsl:if test="string-length($div.label) != 0">
<xsl:copy-of select="$div.label"/>
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
<xsl:text> </xsl:text>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="parent::*"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="qandaset" mode="qandatoc.mode">
<xsl:for-each select="qandaentry">
<xsl:apply-templates select="." mode="qandatoc.mode"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="qandaentry" mode="qandatoc.mode">
<xsl:apply-templates select="question" mode="qandatoc.mode"/>
</xsl:template>
<xsl:template match="question" mode="qandatoc.mode">
<xsl:variable name="firstch">
<!-- Use a titleabbrev or title if available -->
<xsl:choose>
<xsl:when test="../blockinfo/titleabbrev">
<xsl:apply-templates select="../blockinfo/titleabbrev[1]/node()"/>
</xsl:when>
<xsl:when test="../blockinfo/title">
<xsl:apply-templates select="../blockinfo/title[1]/node()"/>
</xsl:when>
<xsl:when test="../info/titleabbrev">
<xsl:apply-templates select="../info/titleabbrev[1]/node()"/>
</xsl:when>
<xsl:when test="../titleabbrev">
<xsl:apply-templates select="../titleabbrev[1]/node()"/>
</xsl:when>
<xsl:when test="../info/title">
<xsl:apply-templates select="../info/title[1]/node()"/>
</xsl:when>
<xsl:when test="../title">
<xsl:apply-templates select="../title[1]/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="(*[local-name(.)!='label'])[1]/node()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="deflabel">
<xsl:choose>
<xsl:when test="ancestor-or-self::*[@defaultlabel]">
<xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
/@defaultlabel"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$qanda.defaultlabel"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<dt>
<xsl:apply-templates select="." mode="label.markup"/>
<xsl:if test="contains($deflabel,'number') and not(label)">
<xsl:apply-templates select="." mode="intralabel.punctuation"/>
</xsl:if>
<xsl:text> </xsl:text>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select=".."/>
</xsl:call-template>
</xsl:attribute>
<xsl:value-of select="$firstch"/>
</a>
</dt>
<!-- * include nested qandaset/qandaentry in TOC if user wants it -->
<xsl:if test="not($qanda.nested.in.toc = 0)">
<xsl:apply-templates select="following-sibling::answer" mode="qandatoc.mode"/>
</xsl:if>
</xsl:template>
<xsl:template match="answer" mode="qandatoc.mode">
<xsl:if test="descendant::question">
<dd>
<xsl:call-template name="process.qanda.toc"/>
</dd>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="process.qandaset">
<xsl:variable name="deflabel">
<xsl:apply-templates select="." mode="qanda.defaultlabel"/>
</xsl:variable>
<xsl:variable name="label-width">
<xsl:call-template name="pi.dbhtml_label-width"/>
</xsl:variable>
<xsl:variable name="table-summary">
<xsl:call-template name="pi.dbhtml_table-summary"/>
</xsl:variable>
<xsl:variable name="cellpadding">
<xsl:call-template name="pi.dbhtml_cellpadding"/>
</xsl:variable>
<xsl:variable name="cellspacing">
<xsl:call-template name="pi.dbhtml_cellspacing"/>
</xsl:variable>
<table border="{$table.border.off}">
<xsl:if test="$css.decoration != 0">
<xsl:attribute name="style">width: 100%;</xsl:attribute>
</xsl:if>
<xsl:if test="$table-summary != ''">
<xsl:attribute name="summary">
<xsl:value-of select="$table-summary"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$cellpadding != ''">
<xsl:attribute name="cellpadding">
<xsl:value-of select="$cellpadding"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$cellspacing != ''">
<xsl:attribute name="cellspacing">
<xsl:value-of select="$cellspacing"/>
</xsl:attribute>
</xsl:if>
<colgroup>
<col align="{$direction.align.start}">
<xsl:attribute name="width">
<xsl:choose>
<xsl:when test="$label-width != ''">
<xsl:value-of select="$label-width"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>1%</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</col>
<col/>
</colgroup>
<tbody>
<xsl:apply-templates select="qandaentry|qandadiv"/>
</tbody>
</table>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="*" mode="no.wrapper.mode">
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@ -1,305 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: refentry.xsl 9297 2012-04-22 03:56:16Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="reference">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="reference.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not(partintro) and contains($toc.params, 'toc')">
<xsl:call-template name="division.toc"/>
</xsl:if>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="reference" mode="division.number">
<xsl:number from="book" count="reference" format="I."/>
</xsl:template>
<xsl:template match="reference/docinfo"></xsl:template>
<xsl:template match="reference/referenceinfo"></xsl:template>
<xsl:template match="reference/title"></xsl:template>
<xsl:template match="reference/subtitle"></xsl:template>
<xsl:template match="reference/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template name="refentry.title">
<xsl:param name="node" select="."/>
<xsl:variable name="refmeta" select="$node//refmeta"/>
<xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
<xsl:variable name="refnamediv" select="$node//refnamediv"/>
<xsl:variable name="refname" select="$refnamediv//refname"/>
<xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="$refentrytitle">
<xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
</xsl:when>
<xsl:when test="$refdesc">
<xsl:apply-templates select="$refdesc[1]" mode="title"/>
</xsl:when>
<xsl:when test="$refname">
<xsl:apply-templates select="$refname[1]" mode="title"/>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<h1 class="title">
<xsl:copy-of select="$title"/>
</h1>
</xsl:template>
<xsl:template match="refentry">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:if test="$refentry.separator != 0 and preceding-sibling::refentry">
<div class="refentry.separator">
<hr/>
</div>
</xsl:if>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="refentry.titlepage"/>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="refentry/docinfo|refentry/refentryinfo"></xsl:template>
<xsl:template match="refentry/info"></xsl:template>
<xsl:template match="refentrytitle|refname|refdescriptor" mode="title">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="refmeta">
</xsl:template>
<xsl:template match="manvolnum">
<xsl:if test="$refentry.xref.manvolnum != 0">
<xsl:text>(</xsl:text>
<xsl:apply-templates/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="refmiscinfo">
</xsl:template>
<xsl:template match="refentrytitle">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
<xsl:template match="refnamediv">
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor"/>
<xsl:choose>
<xsl:when test="preceding-sibling::refnamediv">
<!-- no title on secondary refnamedivs! -->
</xsl:when>
<xsl:when test="$refentry.generate.name != 0">
<h2>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'RefName'"/>
</xsl:call-template>
</h2>
</xsl:when>
<xsl:when test="$refentry.generate.title != 0">
<h2>
<xsl:choose>
<xsl:when test="../refmeta/refentrytitle">
<xsl:apply-templates select="../refmeta/refentrytitle"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="refname[1]"/>
</xsl:otherwise>
</xsl:choose>
</h2>
</xsl:when>
</xsl:choose>
<p>
<xsl:apply-templates/>
</p>
</div>
</xsl:template>
<xsl:template match="refname">
<xsl:if test="not(preceding-sibling::refdescriptor)">
<xsl:apply-templates/>
<xsl:if test="following-sibling::refname">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="refpurpose">
<xsl:if test="node()">
<xsl:text> </xsl:text>
<xsl:call-template name="dingbat">
<xsl:with-param name="dingbat">em-dash</xsl:with-param>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<xsl:template match="refdescriptor">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="refclass">
<xsl:if test="$refclass.suppress = 0">
<b>
<xsl:if test="@role">
<xsl:value-of select="@role"/>
<xsl:text>: </xsl:text>
</xsl:if>
<xsl:apply-templates/>
</b>
</xsl:if>
</xsl:template>
<xsl:template match="refsynopsisdiv">
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor"/>
<h2>
<xsl:choose>
<xsl:when test="refsynopsisdiv/title|title">
<xsl:apply-templates select="(refsynopsisdiv/title|title)[1]"
mode="titlepage.mode"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'RefSynopsisDiv'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</h2>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="refsynopsisdivinfo"></xsl:template>
<xsl:template match="refsynopsisdiv/title">
</xsl:template>
<xsl:template match="refsynopsisdiv/title" mode="titlepage.mode">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="refsection|refsect1|refsect2|refsect3">
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<!-- pick up info title -->
<xsl:apply-templates select="(title|info/title)[1]"/>
<xsl:apply-templates select="node()[not(self::title) and not(self::info)]"/>
</div>
</xsl:template>
<xsl:template match="refsection/title|refsection/info/title">
<!-- the ID is output in the block.object call for refsect1 -->
<xsl:variable name="level" select="count(ancestor-or-self::refsection)"/>
<xsl:variable name="refsynopsisdiv">
<xsl:text>0</xsl:text>
<xsl:if test="ancestor::refsynopsisdiv">1</xsl:if>
</xsl:variable>
<xsl:variable name="hlevel">
<xsl:choose>
<xsl:when test="$level+$refsynopsisdiv &gt; 5">6</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$level+1+$refsynopsisdiv"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="h{$hlevel}">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="refsect1/title|refsect1/info/title">
<!-- the ID is output in the block.object call for refsect1 -->
<h2>
<xsl:apply-templates/>
</h2>
</xsl:template>
<xsl:template match="refsect2/title|refsect2/info/title">
<!-- the ID is output in the block.object call for refsect2 -->
<h3>
<xsl:apply-templates/>
</h3>
</xsl:template>
<xsl:template match="refsect3/title|refsect3/info/title">
<!-- the ID is output in the block.object call for refsect3 -->
<h4>
<xsl:apply-templates/>
</h4>
</xsl:template>
<xsl:template match="refsectioninfo|refsection/info"></xsl:template>
<xsl:template match="refsect1info|refsect1/info"></xsl:template>
<xsl:template match="refsect2info|refsect2/info"></xsl:template>
<xsl:template match="refsect3info|refsect3/info"></xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@ -1,636 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: sections.xsl 9392 2012-06-02 20:10:58Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="section">
<xsl:variable name="depth" select="count(ancestor::section)+1"/>
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="section.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $depth &lt;= $generate.section.toc.level">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</xsl:element>
</xsl:template>
<xsl:template name="section.title">
<!-- the context node should be the title of a section when called -->
<xsl:variable name="section" select="(ancestor::section
|ancestor::simplesect
|ancestor::sect1
|ancestor::sect2
|ancestor::sect3
|ancestor::sect4
|ancestor::sect5)[last()]"/>
<xsl:variable name="renderas">
<xsl:choose>
<xsl:when test="$section/@renderas = 'sect1'">1</xsl:when>
<xsl:when test="$section/@renderas = 'sect2'">2</xsl:when>
<xsl:when test="$section/@renderas = 'sect3'">3</xsl:when>
<xsl:when test="$section/@renderas = 'sect4'">4</xsl:when>
<xsl:when test="$section/@renderas = 'sect5'">5</xsl:when>
<xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="level">
<xsl:choose>
<xsl:when test="$renderas != ''">
<xsl:value-of select="$renderas"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="section.level">
<xsl:with-param name="node" select="$section"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="section.heading">
<xsl:with-param name="section" select="$section"/>
<xsl:with-param name="level" select="$level"/>
<xsl:with-param name="title">
<xsl:apply-templates select="$section" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="section/title
|section/info/title
|sectioninfo/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="sect1">
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="@renderas = 'sect2'">
<xsl:call-template name="sect2.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect3'">
<xsl:call-template name="sect3.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect4'">
<xsl:call-template name="sect4.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect5'">
<xsl:call-template name="sect5.titlepage"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="sect1.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $generate.section.toc.level &gt;= 1">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</xsl:element>
</xsl:template>
<xsl:template match="sect1/title
|sect1/info/title
|sect1info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="sect2">
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">
<xsl:call-template name="sect1.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect3'">
<xsl:call-template name="sect3.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect4'">
<xsl:call-template name="sect4.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect5'">
<xsl:call-template name="sect5.titlepage"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="sect2.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $generate.section.toc.level &gt;= 2">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</xsl:element>
</xsl:template>
<xsl:template match="sect2/title
|sect2/info/title
|sect2info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="sect3">
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">
<xsl:call-template name="sect1.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect2'">
<xsl:call-template name="sect2.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect4'">
<xsl:call-template name="sect4.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect5'">
<xsl:call-template name="sect5.titlepage"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="sect3.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $generate.section.toc.level &gt;= 3">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</xsl:element>
</xsl:template>
<xsl:template match="sect3/title
|sect3/info/title
|sect3info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="sect4">
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">
<xsl:call-template name="sect1.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect2'">
<xsl:call-template name="sect2.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect3'">
<xsl:call-template name="sect3.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect5'">
<xsl:call-template name="sect5.titlepage"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="sect4.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $generate.section.toc.level &gt;= 4">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</xsl:element>
</xsl:template>
<xsl:template match="sect4/title
|sect4/info/title
|sect4info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="sect5">
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">
<xsl:call-template name="sect1.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect2'">
<xsl:call-template name="sect2.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect3'">
<xsl:call-template name="sect3.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect4'">
<xsl:call-template name="sect4.titlepage"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="sect5.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $generate.section.toc.level &gt;= 5">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</xsl:element>
</xsl:template>
<xsl:template match="sect5/title
|sect5/info/title
|sect5info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="simplesect">
<xsl:call-template name="id.warning"/>
<xsl:element name="{$div.element}">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="simplesect.titlepage"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="simplesect/title|simplesect/info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="section/title"></xsl:template>
<xsl:template match="section/titleabbrev"></xsl:template>
<xsl:template match="section/subtitle"></xsl:template>
<xsl:template match="sectioninfo"></xsl:template>
<xsl:template match="section/info"></xsl:template>
<xsl:template match="sect1/title"></xsl:template>
<xsl:template match="sect1/titleabbrev"></xsl:template>
<xsl:template match="sect1/subtitle"></xsl:template>
<xsl:template match="sect1info"></xsl:template>
<xsl:template match="sect1/info"></xsl:template>
<xsl:template match="sect2/title"></xsl:template>
<xsl:template match="sect2/subtitle"></xsl:template>
<xsl:template match="sect2/titleabbrev"></xsl:template>
<xsl:template match="sect2info"></xsl:template>
<xsl:template match="sect2/info"></xsl:template>
<xsl:template match="sect3/title"></xsl:template>
<xsl:template match="sect3/subtitle"></xsl:template>
<xsl:template match="sect3/titleabbrev"></xsl:template>
<xsl:template match="sect3info"></xsl:template>
<xsl:template match="sect3/info"></xsl:template>
<xsl:template match="sect4/title"></xsl:template>
<xsl:template match="sect4/subtitle"></xsl:template>
<xsl:template match="sect4/titleabbrev"></xsl:template>
<xsl:template match="sect4info"></xsl:template>
<xsl:template match="sect4/info"></xsl:template>
<xsl:template match="sect5/title"></xsl:template>
<xsl:template match="sect5/subtitle"></xsl:template>
<xsl:template match="sect5/titleabbrev"></xsl:template>
<xsl:template match="sect5info"></xsl:template>
<xsl:template match="sect5/info"></xsl:template>
<xsl:template match="simplesect/title"></xsl:template>
<xsl:template match="simplesect/subtitle"></xsl:template>
<xsl:template match="simplesect/titleabbrev"></xsl:template>
<xsl:template match="simplesect/info"></xsl:template>
<!-- ==================================================================== -->
<xsl:template name="section.heading">
<xsl:param name="section" select="."/>
<xsl:param name="level" select="1"/>
<xsl:param name="allow-anchors" select="1"/>
<xsl:param name="title"/>
<xsl:param name="class" select="'title'"/>
<xsl:variable name="id">
<xsl:choose>
<!-- Make sure the subtitle doesn't get the same id as the title -->
<xsl:when test="self::subtitle">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:when>
<!-- if title is in an *info wrapper, get the grandparent -->
<xsl:when test="contains(local-name(..), 'info')">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="../.."/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select=".."/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- HTML H level is one higher than section level -->
<xsl:variable name="hlevel">
<xsl:choose>
<!-- highest valid HTML H level is H6; so anything nested deeper
than 5 levels down just becomes H6 -->
<xsl:when test="$level &gt; 5">6</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$level + 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="h{$hlevel}">
<xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
<xsl:if test="$css.decoration != '0'">
<xsl:if test="$hlevel&lt;3">
<xsl:attribute name="style">clear: both</xsl:attribute>
</xsl:if>
</xsl:if>
<xsl:if test="$allow-anchors != 0">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="$section"/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:if>
<xsl:copy-of select="$title"/>
</xsl:element>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="bridgehead">
<xsl:variable name="container"
select="(ancestor::appendix
|ancestor::article
|ancestor::bibliography
|ancestor::chapter
|ancestor::glossary
|ancestor::glossdiv
|ancestor::index
|ancestor::partintro
|ancestor::preface
|ancestor::refsect1
|ancestor::refsect2
|ancestor::refsect3
|ancestor::sect1
|ancestor::sect2
|ancestor::sect3
|ancestor::sect4
|ancestor::sect5
|ancestor::section
|ancestor::setindex
|ancestor::simplesect)[last()]"/>
<xsl:variable name="clevel">
<xsl:choose>
<xsl:when test="local-name($container) = 'appendix'
or local-name($container) = 'chapter'
or local-name($container) = 'article'
or local-name($container) = 'bibliography'
or local-name($container) = 'glossary'
or local-name($container) = 'index'
or local-name($container) = 'partintro'
or local-name($container) = 'preface'
or local-name($container) = 'setindex'">1</xsl:when>
<xsl:when test="local-name($container) = 'glossdiv'">
<xsl:value-of select="count(ancestor::glossdiv)+1"/>
</xsl:when>
<xsl:when test="local-name($container) = 'sect1'
or local-name($container) = 'sect2'
or local-name($container) = 'sect3'
or local-name($container) = 'sect4'
or local-name($container) = 'sect5'
or local-name($container) = 'refsect1'
or local-name($container) = 'refsect2'
or local-name($container) = 'refsect3'
or local-name($container) = 'section'
or local-name($container) = 'simplesect'">
<xsl:variable name="slevel">
<xsl:call-template name="section.level">
<xsl:with-param name="node" select="$container"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$slevel + 1"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- HTML H level is one higher than section level -->
<xsl:variable name="hlevel">
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">2</xsl:when>
<xsl:when test="@renderas = 'sect2'">3</xsl:when>
<xsl:when test="@renderas = 'sect3'">4</xsl:when>
<xsl:when test="@renderas = 'sect4'">5</xsl:when>
<xsl:when test="@renderas = 'sect5'">6</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$clevel + 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="h{$hlevel}">
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="section/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="simplesect/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="sect1/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="sect2/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="sect3/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="sect4/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="sect5/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template name="section.subtitle">
<!-- the context node should be the subtitle of a section when called -->
<xsl:variable name="section" select="(ancestor::section
|ancestor::simplesect
|ancestor::sect1
|ancestor::sect2
|ancestor::sect3
|ancestor::sect4
|ancestor::sect5)[last()]"/>
<xsl:variable name="level">
<xsl:call-template name="section.level">
<xsl:with-param name="node" select="$section"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="section.heading">
<xsl:with-param name="section" select=".."/>
<xsl:with-param name="allow-anchors" select="0"/>
<!-- subtitle heading level one higher than section level -->
<xsl:with-param name="level" select="$level + 1"/>
<xsl:with-param name="class" select="'subtitle'"/>
<xsl:with-param name="title">
<xsl:apply-templates select="$section" mode="object.subtitle.markup">
<xsl:with-param name="allow-anchors" select="0"/>
</xsl:apply-templates>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +0,0 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- ********************************************************************
$Id: task.xsl 9363 2012-05-12 23:42:32Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="task">
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
<xsl:variable name="placement">
<xsl:choose>
<xsl:when test="contains($param.placement, ' ')">
<xsl:value-of select="substring-before($param.placement, ' ')"/>
</xsl:when>
<xsl:when test="$param.placement = ''">before</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$param.placement"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="preamble"
select="*[not(self::title
or self::titleabbrev)]"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor"/>
<xsl:if test="(title or info/title) and $placement = 'before'">
<xsl:call-template name="formal.object.heading"/>
</xsl:if>
<xsl:apply-templates select="$preamble"/>
<xsl:if test="(title or info/title) and $placement != 'before'">
<xsl:call-template name="formal.object.heading"/>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="task/title">
<!-- nop -->
</xsl:template>
<xsl:template match="tasksummary">
<xsl:call-template name="semiformal.object"/>
</xsl:template>
<xsl:template match="tasksummary/title"/>
<xsl:template match="taskprerequisites">
<xsl:call-template name="semiformal.object"/>
</xsl:template>
<xsl:template match="taskprerequisites/title"/>
<xsl:template match="taskrelated">
<xsl:call-template name="semiformal.object"/>
</xsl:template>
<xsl:template match="taskrelated/title"/>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,352 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: toc.xsl 9297 2012-04-22 03:56:16Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="set/toc | book/toc | part/toc">
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="node" select="parent::*"/>
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<!-- Do not output the toc element if one is already generated
by the use of $generate.toc parameter, or if
generating a source toc is turned off -->
<xsl:if test="not(contains($toc.params, 'toc')) and
($process.source.toc != 0 or $process.empty.source.toc != 0)">
<xsl:variable name="content">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<xsl:apply-templates />
</xsl:when>
<xsl:when test="count(*) = 0 and $process.empty.source.toc != 0">
<!-- trick to switch context node to parent element -->
<xsl:for-each select="parent::*">
<xsl:choose>
<xsl:when test="self::set">
<xsl:call-template name="set.toc">
<xsl:with-param name="toc.title.p"
select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="self::book">
<xsl:call-template name="division.toc">
<xsl:with-param name="toc.title.p"
select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="self::part">
<xsl:call-template name="division.toc">
<xsl:with-param name="toc.title.p"
select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:if test="string-length(normalize-space($content)) != 0">
<xsl:copy-of select="$content"/>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="chapter/toc | appendix/toc | preface/toc | article/toc">
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="node" select="parent::*"/>
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<!-- Do not output the toc element if one is already generated
by the use of $generate.toc parameter, or if
generating a source toc is turned off -->
<xsl:if test="not(contains($toc.params, 'toc')) and
($process.source.toc != 0 or $process.empty.source.toc != 0)">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:apply-templates select="title"/>
<dl>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="*[not(self::title)]"/>
</dl>
</div>
<xsl:call-template name="component.toc.separator"/>
</xsl:when>
<xsl:when test="count(*) = 0 and $process.empty.source.toc != 0">
<!-- trick to switch context node to section element -->
<xsl:for-each select="parent::*">
<xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p"
select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:for-each>
<xsl:call-template name="component.toc.separator"/>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="section/toc
|sect1/toc
|sect2/toc
|sect3/toc
|sect4/toc
|sect5/toc">
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="node" select="parent::*"/>
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<!-- Do not output the toc element if one is already generated
by the use of $generate.toc parameter, or if
generating a source toc is turned off -->
<xsl:if test="not(contains($toc.params, 'toc')) and
($process.source.toc != 0 or $process.empty.source.toc != 0)">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:apply-templates select="title"/>
<dl>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="*[not(self::title)]"/>
</dl>
</div>
<xsl:call-template name="section.toc.separator"/>
</xsl:when>
<xsl:when test="count(*) = 0 and $process.empty.source.toc != 0">
<!-- trick to switch context node to section element -->
<xsl:for-each select="parent::*">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p"
select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:for-each>
<xsl:call-template name="section.toc.separator"/>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="tocpart|tocchap
|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5">
<xsl:variable name="sub-toc">
<xsl:if test="tocchap|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5">
<xsl:choose>
<xsl:when test="$toc.list.type = 'dl'">
<dd>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:element name="{$toc.list.type}">
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="tocchap|toclevel1|toclevel2|
toclevel3|toclevel4|toclevel5"/>
</xsl:element>
</dd>
</xsl:when>
<xsl:otherwise>
<xsl:element name="{$toc.list.type}">
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="tocchap|toclevel1|toclevel2|
toclevel3|toclevel4|toclevel5"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:variable>
<xsl:apply-templates select="tocentry[position() != last()]"/>
<xsl:choose>
<xsl:when test="$toc.list.type = 'dl'">
<dt>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="tocentry[position() = last()]"/>
</dt>
<xsl:copy-of select="$sub-toc"/>
</xsl:when>
<xsl:otherwise>
<li>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="tocentry[position() = last()]"/>
<xsl:copy-of select="$sub-toc"/>
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="tocentry|tocdiv|lotentry|tocfront|tocback">
<xsl:choose>
<xsl:when test="$toc.list.type = 'dl'">
<dt>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="tocentry-content"/>
</dt>
</xsl:when>
<xsl:otherwise>
<li>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="tocentry-content"/>
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="tocentry[position() = last()]" priority="2">
<xsl:call-template name="tocentry-content"/>
</xsl:template>
<xsl:template name="tocentry-content">
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:choose>
<xsl:when test="@linkend">
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="@linkend"/>
</xsl:call-template>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="toc/title">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="toc/subtitle">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="toc/titleabbrev">
</xsl:template>
<!-- ==================================================================== -->
<!-- A lot element must have content, because there is no attribute
to select what kind of list should be generated -->
<xsl:template match="book/lot | part/lot">
<!-- Don't generate a page sequence unless there is content -->
<xsl:variable name="content">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates />
</div>
</xsl:when>
<xsl:when test="not(child::*) and $process.empty.source.toc != 0">
<xsl:call-template name="process.empty.lot"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:if test="string-length(normalize-space($content)) != 0">
<xsl:copy-of select="$content"/>
</xsl:if>
</xsl:template>
<xsl:template match="chapter/lot | appendix/lot | preface/lot | article/lot">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates />
</div>
<xsl:call-template name="component.toc.separator"/>
</xsl:when>
<xsl:when test="not(child::*) and $process.empty.source.toc != 0">
<xsl:call-template name="process.empty.lot"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="section/lot
|sect1/lot
|sect2/lot
|sect3/lot
|sect4/lot
|sect5/lot">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</div>
<xsl:call-template name="section.toc.separator"/>
</xsl:when>
<xsl:when test="not(child::*) and $process.empty.source.toc != 0">
<xsl:call-template name="process.empty.lot"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="process.empty.lot">
<!-- An empty lot element does not provide any information to indicate
what should be included in it. You can customize this
template to generate a lot based on @role or something -->
<xsl:message>
<xsl:text>Warning: don't know what to generate for </xsl:text>
<xsl:text>lot that has no children.</xsl:text>
</xsl:message>
</xsl:template>
<xsl:template match="lot/title">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="lot/subtitle">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="lot/titleabbrev">
</xsl:template>
</xsl:stylesheet>

View File

@ -1,410 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim"
xmlns:xverb="xalan://com.nwalsh.xalan.Verbatim"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="sverb xverb lxslt exsl"
version='1.0'>
<!-- ********************************************************************
$Id: verbatim.xsl 9297 2012-04-22 03:56:16Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- XSLTHL highlighting is turned off by default. See highlighting/README
for instructions on how to turn on XSLTHL -->
<xsl:template name="apply-highlighting">
<xsl:apply-templates/>
</xsl:template>
<lxslt:component prefix="xverb"
functions="numberLines"/>
<xsl:template match="programlisting|screen|synopsis">
<xsl:param name="suppress-numbers" select="'0'"/>
<xsl:call-template name="anchor"/>
<xsl:variable name="div.element">pre</xsl:variable>
<xsl:if test="$shade.verbatim != 0">
<xsl:message>
<xsl:text>The shade.verbatim parameter is deprecated. </xsl:text>
<xsl:text>Use CSS instead,</xsl:text>
</xsl:message>
<xsl:message>
<xsl:text>for example: pre.</xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text> { background-color: #E0E0E0; }</xsl:text>
</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="$suppress-numbers = '0'
and @linenumbering = 'numbered'
and $use.extensions != '0'
and $linenumbering.extension != '0'">
<xsl:variable name="rtf">
<xsl:choose>
<xsl:when test="$highlight.source != 0">
<xsl:call-template name="apply-highlighting"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="{$div.element}">
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:if test="@width != ''">
<xsl:attribute name="width">
<xsl:value-of select="@width"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="number.rtf.lines">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="{$div.element}">
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:if test="@width != ''">
<xsl:attribute name="width">
<xsl:value-of select="@width"/>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="$highlight.source != 0">
<xsl:call-template name="apply-highlighting"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="literallayout">
<xsl:param name="suppress-numbers" select="'0'"/>
<xsl:variable name="rtf">
<xsl:apply-templates/>
</xsl:variable>
<xsl:if test="$shade.verbatim != 0 and @class='monospaced'">
<xsl:message>
<xsl:text>The shade.verbatim parameter is deprecated. </xsl:text>
<xsl:text>Use CSS instead,</xsl:text>
</xsl:message>
<xsl:message>
<xsl:text>for example: pre.</xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text> { background-color: #E0E0E0; }</xsl:text>
</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="$suppress-numbers = '0'
and @linenumbering = 'numbered'
and $use.extensions != '0'
and $linenumbering.extension != '0'">
<xsl:choose>
<xsl:when test="@class='monospaced'">
<pre>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="number.rtf.lines">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</pre>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<p>
<xsl:call-template name="number.rtf.lines">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</p>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@class='monospaced'">
<pre>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:copy-of select="$rtf"/>
</pre>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<p>
<xsl:call-template name="make-verbatim">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</p>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="address">
<xsl:param name="suppress-numbers" select="'0'"/>
<xsl:variable name="rtf">
<xsl:apply-templates/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$suppress-numbers = '0'
and @linenumbering = 'numbered'
and $use.extensions != '0'
and $linenumbering.extension != '0'">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<p>
<xsl:call-template name="number.rtf.lines">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</p>
</div>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<p>
<xsl:call-template name="make-verbatim">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</p>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="number.rtf.lines">
<xsl:param name="rtf" select="''"/>
<xsl:param name="pi.context" select="."/>
<!-- Save the global values -->
<xsl:variable name="global.linenumbering.everyNth"
select="$linenumbering.everyNth"/>
<xsl:variable name="global.linenumbering.separator"
select="$linenumbering.separator"/>
<xsl:variable name="global.linenumbering.width"
select="$linenumbering.width"/>
<!-- Extract the <?dbhtml linenumbering.*?> PI values -->
<xsl:variable name="pi.linenumbering.everyNth">
<xsl:call-template name="pi.dbhtml_linenumbering.everyNth">
<xsl:with-param name="node" select="$pi.context"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="pi.linenumbering.separator">
<xsl:call-template name="pi.dbhtml_linenumbering.separator">
<xsl:with-param name="node" select="$pi.context"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="pi.linenumbering.width">
<xsl:call-template name="pi.dbhtml_linenumbering.width">
<xsl:with-param name="node" select="$pi.context"/>
</xsl:call-template>
</xsl:variable>
<!-- Construct the 'in-context' values -->
<xsl:variable name="linenumbering.everyNth">
<xsl:choose>
<xsl:when test="$pi.linenumbering.everyNth != ''">
<xsl:value-of select="$pi.linenumbering.everyNth"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$global.linenumbering.everyNth"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="linenumbering.separator">
<xsl:choose>
<xsl:when test="$pi.linenumbering.separator != ''">
<xsl:value-of select="$pi.linenumbering.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$global.linenumbering.separator"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="linenumbering.width">
<xsl:choose>
<xsl:when test="$pi.linenumbering.width != ''">
<xsl:value-of select="$pi.linenumbering.width"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$global.linenumbering.width"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="linenumbering.startinglinenumber">
<xsl:choose>
<xsl:when test="$pi.context/@startinglinenumber">
<xsl:value-of select="$pi.context/@startinglinenumber"/>
</xsl:when>
<xsl:when test="$pi.context/@continuation='continues'">
<xsl:variable name="lastLine">
<xsl:choose>
<xsl:when test="$pi.context/self::programlisting">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings"
select="preceding::programlisting[@linenumbering='numbered']"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pi.context/self::screen">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings"
select="preceding::screen[@linenumbering='numbered']"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pi.context/self::literallayout">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings"
select="preceding::literallayout[@linenumbering='numbered']"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pi.context/self::address">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings"
select="preceding::address[@linenumbering='numbered']"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pi.context/self::synopsis">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings"
select="preceding::synopsis[@linenumbering='numbered']"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Unexpected verbatim environment: </xsl:text>
<xsl:value-of select="local-name($pi.context)"/>
</xsl:message>
<xsl:value-of select="0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$lastLine + 1"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="function-available('sverb:numberLines')">
<xsl:copy-of select="sverb:numberLines($rtf)"/>
</xsl:when>
<xsl:when test="function-available('xverb:numberLines')">
<xsl:copy-of select="xverb:numberLines($rtf)"/>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>No numberLines function available.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="make-verbatim">
<xsl:param name="rtf"/>
<!-- I want to make this RTF verbatim. There are two possibilities: either
I have access to the exsl:node-set extension function and I can "do it right"
or I have to rely on CSS. -->
<xsl:choose>
<xsl:when test="$exsl.node.set.available != 0">
<xsl:apply-templates select="exsl:node-set($rtf)" mode="make.verbatim.mode"/>
</xsl:when>
<xsl:otherwise>
<span style="white-space: pre;">
<xsl:copy-of select="$rtf"/>
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ======================================================================== -->
<xsl:template name="lastLineNumber">
<xsl:param name="listings"/>
<xsl:param name="number" select="0"/>
<xsl:variable name="lines">
<xsl:call-template name="countLines">
<xsl:with-param name="listing" select="string($listings[1])"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="not($listings)">
<xsl:value-of select="$number"/>
</xsl:when>
<xsl:when test="$listings[1]/@startinglinenumber">
<xsl:value-of select="$number + $listings[1]/@startinglinenumber + $lines - 1"/>
</xsl:when>
<xsl:when test="$listings[1]/@continuation='continues'">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings" select="listings[position() &gt; 1]"/>
<xsl:with-param name="number" select="$number + $lines"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$lines"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="countLines">
<xsl:param name="listing"/>
<xsl:param name="count" select="1"/>
<xsl:choose>
<xsl:when test="contains($listing, '&#10;')">
<xsl:call-template name="countLines">
<xsl:with-param name="listing" select="substring-after($listing, '&#10;')"/>
<xsl:with-param name="count" select="$count + 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$count"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@ -1,531 +0,0 @@
<?xml version="1.0"?>
<!-- ********************************************************************
$Id: lib.xweb 9040 2011-08-19 21:51:47Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
This module implements DTD-independent functions
******************************************************************** -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="dot.count">
<!-- Returns the number of "." characters in a string -->
<xsl:param name="string"/>
<xsl:param name="count" select="0"/>
<xsl:choose>
<xsl:when test="contains($string, '.')">
<xsl:call-template name="dot.count">
<xsl:with-param name="string" select="substring-after($string, '.')"/>
<xsl:with-param name="count" select="$count+1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$count"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="copy-string">
<!-- returns 'count' copies of 'string' -->
<xsl:param name="string"/>
<xsl:param name="count" select="0"/>
<xsl:param name="result"/>
<xsl:choose>
<xsl:when test="$count&gt;0">
<xsl:call-template name="copy-string">
<xsl:with-param name="string" select="$string"/>
<xsl:with-param name="count" select="$count - 1"/>
<xsl:with-param name="result">
<xsl:value-of select="$result"/>
<xsl:value-of select="$string"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$result"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="string.subst">
<xsl:param name="string"/>
<xsl:param name="target"/>
<xsl:param name="replacement"/>
<xsl:choose>
<xsl:when test="contains($string, $target)">
<xsl:variable name="rest">
<xsl:call-template name="string.subst">
<xsl:with-param name="string" select="substring-after($string, $target)"/>
<xsl:with-param name="target" select="$target"/>
<xsl:with-param name="replacement" select="$replacement"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat(substring-before($string, $target), $replacement, $rest)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="xpointer.idref">
<xsl:param name="xpointer">http://...</xsl:param>
<xsl:choose>
<xsl:when test="starts-with($xpointer, '#xpointer(id(')">
<xsl:variable name="rest" select="substring-after($xpointer, '#xpointer(id(')"/>
<xsl:variable name="quote" select="substring($rest, 1, 1)"/>
<xsl:value-of select="substring-before(substring-after($xpointer, $quote), $quote)"/>
</xsl:when>
<xsl:when test="starts-with($xpointer, '#')">
<xsl:value-of select="substring-after($xpointer, '#')"/>
</xsl:when>
<!-- otherwise it's a pointer to some other document -->
</xsl:choose>
</xsl:template>
<xsl:template name="length-magnitude">
<xsl:param name="length" select="'0pt'"/>
<xsl:choose>
<xsl:when test="string-length($length) = 0"/>
<xsl:when test="substring($length,1,1) = '0' or substring($length,1,1) = '1' or substring($length,1,1) = '2' or substring($length,1,1) = '3' or substring($length,1,1) = '4' or substring($length,1,1) = '5' or substring($length,1,1) = '6' or substring($length,1,1) = '7' or substring($length,1,1) = '8' or substring($length,1,1) = '9' or substring($length,1,1) = '.'">
<xsl:value-of select="substring($length,1,1)"/>
<xsl:call-template name="length-magnitude">
<xsl:with-param name="length" select="substring($length,2)"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="length-units">
<xsl:param name="length" select="'0pt'"/>
<xsl:param name="default.units" select="'px'"/>
<xsl:variable name="magnitude">
<xsl:call-template name="length-magnitude">
<xsl:with-param name="length" select="$length"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="units">
<xsl:value-of select="substring($length, string-length($magnitude)+1)"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$units = ''">
<xsl:value-of select="$default.units"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$units"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="length-spec">
<xsl:param name="length" select="'0pt'"/>
<xsl:param name="default.units" select="'px'"/>
<xsl:variable name="magnitude">
<xsl:call-template name="length-magnitude">
<xsl:with-param name="length" select="$length"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="units">
<xsl:value-of select="substring($length, string-length($magnitude)+1)"/>
</xsl:variable>
<xsl:value-of select="$magnitude"/>
<xsl:choose>
<xsl:when test="$units='cm' or $units='mm' or $units='in' or $units='pt' or $units='pc' or $units='px' or $units='em'">
<xsl:value-of select="$units"/>
</xsl:when>
<xsl:when test="$units = ''">
<xsl:value-of select="$default.units"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Unrecognized unit of measure: </xsl:text>
<xsl:value-of select="$units"/>
<xsl:text>.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="length-in-points">
<xsl:param name="length" select="'0pt'"/>
<xsl:param name="em.size" select="10"/>
<xsl:param name="pixels.per.inch" select="90"/>
<xsl:variable name="magnitude">
<xsl:call-template name="length-magnitude">
<xsl:with-param name="length" select="$length"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="units">
<xsl:value-of select="substring($length, string-length($magnitude)+1)"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$units = 'pt'">
<xsl:value-of select="$magnitude"/>
</xsl:when>
<xsl:when test="$units = 'cm'">
<xsl:value-of select="$magnitude div 2.54 * 72.0"/>
</xsl:when>
<xsl:when test="$units = 'mm'">
<xsl:value-of select="$magnitude div 25.4 * 72.0"/>
</xsl:when>
<xsl:when test="$units = 'in'">
<xsl:value-of select="$magnitude * 72.0"/>
</xsl:when>
<xsl:when test="$units = 'pc'">
<xsl:value-of select="$magnitude * 12.0"/>
</xsl:when>
<xsl:when test="$units = 'px'">
<xsl:value-of select="$magnitude div $pixels.per.inch * 72.0"/>
</xsl:when>
<xsl:when test="$units = 'em'">
<xsl:value-of select="$magnitude * $em.size"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Unrecognized unit of measure: </xsl:text>
<xsl:value-of select="$units"/>
<xsl:text>.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="pi-attribute">
<xsl:param name="pis" select="processing-instruction('BOGUS_PI')"/>
<xsl:param name="attribute">filename</xsl:param>
<xsl:param name="count">1</xsl:param>
<xsl:choose>
<xsl:when test="$count&gt;count($pis)">
<!-- not found -->
</xsl:when>
<xsl:otherwise>
<xsl:variable name="pi">
<xsl:value-of select="$pis[$count]"/>
</xsl:variable>
<xsl:variable name="pivalue">
<xsl:value-of select="concat(' ', normalize-space($pi))"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($pivalue,concat(' ', $attribute, '='))">
<xsl:variable name="rest" select="substring-after($pivalue,concat(' ', $attribute,'='))"/>
<xsl:variable name="quote" select="substring($rest,1,1)"/>
<xsl:value-of select="substring-before(substring($rest,2),$quote)"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pi-attribute">
<xsl:with-param name="pis" select="$pis"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="count" select="$count + 1"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="lookup.key">
<xsl:param name="key" select="''"/>
<xsl:param name="table" select="''"/>
<xsl:if test="contains($table, ' ')">
<xsl:choose>
<xsl:when test="substring-before($table, ' ') = $key">
<xsl:variable name="rest" select="substring-after($table, ' ')"/>
<xsl:choose>
<xsl:when test="contains($rest, ' ')">
<xsl:value-of select="substring-before($rest, ' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$rest"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="lookup.key">
<xsl:with-param name="key" select="$key"/>
<xsl:with-param name="table" select="substring-after(substring-after($table,' '), ' ')"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template name="xpath.location">
<xsl:param name="node" select="."/>
<xsl:param name="path" select="''"/>
<xsl:variable name="next.path">
<xsl:value-of select="local-name($node)"/>
<xsl:if test="$path != ''">/</xsl:if>
<xsl:value-of select="$path"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$node/parent::*">
<xsl:call-template name="xpath.location">
<xsl:with-param name="node" select="$node/parent::*"/>
<xsl:with-param name="path" select="$next.path"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>/</xsl:text>
<xsl:value-of select="$next.path"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="comment-escape-string">
<xsl:param name="string" select="''"/>
<xsl:if test="starts-with($string, '-')">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:call-template name="comment-escape-string.recursive">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
<xsl:if test="substring($string, string-length($string), 1) = '-'">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="comment-escape-string.recursive">
<xsl:param name="string" select="''"/>
<xsl:choose>
<xsl:when test="contains($string, '--')">
<xsl:value-of select="substring-before($string, '--')"/>
<xsl:value-of select="'- -'"/>
<xsl:call-template name="comment-escape-string.recursive">
<xsl:with-param name="string" select="substring-after($string, '--')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="str.tokenize.keep.delimiters">
<xsl:param name="string" select="''"/>
<xsl:param name="delimiters" select="' '"/>
<xsl:choose>
<xsl:when test="not($string)"/>
<xsl:when test="not($delimiters)">
<xsl:call-template name="str.tokenize.keep.delimiters-characters">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="str.tokenize.keep.delimiters-delimiters">
<xsl:with-param name="string" select="$string"/>
<xsl:with-param name="delimiters" select="$delimiters"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="str.tokenize.keep.delimiters-characters">
<xsl:param name="string"/>
<xsl:if test="$string">
<ssb:token xmlns:ssb="http://sideshowbarker.net/ns"><xsl:value-of select="substring($string, 1, 1)"/></ssb:token>
<xsl:call-template name="str.tokenize.keep.delimiters-characters">
<xsl:with-param name="string" select="substring($string, 2)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="str.tokenize.keep.delimiters-delimiters">
<xsl:param name="string"/>
<xsl:param name="delimiters"/>
<xsl:variable name="delimiter" select="substring($delimiters, 1, 1)"/>
<xsl:choose>
<xsl:when test="not($delimiter)">
<ssb:token xmlns:ssb="http://sideshowbarker.net/ns"><xsl:value-of select="$string"/></ssb:token>
</xsl:when>
<xsl:when test="contains($string, $delimiter)">
<xsl:if test="not(starts-with($string, $delimiter))">
<xsl:call-template name="str.tokenize.keep.delimiters-delimiters">
<xsl:with-param name="string" select="substring-before($string, $delimiter)"/>
<xsl:with-param name="delimiters" select="substring($delimiters, 2)"/>
</xsl:call-template>
</xsl:if>
<!-- output each delimiter -->
<xsl:value-of select="$delimiter"/>
<xsl:call-template name="str.tokenize.keep.delimiters-delimiters">
<xsl:with-param name="string" select="substring-after($string, $delimiter)"/>
<xsl:with-param name="delimiters" select="$delimiters"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="str.tokenize.keep.delimiters-delimiters">
<xsl:with-param name="string" select="$string"/>
<xsl:with-param name="delimiters" select="substring($delimiters, 2)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="apply-string-subst-map">
<xsl:param name="content"/>
<xsl:param name="map.contents"/>
<xsl:variable name="replaced_text">
<xsl:call-template name="string.subst">
<xsl:with-param name="string" select="$content"/>
<xsl:with-param name="target" select="$map.contents[1]/@oldstring"/>
<xsl:with-param name="replacement" select="$map.contents[1]/@newstring"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$map.contents[2]">
<xsl:call-template name="apply-string-subst-map">
<xsl:with-param name="content" select="$replaced_text"/>
<xsl:with-param name="map.contents" select="$map.contents[position() &gt; 1]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$replaced_text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="count.uri.path.depth">
<xsl:param name="filename" select="''"/>
<xsl:param name="count" select="0"/>
<xsl:choose>
<xsl:when test="contains($filename, '/')">
<xsl:call-template name="count.uri.path.depth">
<xsl:with-param name="filename" select="substring-after($filename, '/')"/>
<xsl:with-param name="count" select="$count + 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$count"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="trim.common.uri.paths">
<xsl:param name="uriA" select="''"/>
<xsl:param name="uriB" select="''"/>
<xsl:param name="return" select="'A'"/>
<!-- Resolve any ../ in the path -->
<xsl:variable name="trimmed.uriA">
<xsl:call-template name="resolve.path">
<xsl:with-param name="filename" select="$uriA"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="trimmed.uriB">
<xsl:call-template name="resolve.path">
<xsl:with-param name="filename" select="$uriB"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($trimmed.uriA, '/') and contains($trimmed.uriB, '/') and substring-before($trimmed.uriA, '/') = substring-before($trimmed.uriB, '/')">
<xsl:call-template name="trim.common.uri.paths">
<xsl:with-param name="uriA" select="substring-after($trimmed.uriA, '/')"/>
<xsl:with-param name="uriB" select="substring-after($trimmed.uriB, '/')"/>
<xsl:with-param name="return" select="$return"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$return = 'A'">
<xsl:value-of select="$trimmed.uriA"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$trimmed.uriB"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="resolve.path">
<xsl:param name="filename" select="''"/>
<xsl:choose>
<!-- Leading .. are not eliminated -->
<xsl:when test="starts-with($filename, '../')">
<xsl:value-of select="'../'"/>
<xsl:call-template name="resolve.path">
<xsl:with-param name="filename" select="substring-after($filename, '../')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($filename, '/../')">
<xsl:call-template name="resolve.path">
<xsl:with-param name="filename">
<xsl:call-template name="dirname">
<xsl:with-param name="filename" select="substring-before($filename, '/../')"/>
</xsl:call-template>
<xsl:value-of select="substring-after($filename, '/../')"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$filename"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="dirname">
<xsl:param name="filename" select="''"/>
<xsl:if test="contains($filename, '/')">
<xsl:value-of select="substring-before($filename, '/')"/>
<xsl:text>/</xsl:text>
<xsl:call-template name="dirname">
<xsl:with-param name="filename" select="substring-after($filename, '/')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="trim.text">
<xsl:param name="contents" select="."/>
<xsl:variable name="contents-left-trimmed">
<xsl:call-template name="trim-left">
<xsl:with-param name="contents" select="$contents"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="contents-trimmed">
<xsl:call-template name="trim-right">
<xsl:with-param name="contents" select="$contents-left-trimmed"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$contents-trimmed"/>
</xsl:template>
<xsl:template name="trim-left">
<xsl:param name="contents"/>
<xsl:choose>
<xsl:when test="starts-with($contents,'&#10;') or starts-with($contents,'&#13;') or starts-with($contents,' ') or starts-with($contents,'&#9;')">
<xsl:call-template name="trim-left">
<xsl:with-param name="contents" select="substring($contents, 2)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$contents"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="trim-right">
<xsl:param name="contents"/>
<xsl:variable name="last-char">
<xsl:value-of select="substring($contents, string-length($contents), 1)"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="($last-char = '&#10;') or ($last-char = '&#13;') or ($last-char = ' ') or ($last-char = '&#9;')">
<xsl:call-template name="trim-right">
<xsl:with-param name="contents" select="substring($contents, 1, string-length($contents) - 1)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$contents"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

42
debian/NEWS vendored
View File

@ -1,42 +0,0 @@
syncevolution (1.3.99.7-1) unstable; urgency=high
Akonadi support for KDE is now enabled. The support for GNOME and KDE
has been split into new packages named syncevolution-libs-gnome and
syncevolution-libs-kde. If you only want to use KDE, you can remove
syncevolution-libs-gnome.
-- Tino Keitel <tino+debian@tikei.de> Fri, 31 Jan 2014 12:37:10 +0100
syncevolution (1.2.99.1-1) unstable; urgency=low
The sync format of existing configurations for Mobical (aka Everdroid)
must be updated manually, because the server has encoding problems when
using vCard 3.0 (now the default for Evolution contacts):
syncevolution --configure \
syncFormat=text/x-vcard \
mobical addressbook
The Funambol template explicitly enables usage of the
"refresh-from-server" sync mode to avoid getting throttled with 417
'retry later' errors. The same must be added to existing configs
manually:
syncevolution configure \
enableRefreshSync=TRUE \
funambol
-- Tino Keitel <tino+debian@tikei.de> Thu, 28 Jun 2012 08:01:52 +0200
syncevolution (1.1.99.5a-1) experimental; urgency=low
This version of syncevolution introduces an irreversible change to the
config layout, see the --migrate option in the syncevolution man page.
Migration happens automatically at first invocation.
This version is only know to work with version 2.32.2 of evolution.
In particular, it probably won't work with the version of evolution in
squeeze.
-- David Bremner <bremner@debian.org> Tue, 08 Mar 2011 17:01:37 -0400

11
debian/README.Debian vendored
View File

@ -1,11 +0,0 @@
Hints for server operation
^^^^^^^^^^^^^^^^^^^^^^^^^^
One SyncEvolution instance can currently provide data for one user only.
If you want to setup a SyncEvolution server headless without using an
Evolution Data Server with plain file storage, you can use the file storage
as described here:
http://syncevolution.org/wiki/http-server-howto

3
debian/TODO vendored
View File

@ -1,3 +0,0 @@
* add missing manpages for syncompare and syncevo-http-server
* fix FTPFS with g++ 11 without CXXFLAG -std=c++14;
see <https://gitlab.freedesktop.org/SyncEvolution/syncevolution/-/issues/167>

417
debian/changelog vendored
View File

@ -1,417 +0,0 @@
syncevolution (2.0.0-2) experimental; urgency=medium
[ Jonas Smedegaard ]
* update copyright info:
+ fix consistently use field License-Grant (not Grant)
+ fix consistently use field Files (not bogus File)
+ fix add License section LGPL-2
+ tighten license-related lintian overrides
* fix have syncevolution-http depend on python3-gi
(not bogus python3-gobject:
earlier transitional package python-gobject pulled in python-gi)
* fix drop depending on python3-twisted-web:
bogus (transitioned to python3-twisted-core)
and used only by exerimental unused script
* tighten dh-missing to fail (not only warn) on missed files
+ list unversioned symlinks to shared objects as not-installed
+ list helper scripts for testing as not-installed
* fix install XDG startup files in syncevolution-dbus
* fix install SRV resolver script in syncevolution-common,
recommend adns-utils (or simpler fallbacks),
and have syncevolution-libs recommend syncevolution-common
* work around FTPFS with g++ 11 by setting CXXFLAG -std=c++14
[ Joao Azevedo ]
* list library syncactivesync.so as not installed
(to match upstream intent in unconventional build target)
* list TDEPIM libraries as not installed
(we no longer link against KDE libraries so unlikely to be useful)
* fix install libraries syncpbap providergoa
-- Jonas Smedegaard <dr@jones.dk> Wed, 03 Nov 2021 15:50:49 +0100
syncevolution (2.0.0-1) experimental; urgency=medium
[ upstream ]
* new release
[ Jonas Smedegaard ]
* isolate kfreebsd FTBFS fix as patch 1001,
and track package source with patches unapplied
* add git-buildpackage config:
+ use pristine-tar
+ sign tags
+ avoid any .git* files
+ use DEP-14 branches debian/latest upstream/latest
+ add usage comment
* drop obsolete *-dbg to *-dbgsym migration
* simplify rules;
stop explicitly build-depend on libtool automake pkg-config
(pulled in via autoreconf since debhelper compatibility level 10)
* use debhelper compatibility level 13 (not 11);
build-depend on debhelper-compat (not debhelper)
* relax to stop build-depend explicitly on g++:
required version satisfied by default
in all supported Debian releases
* drop ancient Breaks/Replaces hints
* stop link against KDE libraries (no longer supported upstream):
+ drop binary package syncevolution-libs-kde
+ stop build-depend on kdelibs5-dev kdepimlibs5-dev
* stop install library to support ActiveSync
(no longer supported upstream)
* use Python 3.x libraries:
+ build-depend on python3-docutils (not python-docutils)
+ have syncevolution-http depend on python3 python3-dbus
python3-gobject python3-openssl
python3-pygments python3-twisted-web
(not python python-dbus python-gobject
python-openssl python-twisted-web)
* stop build-depend on libpcre3-dev
* build-depend on libecal2.0-dev (not libecal1.2-dev)
* relax to build-depend unversioned on libsynthesis-dev:
required version satisfied in all supported Debian releases
* add patch 1002
to adjust whitespace as required for recent autotools
* fix install all pstream-provided gettext machine-object files
* install all upstream-provided README.* files
* install more example files
* improve install tracking with dh_missing:
package upstream-installed manpage (not source file)
* explicitly list files deliberately not installed
* stop install syncevolution-dbus example file dropped upstream
* update install paths
[ João Azevedo ]
* don't use install for syncevo-http-server.py
-- Jonas Smedegaard <dr@jones.dk> Tue, 05 Oct 2021 17:45:04 +0200
syncevolution (1.5.3-2) unstable; urgency=medium
* Remove libgconf2-dev build-dep (Closes: #897258)
-- Tino Mettler <tino+debian@tikei.de> Thu, 21 Jun 2018 21:19:04 +0200
syncevolution (1.5.3-1) unstable; urgency=medium
* New upstream release
* Fix override_dh_makeshlibs to handle all packages with public shared libs
(Closes: #887043)
* Remove obsolete Conflicts:/Breaks:/Replaces: sync-ui (<<1.1+ds1-1~)
* Change debhelper compatibility to 11, which is recommended
* Bump standards version to 4.1.3, no changes needed
* Fix several lintian warnings
-- Tino Mettler <tino+debian@tikei.de> Sat, 13 Jan 2018 22:47:44 +0100
syncevolution (1.5.2-3) unstable; urgency=medium
[ Patrick Ohly ]
* libical: support libical v3 (Closes: #884158)
* GNOME: replace gnome-keyring with libsecret
[ Tino Mettler ]
* Change build dependencies for libgtk and glade to use GTK3 for sync-ui
(Closes: #884162)
* Add Build-Dep on libjson-c-dev, enable and include oauth2 backend
(Closes: #884170)
* Handle C++ conversion operator name mangling in GCC 7 (Closes: #871284)
* Build depend on libsecret-1-dev instead of deprecated libgnome-keyring-dev
(Closes: #867944)
-- Tino Mettler <tino+debian@tikei.de> Thu, 04 Jan 2018 22:21:57 +0100
syncevolution (1.5.2-2) unstable; urgency=medium
* Add missing service file for syncevo-dbus-server (Closes: #854941)
-- Tino Mettler <tino+debian@tikei.de> Fri, 24 Feb 2017 12:17:56 +0100
syncevolution (1.5.2-1) unstable; urgency=medium
* New upstream version
* Remove patch for GCC6 build failures, as they are fixed upstream
* Remove flags to downgrade the C++ dialect, fixed upstream
* Remove 0002-Fix-FTBFS-with-libical2.patch, fixed upstream
* Use HTTPS for URL to git web view
* Improve short descriptions
-- Tino Mettler <tino+debian@tikei.de> Fri, 18 Nov 2016 13:11:53 +0100
syncevolution (1.5.1-2) unstable; urgency=medium
* Add 0003-Add-missing-casts-from-shared_ptr-to-bool-to-fix-FTB.patch
to add missing casts from shared_ptr to bool, fixes FTBFS with GCC 6
* Fix remaining FTBFS with GCC 6 by downgrading the C++ dialect to gnu++98
(Closes: #811624)
-- Tino Mettler <tino+debian@tikei.de> Mon, 11 Jul 2016 10:17:38 +0200
syncevolution (1.5.1-1) unstable; urgency=medium
* New upstream release (Closes: #803416)
* Fix FTBFS with libical2 (Closes: #824426)
* Remove 0002-Use-TLS-instead-of-SSLv3-in-SyncML-server-script.patch
which was merged upstream
* Update Vcs-* fields to new URLs
* Bump standards version, no changes needed
* Add dh_auto_clean quirk to make the package build twice in a row
* Upstream generates a manpage, remove outdated and obsolete own version
* Remove old debug package definition, use the new dbgsym packages
* Depend on recent libsynthesis package
-- Tino Mettler <tino+debian@tikei.de> Thu, 19 May 2016 11:41:07 +0200
syncevolution (1.4.99.4-5) unstable; urgency=medium
* Build-depend on libopenobex2-dev (Closes: #813819)
-- Tino Mettler <tino+debian@tikei.de> Fri, 26 Feb 2016 11:57:35 +0100
syncevolution (1.4.99.4-4) unstable; urgency=medium
* Fix libsynthesis depencency after GCC5 transition (Closes: #797966)
-- Tino Mettler <tino+debian@tikei.de> Fri, 26 Feb 2016 11:56:50 +0100
syncevolution (1.4.99.4-3) unstable; urgency=medium
* Use TLS instead of SSLv3 in SyncML server script (Closes: #772040)
-- Tino Mettler <tino+debian@tikei.de> Thu, 04 Dec 2014 22:44:49 +0100
syncevolution (1.4.99.4-2) unstable; urgency=medium
* Fix FTBFS on kfreebsd due to missing SOCK_CLOEXEC
-- Tino Mettler <tino+debian@tikei.de> Sun, 26 Oct 2014 14:12:59 +0100
syncevolution (1.4.99.4-1) unstable; urgency=medium
* New upstream release candidate
* Build-depend on libsynthesis 3.4.0.47.4
* syncaddressbook.so vanished, as iOS addressbook support was removed
-- Tino Mettler <tino+debian@tikei.de> Sat, 25 Oct 2014 22:34:41 +0200
syncevolution (1.4-1) unstable; urgency=high
* New upstream release
* Allow parallel builds
* Adjust Maintainer: field to new surname
* Fix FTBFS due to erroneously hardcoded x86_64 path in an install file
(Closes: #739665)
* Fix upgrade from versions before 1.3.99.7 due to file conflicts.
Thanks to Simon McVittie (Closes: #739662)
* Add sections for files previously missing in copyright information
(Closes: #739616)
* Remove 0001-Fix-incorrect-mktemp-usage-reported-by-Helmut-Grohne.patch,
fixed upstream in a different way
-- Tino Mettler <tino+debian@tikei.de> Fri, 21 Feb 2014 11:44:04 +0100
syncevolution (1.3.99.7-1) unstable; urgency=high
* New upstream release candidate
* Add 0001-Fix-incorrect-mktemp-usage-reported-by-Helmut-Grohne.patch,
which fixes CVE-2014-1639
(Closes: #736357)
* Enable Akonadi support, separate Evolution (GNOME) and Akonadi (KDE) support
(Closes: #682520)
* Update standards version to 3.9.5, no changes needed
* Add NEWS item to describe changes regarding KDE and GNOME support
-- Tino Keitel <tino+debian@tikei.de> Fri, 31 Jan 2014 12:44:35 +0100
syncevolution (1.3.2-1) unstable; urgency=low
* Install syncevo-local-sync helper, required for CardDAV/CalDAV.
Thanks to Gregor Herrmann for the patch. (Closes: #679657)
* New upstream release (Closes: #682280, #684077, #694004, #722044)
* Use multiarch paths for shared object files
* Raise debhelper compatibility level to 9
* Build with --as-needed and with hardening flags enabled
* Depend on recent libsynthesis, to pull in the fix for #694005
* Added upstream patch 0001-GTK-GTK3-UI-fix-crash-on-64-bit.patch to fix a
segmentation fault in sync-ui when built with hardening=+pie
-- Tino Keitel <tino+debian@tikei.de> Tue, 01 Oct 2013 10:52:25 +0200
syncevolution (1.2.99.1-1.1) unstable; urgency=low
* Non-maintainer upload.
* dbus-auto-activation.patch: new patch backported from upstream; fix
D-Bus auto-activation. Thanks to Josselin Mouette for pointing to the
relevant commit. (Closes: #699852)
-- Sébastien Villemot <sebastien@debian.org> Mon, 01 Apr 2013 20:12:55 +0200
syncevolution (1.2.99.1-1) unstable; urgency=low
* New upstream release candidate (Closes: #675288)
* Use DEB_REF instead of UPSTREAM_REF for git based patch creation
* Add libpcre3-dev and libcppunit-dev build dependencies
* New library package for libgdbussyncevo
* Install new syncevo-dbus-helper binary
* Document possible issues when upgrading from 1.2.x in NEWS
-- Tino Keitel <tino+debian@tikei.de> Fri, 29 Jun 2012 12:42:18 +0200
syncevolution (1.2.2-1) unstable; urgency=medium
* New upstream version
* Fix upgrade from squeeze (Closes: #657001)
* Re-add sync-ui icon file (Closes: #658519)
-- Tino Keitel <tino+debian@tikei.de> Mon, 06 Feb 2012 19:33:08 +0100
syncevolution (1.2.1-1) unstable; urgency=low
* New upstream release
* Update build dependencies to current libsynthesis
* Remove 0001-README-crucial-syncURL-was-missing.patch, included upstream
-- Tino Keitel <tino+debian@tikei.de> Mon, 19 Dec 2011 21:35:51 +0100
syncevolution (1.1.99.5a-2) unstable; urgency=low
* Upload to unstable
* New maintainer: me. Thanks David for the great work. (Closes: #624540)
* Replace "!kfreebsd-*" and "!hurd-*" build depencendies with "linux-any"
as bluez is only available on Linux (Closes: #634747)
* Add 0001-README-crucial-syncURL-was-missing.patch which contains a
small CalDAV/CardDAV documentation fix from upstream git
* Rework package descriptions to mention new features
* Add README.Debian with some hints for HTTP server operation
* Correctly enable CalDAV/WebDAV in the configure call (Closes: #624642)
-- Tino Keitel <tino+debian@tikei.de> Wed, 03 Aug 2011 15:18:46 +0200
syncevolution (1.1.99.5a-1) experimental; urgency=low
* New upstream version 1.1.99.5a, first release candiate for 1.2
* Added python-openssl dependency, the HTTP server needs it for HTTPS support
* Added versioned dependency on libsynthesis0 to get required features
* Fixed .orig.tar.gz generation in get-orig-source target
* Added myself to Uploaders:, thanks to David for sponsoring
* Use updated upstream tag for source package generation
* Removed 0001-Replace-with-in-call-to-PKG_CHECK_MODULES.patch, fixed upstream
* Renamed NEWS.Debian to NEWS so that it is actually used
* Updated NEWS for 1.1.99.5a
-- Tino Keitel <tino+debian@tikei.de> Wed, 20 Jul 2011 16:02:02 +0200
syncevolution (1.1.99.4+ds1-1) experimental; urgency=low
* New upstream release candidate
* Rebuilt against new libsynthesis (Closes: #615263)
* Removed icalstrdup patch, now upstream.
* Enable CalDAV/CardDAV (Closes: #624642)
* Bump Standards-Version to 3.9.2 (no changes)
* New binary packages: libsyncevolution0, libsyncevo-dbus0
syncevolution-libs
-- David Bremner <bremner@debian.org> Fri, 03 Jun 2011 21:56:26 -0300
syncevolution (1.1.99.3+ds1-1) experimental; urgency=low
* New upstream (pre-release) version
* Remove two s390 related patches, now contained in upstream
commit 63d76f874270cbafb2.
-- David Bremner <bremner@debian.org> Tue, 08 Mar 2011 16:05:30 -0400
syncevolution (1.1+ds1-5) unstable; urgency=low
* patch: Avoid dependence on PATH_MAX (fixes FTBFS on hurd).
* patch: Add a second translation between sysync::memSize and size_t
(Closed: #604840)
* Move synccompare man page to syncevolution-common
-- David Bremner <bremner@debian.org> Sun, 28 Nov 2010 10:27:11 -0400
syncevolution (1.1+ds1-4) experimental; urgency=low
* Remove build dependency on libopenobex1-dev on hurd-i386, because it is not
available there. The package is already built without it on kfreebsd.
* Explicitly translate between sysync::memSize and size_t. Thanks to
Patrick Ohly for the patch.
-- David Bremner <bremner@debian.org> Wed, 24 Nov 2010 15:10:00 -0800
syncevolution (1.1+ds1-3) experimental; urgency=low
* Upload to experimental to test autobuilding, particularly on Hurd.
-- David Bremner <bremner@debian.org> Sun, 21 Nov 2010 08:37:48 -0800
syncevolution (1.1+ds1-2) experimental; urgency=low
* Update conflicts/replaces for syncevolution-common. Thanks to Simon
McVittie for the report, and the fix. (Closes: #603023).
-- David Bremner <bremner@debian.org> Wed, 10 Nov 2010 16:32:55 -0400
syncevolution (1.1+ds1-1) experimental; urgency=low
[ David Bremner ]
* New upstream release (Closes: #582376)
* Update maintainer address
* New binary package syncevolution-http for syncevo-http-server
(Closes: #573265)
* Add -dbg package to hold debugging symbols
* Recommend evolution-data-server instead of evolution
* Update Standards-Version to 3.9.1 (No changes).
[ Thomas Bechtold ]
* Split source package into syncevolution-common, syncevolution and
sync-ui.
* add dbus-server-sync.py and syncevo-phone-config.py to syncevolution
examples
-- David Bremner <bremner@debian.org> Mon, 08 Nov 2010 19:59:29 -0400
syncevolution (1.0+ds1~beta2a-1) unstable; urgency=low
* New upstream beta (Closes: #572640)
* According to http://bugzilla.moblin.org/show_bug.cgi?id=8758,
syncevolution is now smarter about retrying in certain situations.
(Closes: #565527).
* Update Standard-Version to 3.8.4 (No changes).
-- David Bremner <bremner@unb.ca> Fri, 26 Feb 2010 15:45:00 -0400
syncevolution (1.0+ds1~a1-2) experimental; urgency=low
* Don't build depend on libopenobex1-dev on kfreebsd-*. This avoids
trying to compile bluetooth support, which relies on bluez
(Closes: #566940)
-- David Bremner <bremner@unb.ca> Tue, 26 Jan 2010 23:28:44 -0400
syncevolution (1.0+ds1~a1-1) experimental; urgency=low
* New Upstream Version
* Development snapshot, use with caution.
-- David Bremner <bremner@unb.ca> Sun, 17 Jan 2010 22:07:03 -0400
syncevolution (0.9.1+ds1-1) unstable; urgency=low
* New Upstream Version
* Standards Version 3.8.3 (no changes)
* Convert to source package format 3.0 (quilt)
-- David Bremner <bremner@unb.ca> Fri, 20 Nov 2009 07:55:54 -0400
syncevolution (0.9+ds1-2) unstable; urgency=low
* Major update to debian/changelog to list all copyright holders.
-- David Bremner <bremner@unb.ca> Fri, 20 Nov 2009 07:55:03 -0400
syncevolution (0.9+ds1-1) unstable; urgency=low
* Initial release (Closes: #404942)
-- David Bremner <bremner@unb.ca> Sun, 16 Aug 2009 23:53:47 -0300

212
debian/control vendored
View File

@ -1,212 +0,0 @@
Source: syncevolution
Section: utils
Priority: optional
Maintainer: Jonas Smedegaard <dr@jones.dk>
Build-Depends:
debhelper-compat (= 13),
intltool,
libboost-dev,
libcppunit-dev,
libcurl4-gnutls-dev,
libdbus-glib-1-dev,
libebook1.2-dev,
libecal2.0-dev,
libedataserver1.2-dev,
libgladeui-dev,
libglib2.0-dev,
libgtk-3-dev,
libical-dev,
libjson-c-dev,
libneon27-gnutls-dev,
libnotify-dev,
libopenobex2-dev [linux-any],
libsecret-1-dev,
libsynthesis-dev,
python3-docutils,
python3-pygments,
xsltproc,
Standards-Version: 4.6.0
Homepage: https://www.syncevolution.org/
Vcs-Git: https://salsa.debian.org/debian/syncevolution.git
Vcs-Browser: https://salsa.debian.org/debian/syncevolution
Rules-Requires-Root: no
Package: syncevolution
Architecture: any
Depends:
syncevolution-common (= ${source:Version}),
syncevolution-libs (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends},
Recommends:
bluez,
Description: Sync personal information data via SyncML/CalDAV/CardDAV (CLI)
SyncEvolution synchronizes contact, calendar and task items via SyncML and
CalDAV/CardDAV with other servers or devices. It uses the Evolution Data Server
to sync PIM data in Evolution, but a plain file storage is also supported.
Data exchange can happen via HTTP(S) and Bluetooth. Full, one-way and
incremental synchronization of items are supported. SyncEvolution can act as
a SyncML/DAV client and SyncML server.
.
This package provides the CLI client.
Package: sync-ui
Architecture: any
Depends:
syncevolution-common (= ${source:Version}),
syncevolution-dbus,
${misc:Depends},
${shlibs:Depends},
Recommends:
bluez,
Description: Sync personal information data via SyncML/CalDAV/CardDAV (GTK+ GUI)
SyncEvolution synchronizes contact, calendar and task items via SyncML and
CalDAV/CardDAV with other servers or devices. It uses the Evolution Data Server
to sync PIM data in Evolution, but a plain file storage is also supported.
Data exchange can happen via HTTP(S) and Bluetooth. Full, one-way and
incremental synchronization of items are supported. SyncEvolution can act as
a SyncML/DAV client and SyncML server.
.
This package provides a GTK+ graphical user interface.
Package: syncevolution-common
Architecture: all
Depends:
libsynthesis0v5 (>= 3.4.0.47.5),
${misc:Depends},
Recommends:
adns-tools | host | dnsutils,
Description: Sync personal information data via SyncML/CalDAV/CardDAV (common files)
SyncEvolution synchronizes contact, calendar and task items via SyncML and
CalDAV/CardDAV with other servers or devices. It uses the Evolution Data Server
to sync PIM data in Evolution, but a plain file storage is also supported.
Data exchange can happen via HTTP(S) and Bluetooth. Full, one-way and
incremental synchronization of items are supported. SyncEvolution can act as
a SyncML/DAV client and SyncML server.
.
This package provides common architecture independent files.
Package: syncevolution-libs
Architecture: any
Depends:
syncevolution-libs-gnome (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends},
Recommends:
syncevolution-common (= ${source:Version}),
Description: Sync personal information data via SyncML/CalDAV/CardDAV (backend libraries)
SyncEvolution synchronizes contact, calendar and task items via SyncML and
CalDAV/CardDAV with other servers or devices. It uses the Evolution Data Server
to sync PIM data in Evolution, but a plain file storage is also supported.
Data exchange can happen via HTTP(S) and Bluetooth. Full, one-way and
incremental synchronization of items are supported. SyncEvolution can act as
a SyncML/DAV client and SyncML server.
.
This package provides private libraries and plugins.
Package: syncevolution-libs-gnome
Architecture: any
Depends:
${misc:Depends},
${shlibs:Depends},
Recommends:
evolution-data-server,
Description: Sync personal information data via SyncML/CalDAV/CardDAV (GNOME backend)
SyncEvolution synchronizes contact, calendar and task items via SyncML and
CalDAV/CardDAV with other servers or devices. It uses the Evolution Data Server
to sync PIM data in Evolution, but a plain file storage is also supported.
Data exchange can happen via HTTP(S) and Bluetooth. Full, one-way and
incremental synchronization of items are supported. SyncEvolution can act as
a SyncML/DAV client and SyncML server.
.
This package provides private libraries and plugins for GNOME.
Package: syncevolution-dbus
Architecture: any
Depends:
dbus,
syncevolution-common (= ${source:Version}),
syncevolution-libs (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends},
Description: Sync personal information data via SyncML/CalDAV/CardDAV (D-Bus support)
SyncEvolution synchronizes contact, calendar and task items via SyncML and
CalDAV/CardDAV with other servers or devices. It uses the Evolution Data Server
to sync PIM data in Evolution, but a plain file storage is also supported.
Data exchange can happen via HTTP(S) and Bluetooth. Full, one-way and
incremental synchronization of items are supported. SyncEvolution can act as
a SyncML/DAV client and SyncML server.
.
This package provides D-Bus services.
Package: syncevolution-http
Architecture: all
Depends:
dbus-x11,
python3,
python3-dbus,
python3-gi,
python3-openssl,
syncevolution-dbus (>= ${source:Version}),
${misc:Depends},
Description: Sync personal information data via SyncML/CalDAV/CardDAV (HTTP server)
SyncEvolution synchronizes contact, calendar and task items via SyncML and
CalDAV/CardDAV with other servers or devices. It uses the Evolution Data Server
to sync PIM data in Evolution, but a plain file storage is also supported.
Data exchange can happen via HTTP(S) and Bluetooth. Full, one-way and
incremental synchronization of items are supported. SyncEvolution can act as
a SyncML/DAV client and SyncML server.
.
This package provides a python script to make SyncEvolution act as a HTTP(S)
server for other SyncML clients.
Package: libsyncevolution0
Architecture: any
Depends:
dbus,
syncevolution-common (= ${source:Version}),
${misc:Depends},
${shlibs:Depends},
Description: Sync personal information data via SyncML/CalDAV/CardDAV (shared library)
SyncEvolution synchronizes contact, calendar and task items via SyncML and
CalDAV/CardDAV with other servers or devices. It uses the Evolution Data Server
to sync PIM data in Evolution, but a plain file storage is also supported.
Data exchange can happen via HTTP(S) and Bluetooth. Full, one-way and
incremental synchronization of items are supported. SyncEvolution can act as
a SyncML/DAV client and SyncML server.
.
This package provides a shared library.
Package: libsyncevo-dbus0
Architecture: any
Depends:
dbus,
syncevolution-common (= ${source:Version}),
${misc:Depends},
${shlibs:Depends},
Description: Sync personal information data via SyncML/CalDAV/CardDAV (shared D-Bus library)
SyncEvolution synchronizes contact, calendar and task items via SyncML and
CalDAV/CardDAV with other servers or devices. It uses the Evolution Data Server
to sync PIM data in Evolution, but a plain file storage is also supported.
Data exchange can happen via HTTP(S) and Bluetooth. Full, one-way and
incremental synchronization of items are supported. SyncEvolution can act as
a SyncML/DAV client and SyncML server.
.
This package provides a shared library.
Package: libgdbussyncevo0
Architecture: any
Depends:
dbus,
syncevolution-common (= ${source:Version}),
${misc:Depends},
${shlibs:Depends},
Description: Sync personal information data via SyncML/CalDAV/CardDAV (shared gdbus library)
SyncEvolution synchronizes contact, calendar and task items via SyncML and
CalDAV/CardDAV with other servers or devices. It uses the Evolution Data Server
to sync PIM data in Evolution, but a plain file storage is also supported.
Data exchange can happen via HTTP(S) and Bluetooth. Full, one-way and
incremental synchronization of items are supported. SyncEvolution can act as
a SyncML/DAV client and SyncML server.
.
This package provides a shared library.

280
debian/copyright vendored
View File

@ -1,280 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: SyncEvolution
Upstream-Contact: https://gitlab.freedesktop.org/SyncEvolution/syncevolution/-/issues
Source: https://gitlab.freedesktop.org/SyncEvolution/syncevolution/
Files: *
Copyright:
2012 BMW Car IT GmbH.
2016 Emanoil Kotsev <emanoil.kotsev@fincom.at>
2008 Funambol, Inc.
2009, 2011-2012 Intel Corporation
2009 m-otion communications GmbH <knipp@m-otion.com>
2005-2009 Patrick Ohly <patrick.ohly@gmx.de>
2011 Symbio, Ville Nummela
2004-2008 Synthesis AG
License-Grant:
This library is free software;
you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation;
either version 2.1 of the License, or (at your option) version 3.
License: LGPL-2.1 or LGPL-3
Comment:
Files below <src/backends/webdav/*> lack licensing.
Licensing of those files is assumed same as generally for the project.
Files:
build/xsl/*
Copyright:
2003 Jiří Kosek
1999-2007 Norman Walsh
2011-2012 O'Reilly Media
2004-2007 Steve Ball
2005-2008 The DocBook Project
License: Expat~Docbook
Reference: build/xsl/COPYING
Files: m4-repo/*.m4
Copyright:
2008 Benjamin Kosnik <bkoz@redhat.com>
2014-2015 Google Inc.
2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
2016 Krzesimir Nowak <qdlacz@gmail.com>
2015 Moritz Klammler <moritz@klammler.eu>
2015 Paul Norman <penorman@mac.com>
2009 Peter Adolphs
2013 Roy Stogner <roystgnr@ices.utexas.edu>
2008 Thomas Porschberg <thomas@randspringer.de>
2012 Xiyue Deng <manphiz@gmail.com>
2012 Zack Weinberg <zackw@panix.com>
License: FSFAP
Files:
src/backends/akonadi/akonadisyncsource.cpp
src/backends/akonadi/akonadisyncsource.h
src/backends/akonadi/contactssyncsource.cpp
src/backends/akonadi/contactssyncsource.h
src/backends/akonadi/eventssyncsource.cpp
src/backends/akonadi/eventssyncsource.h
src/backends/akonadi/notessyncsource.cpp
src/backends/akonadi/notessyncsource.h
src/backends/akonadi/todossyncsource.cpp
src/backends/akonadi/todossyncsource.h
Copyright:
2009 Sascha Peilicke <sasch.pe@gmx.de>
License-Grant:
This application is free software;
you can redistribute it and/or modify it
under the terms of the GNU Library General Public License
as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
License: LGPL-2+
Files:
test/Algorith/Diff.pm
Copyright:
2000-2004 Ned Konz
2000-2004 Tye McQueen
License-Grant:
This program is free software;
you can redistribute it and/or modify it
under the same terms as Perl.
License: Artistic or GPL-1+
Comment:
Perl 5 is licensed under either the Artistic license
or the GNU General Public License version 1 or later.
Files:
src/syncevo/icaltz-util.c
src/syncevo/icaltz-util.h
Copyright:
2007 Novell, Inc.
License-Grant:
This program is free software;
you can redistribute it and/or modify it
under the terms of version 2
of the GNU Lesser General Public License
as published by the Free Software Foundation.
License: LGPL-2
Files:
src/gtk-ui/gtkinfobar.c
src/gtk-ui/gtkinfobar.h
Copyright:
2005 Paolo Maggi
License-Grant:
This library is free software;
you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
License: LGPL-2+
Files:
src/backends/tdepim/TDEPIMSyncSource.cpp
src/backends/tdepim/TDEPIMSyncSource.h
Copyright:
2016 Emanoil Kotsev <emanoil.kotsev@fincom.at>
License-Grant:
This application is free software;
you can redistribute it and/or modify it
under the terms of the GNU Library General Public License
as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
License: LGPL-2+
Files:
src/backends/evolution/e-cal-check-timezones.c
src/backends/evolution/e-cal-check-timezones.h
Copyright:
2008 Novell, Inc
2009 Patrick Ohly <patrick.ohly@gmx.de>
License-Grant:
This program is free software;
you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
License: LGPL-2+
Comment:
The granted license does not exist at described version.
Licensing assumed to be GNU Library General Public License 2.0 or newer.
Files: src/dbus/interfaces/spec-to-docbook.xsl
Copyright: 2007, William Jon McCann
License-Grant:
License: GPL
License: GPL-1+
Files:
m4-repo/dk-warn.m4
Copyright:
2004-2007 Daniel Elstner <daniel.kitta@gmail.com>
License-Grant:
danielk's Autostuff is free software;
you can redistribute it and/or modify it
under the terms of the GNU General Public License
as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
License: GPL-2+
Files:
m4-repo/autotroll.m4
autotroll.am
Copyright:
2006-2007, 2009-2010 Benoit Sigoure <benoit.sigoure@lrde.epita.fr>
License-Grant:
AutoTroll is free software;
you can redistribute it and/or modify it
under the terms of the GNU General Public License
as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
License: GPL-2+ with Autoconf-2.0~AutoTroll exception
In addition, as a special exception,
the copyright holders of AutoTroll give you unlimited permission
to copy, distribute and modify the configure scripts
that are the output of Autoconf
when processing the macros of AutoTroll.
You need not follow the terms of the GNU General Public License
when using or distributing such scripts,
even though portions of the text of AutoTroll appear in them.
The GNU General Public License (GPL) does govern
all other use of the material that constitutes AutoTroll.
.
This special exception to the GPL applies
to versions of AutoTroll released
by the copyright holders of AutoTroll.
Note that people who make
modified versions of AutoTroll are not obligated
to grant this special exception for their modified versions;
it is their choice whether to do so.
The GNU General Public License gives permission
to release a modified version without this exception;
this exception also makes it possible to release
a modified version which carries forward this exception.
Files:
build/gen-changelog.pl
Copyright:
2009 Emmanuele Bassi <ebassi@gnome.org>
License-Grant:
This program is free software.
It can be distributed and/or modified
under the terms of Perl itself.
License: GPL-1+ or Artistic
Comment:
Perl 5 is licensed under either the Artistic license
or the GNU General Public License version 1 or later.
Files:
debian/*
Copyright:
2009 David Bremner
2021 Jonas Smedegaard <dr@jones.dk>
License-Grant:
This packaging is free software;
you can redistribute it and/or modify it
under the terms of the GNU General Public License
as published by the Free Software Foundation;
version 3.
License: GPL-3
Reference: debian/copyright
License: Artistic
Reference: /usr/share/common-licenses/Artistic
License: Expat~Docbook
Permission is hereby granted, free of charge,
to any person obtaining a copy
of this software and associated documentation files (the "Software"),
to deal in the Software without restriction,
including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
.
The above copyright notice and this permission notice
shall be included in all copies or substantial portions of the Software.
.
Except as contained in this notice,
the names of individuals credited with contribution to this software
shall not be used in advertising or otherwise
to promote the sale, use or other dealings in this Software
without prior written authorization from the individuals in question.
.
Any stylesheet derived from this Software
that is publically distributed
will be identified with a different name
and the version strings in any derived Software will be changed
so that no possibility of confusion
between the derived package and this Software will exist.
License: FSFAP
Copying and distribution of this file,
with or without modification,
are permitted in any medium without royalty
provided the copyright notice and this notice are preserved
This file is offered as-is, without any warranty.
License: GPL-1+
Reference: /usr/share/common-licenses/GPL-1
License: GPL-2+
Reference: /usr/share/common-licenses/GPL-2
License: GPL-3
Reference: /usr/share/common-licenses/GPL-3
License: LGPL-2
Reference: /usr/share/common-licenses/LGPL-2
License: LGPL-2+
Reference: /usr/share/common-licenses/LGPL-2
License: LGPL-2.1
Reference: /usr/share/common-licenses/LGPL-2.1
License: LGPL-3
Reference: /usr/share/common-licenses/LGPL-3

View File

@ -1,3 +0,0 @@
#!/bin/sh
licensecheck --check '.*' --recursive --copyright --deb-machine --ignore '^(debian/(changelog|copyright(_hints)?))$' --lines 0 -- * > debian/copyright_hints

1188
debian/copyright_hints vendored

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More