1 Nov 2010 13:05
r6465 - in trunk/sandbox/xml2rst: . global.log rst/ rst/__init__.py rst/rst_xslt.py rst/xml2rst-noexslt.xsl rst/xml2rst.xsl setup.py tag.log version.py xml2rst-noexslt.xsl xml2rst.py xml2rst.xsl
<smerten <at> users.berlios.de>
2010-11-01 12:05:38 GMT
2010-11-01 12:05:38 GMT
Author: smerten
Date: 2010-11-01 13:05:38 +0100 (Mon, 01 Nov 2010)
New Revision: 6465
Added:
trunk/sandbox/xml2rst/global.log
trunk/sandbox/xml2rst/rst/
trunk/sandbox/xml2rst/rst/__init__.py
trunk/sandbox/xml2rst/rst/rst_xslt.py
trunk/sandbox/xml2rst/rst/xml2rst-noexslt.xsl
trunk/sandbox/xml2rst/rst/xml2rst.xsl
trunk/sandbox/xml2rst/setup.py
trunk/sandbox/xml2rst/tag.log
trunk/sandbox/xml2rst/version.py
Removed:
trunk/sandbox/xml2rst/xml2rst-noexslt.xsl
trunk/sandbox/xml2rst/xml2rst.xsl
Modified:
trunk/sandbox/xml2rst/
trunk/sandbox/xml2rst/xml2rst.py
Log:
Added `setup.py`.
Property changes on: trunk/sandbox/xml2rst
___________________________________________________________________
Added: svn:ignore
+ xml2rst.pod
xml2rst.html
tests.tgz
.dist.ok
dist
version.gmk
.tests.ok
.build.ok
.cvsignore
.svnignore
build
MANIFEST
MANIFEST.in
.*.gmk
Makefile
CVS
docs
Added: trunk/sandbox/xml2rst/global.log
===================================================================
--- trunk/sandbox/xml2rst/global.log (rev 0)
+++ trunk/sandbox/xml2rst/global.log 2010-11-01 12:05:38 UTC (rev 6465)
<at> <at> -0,0 +1,3647 <at> <at>
+**************************************
+Date: Mon Nov 1 10:56:42 CET 2010
+Author: stefan
+Tag: xml2rst_1_196
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ Makefile
+
+--------------------------------------
+Log Message:
+Minor improvement.
+
+A full test using all processors can be made.
+**************************************
+Date: Mon Nov 1 10:48:03 CET 2010
+Author: stefan
+Tag: xml2rst_1_195
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ Makefile setup.py
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/rst
+In directory rosalu:/home/stefan/free/xml2rst/rst
+
+Modified Files:
+ .cvsignore
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options/input
+In directory rosalu:/home/stefan/free/xml2rst/tests/options/input
+
+Modified Files:
+ adornmentDefault.xsltproc adornmentEmacs.xsltproc
+ adornmentReverse.xsltproc fold20.xsltproc fold70.xsltproc
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xalan
+In directory rosalu:/home/stefan/free/xml2rst/tests.xalan
+
+Modified Files:
+ common.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc
+
+Modified Files:
+ common.cfg
+
+--------------------------------------
+Log Message:
+Version not using EXSLT is generated.
+**************************************
+Date: Mon Nov 1 10:24:28 CET 2010
+Author: stefan
+Tag: xml2rst_1_194
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ Makefile setup.py xml2rst.py
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/rst
+In directory rosalu:/home/stefan/free/xml2rst/rst
+
+Added Files:
+ .cvsignore rst_xslt.py
+
+--------------------------------------
+Log Message:
+Refactoring to become a real writer. Functional code moved to an own
+module.
+**************************************
+Date: Mon Nov 1 09:47:04 CET 2010
+Author: stefan
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/rst
+In directory rosalu:/home/stefan/free/xml2rst/rst
+
+
+--------------------------------------
+Log Message:
+Directory /home/stefan/vault/sm/xml2rst/rst added to the repository
+**************************************
+Date: Sun Oct 31 21:24:46 CET 2010
+Author: stefan
+Tag: xml2rst_1_193
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ Makefile
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options
+In directory rosalu:/home/stefan/free/xml2rst/tests/options
+
+Added Files:
+ .cvsignore
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options/expected
+In directory rosalu:/home/stefan/free/xml2rst/tests/options/expected
+
+Added Files:
+ adornmentDefault.rst adornmentEmacs.rst adornmentReverse.rst
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options/input
+In directory rosalu:/home/stefan/free/xml2rst/tests/options/input
+
+Added Files:
+ .cvsignore
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/real
+In directory rosalu:/home/stefan/free/xml2rst/tests/real
+
+Added Files:
+ .cvsignore
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests/simple
+
+Added Files:
+ .cvsignore
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic
+
+Added Files:
+ .cvsignore
+
+--------------------------------------
+Log Message:
+Added forgotten files and ingores.
+**************************************
+Date: Sat Oct 30 14:14:15 CEST 2010
+Author: stefan
+Tag: xml2rst_1_192
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ Makefile xml2rst.py
+Added Files:
+ setup.py
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/rst_xslt
+In directory rosalu:/home/stefan/free/xml2rst/rst_xslt
+
+Added Files:
+ __init__.py
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options
+In directory rosalu:/home/stefan/free/xml2rst/tests/options
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/real
+In directory rosalu:/home/stefan/free/xml2rst/tests/real
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests/simple
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Log Message:
+Added `setup.py`.
+**************************************
+Date: Sat Oct 30 14:05:17 CEST 2010
+Author: stefan
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/rst_xslt
+In directory rosalu:/home/stefan/free/xml2rst/rst_xslt
+
+
+--------------------------------------
+Log Message:
+Directory /home/stefan/vault/sm/xml2rst/rst_xslt added to the repository
+**************************************
+Date: Sat Oct 30 13:34:19 CEST 2010
+Author: stefan
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst/xml2rst
+
+
+--------------------------------------
+Log Message:
+Directory /home/stefan/vault/sm/xml2rst/xml2rst added to the repository
+**************************************
+Date: Tue Oct 26 15:41:17 CEST 2010
+Author: stefan
+Tag: xml2rst_1_191
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ Makefile
+
+--------------------------------------
+Log Message:
+`Makefile` uses `packageSupport`.
+**************************************
+Date: Sun Oct 24 13:24:32 CEST 2010
+Author: stefan
+Tag: xml2rst_1_190
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ Makefile
+
+--------------------------------------
+Log Message:
+`dist` is used for packages.
+**************************************
+Date: Mon Apr 19 11:27:16 CEST 2010
+Author: stefan
+Tag: xml2rst_1_189
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/simple/expected
+In directory paulla:/home/stefan/free/xml2rst/tests/simple/expected
+
+Added Files:
+ titles.rst
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/simple/original
+In directory paulla:/home/stefan/free/xml2rst/tests/simple/original
+
+Added Files:
+ titles.rst
+
+--------------------------------------
+Log Message:
+Added tests.
+**************************************
+Date: Sun Mar 14 19:13:20 CET 2010
+Author: stefan
+Tag: xml2rst_1_188
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xalan
+In directory rosalu:/home/stefan/free/xml2rst/tests.xalan
+
+Added Files:
+ common.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xalan/real
+In directory rosalu:/home/stefan/free/xml2rst/tests.xalan/real
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xalan/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests.xalan/simple
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xalan/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests.xalan/synthetic
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc
+
+Added Files:
+ common.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc/real
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc/real
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc/simple
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc/synthetic
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Log Message:
+Improved test infrastructure.
+**************************************
+Date: Sun Mar 14 18:40:08 CET 2010
+Author: stefan
+Tag: xml2rst_1_187
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Documentation improved.
+**************************************
+Date: Thu Dec 24 13:51:00 CET 2009
+Author: stefan
+Tag: xml2rst_1_186
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ Makefile
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests
+In directory rosalu:/home/stefan/free/xml2rst/tests
+
+Added Files:
+ Makefile rules.gmk
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options
+In directory rosalu:/home/stefan/free/xml2rst/tests/options
+
+Added Files:
+ Makefile
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/real
+In directory rosalu:/home/stefan/free/xml2rst/tests/real
+
+Added Files:
+ Makefile
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests/simple
+
+Added Files:
+ Makefile
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic
+
+Added Files:
+ Makefile
+
+--------------------------------------
+Log Message:
+Added `Makefile`s to create supplemental test files.
+**************************************
+Date: Thu Dec 24 12:14:40 CET 2009
+Author: stefan
+Tag: xml2rst_1_185
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ Makefile
+
+--------------------------------------
+Log Message:
+Packaging is supported.
+**************************************
+Date: Thu Dec 24 11:44:43 CET 2009
+Author: stefan
+Tag: xml2rst_1_184
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Added Files:
+ Makefile
+
+--------------------------------------
+Log Message:
+First steps in making this a real package.
+**************************************
+Date: Wed Dec 23 00:43:54 CET 2009
+Author: stefan
+Tag: xml2rst_1_183
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options/input
+In directory rosalu:/home/stefan/free/xml2rst/tests/options/input
+
+Added Files:
+ adornmentDefault.opt adornmentDefault.xsltproc
+ adornmentEmacs.opt adornmentEmacs.xsltproc
+ adornmentReverse.opt adornmentReverse.xsltproc
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options/original
+In directory rosalu:/home/stefan/free/xml2rst/tests/options/original
+
+Added Files:
+ adornmentX.rst
+
+--------------------------------------
+Log Message:
+Added tests for options.
+**************************************
+Date: Wed Dec 23 00:21:56 CET 2009
+Author: stefan
+Tag: xml2rst_1_182
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.py
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options
+In directory rosalu:/home/stefan/free/xml2rst/tests/options
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options/expected
+In directory rosalu:/home/stefan/free/xml2rst/tests/options/expected
+
+Added Files:
+ fold20.rst fold70.rst
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options/input
+In directory rosalu:/home/stefan/free/xml2rst/tests/options/input
+
+Added Files:
+ fold20.opt fold20.xsltproc fold70.opt fold70.xsltproc
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/options/original
+In directory rosalu:/home/stefan/free/xml2rst/tests/options/original
+
+Added Files:
+ foldX.rst
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc/options
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc/options
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Log Message:
+Added parameter processing in scripts and tests.
+**************************************
+Date: Tue Dec 22 23:29:37 CET 2009
+Author: stefan
+Tag: xml2rst_1_181
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.py xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Minor improvements.
+**************************************
+Date: Sun Dec 20 14:36:22 CET 2009
+Author: stefan
+Tag: xml2rst_1_180
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added more EXSLT.
+**************************************
+Date: Sun Dec 20 14:35:04 CET 2009
+Author: stefan
+Tag: xml2rst_1_179
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added more EXSLT.
+**************************************
+Date: Wed Dec 16 23:25:27 CET 2009
+Author: stefan
+Tag: xml2rst_1_178
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added more EXSLT.
+**************************************
+Date: Tue Dec 15 23:49:38 CET 2009
+Author: stefan
+Tag: xml2rst_1_177
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added more EXSLT.
+**************************************
+Date: Tue Dec 15 23:11:39 CET 2009
+Author: stefan
+Tag: xml2rst_1_176
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added more EXSLT.
+**************************************
+Date: Sun Dec 13 15:21:23 CET 2009
+Author: stefan
+Tag: xml2rst_1_175
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added more EXSLT.
+**************************************
+Date: Sat Dec 12 20:25:33 CET 2009
+Author: stefan
+Tag: xml2rst_1_174
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.py xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/real
+In directory rosalu:/home/stefan/free/xml2rst/tests/real
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests/simple
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/real
+In directory rosalu:/home/stefan/free/xml2rst/tests.py/real
+
+Removed Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests.py/simple
+
+Removed Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests.py/synthetic
+
+Removed Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xalan/real
+In directory rosalu:/home/stefan/free/xml2rst/tests.xalan/real
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xalan/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests.xalan/simple
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xalan/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests.xalan/synthetic
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Log Message:
+Starting with this version the EXSLT extensions are used.
+
+Xalan does not support enough of EXSLT so those unit tests don't run
+any more. These tests are moved to `tests.xalan` while the script
+based tests formerly under `tests.py` are moved to `tests`.
+
+Replaced `u:quoteWhite` by EXSLT.
+**************************************
+Date: Sat Dec 12 20:12:21 CET 2009
+Author: stefan
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xalan
+In directory rosalu:/home/stefan/free/xml2rst/tests.xalan
+
+
+--------------------------------------
+Log Message:
+Directory /home/stefan/vault/sm/xml2rst/tests.xalan added to the repository
+**************************************
+Date: Sat Dec 12 15:33:01 CET 2009
+Author: stefan
+Tag: xml2rst_1_173
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/real
+In directory rosalu:/home/stefan/free/xml2rst/tests.py/real
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests.py/simple
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests.py/synthetic
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc/real
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc/real
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc/simple
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc/synthetic
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Log Message:
+Added tests using `xsltproc`.
+**************************************
+Date: Sat Dec 12 15:31:21 CET 2009
+Author: stefan
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc/real
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc/real
+
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc/simple
+
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc/synthetic
+
+
+--------------------------------------
+Log Message:
+Directory /home/stefan/vault/sm/xml2rst/tests.xsltproc/real added to the repository
+
+Directory /home/stefan/vault/sm/xml2rst/tests.xsltproc/simple added to the repository
+
+Directory /home/stefan/vault/sm/xml2rst/tests.xsltproc/synthetic added to the repository
+**************************************
+Date: Sat Dec 12 15:31:08 CET 2009
+Author: stefan
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.xsltproc
+In directory rosalu:/home/stefan/free/xml2rst/tests.xsltproc
+
+
+--------------------------------------
+Log Message:
+Directory /home/stefan/vault/sm/xml2rst/tests.xsltproc added to the repository
+**************************************
+Date: Sat Dec 12 15:15:19 CET 2009
+Author: stefan
+Tag: xml2rst_1_172
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/real
+In directory rosalu:/home/stefan/free/xml2rst/tests.py/real
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests.py/simple
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests.py/synthetic
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Log Message:
+Improved test configuration.
+**************************************
+Date: Fri Dec 11 17:47:58 CET 2009
+Author: stefan
+Tag: xml2rst_1_171
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.py
+
+--------------------------------------
+Log Message:
+Trailing linefeed is chopped. Tests run.
+**************************************
+Date: Sat Dec 5 18:31:05 CET 2009
+Author: stefan
+Tag: xml2rst_1_170
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.py xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Adapted stylesheet slightly so libxslt doesn't normalize the linefeed
+in `<text>
+</text>` away.
+**************************************
+Date: Thu Nov 26 18:22:51 CET 2009
+Author: stefan
+Tag: xml2rst_1_169
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.py
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/real
+In directory paulla:/home/stefan/free/xml2rst/tests.py/real
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/simple
+In directory paulla:/home/stefan/free/xml2rst/tests.py/simple
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py/synthetic
+In directory paulla:/home/stefan/free/xml2rst/tests.py/synthetic
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Log Message:
+Added testing for script. Tests fail.
+**************************************
+Date: Thu Nov 26 17:53:36 CET 2009
+Author: stefan
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests.py
+In directory paulla:/home/stefan/free/xml2rst/tests.py
+
+
+--------------------------------------
+Log Message:
+Directory /home/stefan/vault/sm/xml2rst/tests.py added to the repository
+**************************************
+Date: Thu Nov 26 17:48:24 CET 2009
+Author: stefan
+Tag: xml2rst_1_168
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.py
+
+--------------------------------------
+Log Message:
+Debugging.
+**************************************
+Date: Thu Nov 26 17:46:00 CET 2009
+Author: stefan
+Tag: xml2rst_1_167
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.py xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Made first attempt a real script.
+**************************************
+Date: Wed Nov 25 20:21:58 CET 2009
+Author: stefan
+Tag: xml2rst_1_166
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+Added Files:
+ xml2rst.py
+
+--------------------------------------
+Log Message:
+Added very first step to a script using the XSLT.
+**************************************
+Date: Sun Nov 8 22:49:56 CET 2009
+Author: stefan
+Tag: xml2rst_1_165
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added comment.
+**************************************
+Date: Sun Nov 8 22:10:39 CET 2009
+Author: stefan
+Tag: xml2rst_1_164
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Adapted copyright notice.
+**************************************
+Date: Mon Sep 21 08:46:52 CEST 2009
+Author: stefan
+Tag: xml2rst_1_163
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Removed TODO because it is not a xml2rst problem.
+**************************************
+Date: Tue Sep 15 23:03:29 CEST 2009
+Author: stefan
+Tag: xml2rst_1_162
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory paulla:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Modified Files:
+ standard_0_3_7.rst
+
+--------------------------------------
+Log Message:
+Corrected unit test.
+**************************************
+Date: Tue Sep 15 22:57:13 CEST 2009
+Author: stefan
+Tag: xml2rst_1_161
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Improved comments.
+**************************************
+Date: Tue Sep 15 22:48:36 CEST 2009
+Author: stefan
+Tag: xml2rst_1_160
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory paulla:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Modified Files:
+ standard_r6008.rst
+
+--------------------------------------
+Log Message:
+Inline raw is supported.
+**************************************
+Date: Sun Sep 13 12:51:30 CEST 2009
+Author: stefan
+Tag: xml2rst_1_159
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Modified Files:
+ standard_r6008.rst
+
+--------------------------------------
+Log Message:
+``align`` attribute of ``.. figure::`` is supported.
+**************************************
+Date: Sun Sep 13 12:39:39 CEST 2009
+Author: stefan
+Tag: xml2rst_1_158
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+``.. container::`` directive is supported.
+**************************************
+Date: Sat Sep 12 13:52:29 CEST 2009
+Author: stefan
+Tag: xml2rst_1_157
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/real
+In directory rosalu:/home/stefan/free/xml2rst/tests/real
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests/simple
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic
+
+Modified Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Modified Files:
+ standard_r6008.rst
+
+--------------------------------------
+Log Message:
+Added support for ``.. parsed-literal::``.
+**************************************
+Date: Sat Sep 12 13:21:43 CEST 2009
+Author: stefan
+Tag: xml2rst_1_156
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Modified Files:
+ standard_0_3_7.rst standard_r6008.rst
+
+--------------------------------------
+Log Message:
+Continuation lines in line work correctly.
+**************************************
+Date: Fri Sep 11 21:09:10 CEST 2009
+Author: stefan
+Tag: xml2rst_1_155
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+ <at> classes works for raw directive.
+**************************************
+Date: Fri Sep 11 21:06:10 CEST 2009
+Author: stefan
+Tag: xml2rst_1_154
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory paulla:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Modified Files:
+ standard_r6008.rst
+
+--------------------------------------
+Log Message:
+Removed things which are too hard to implement.
+**************************************
+Date: Fri Sep 11 21:01:02 CEST 2009
+Author: stefan
+Tag: xml2rst_1_153
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory paulla:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Added Files:
+ standard_r6008.rst
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/original
+In directory paulla:/home/stefan/free/xml2rst/tests/synthetic/original
+
+Added Files:
+ standard_r6008.rst
+
+--------------------------------------
+Log Message:
+ <at> ids and <at> names of images are no longer output.
+**************************************
+Date: Fri Sep 11 20:15:25 CEST 2009
+Author: stefan
+Tag: xml2rst_1_152
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Standard class for admonitions is taken into account.
+**************************************
+Date: Fri Sep 11 19:42:10 CEST 2009
+Author: stefan
+Tag: xml2rst_1_151
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory paulla:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Modified Files:
+ standard_0_3_7.rst
+
+--------------------------------------
+Log Message:
+Adapted target notes.
+**************************************
+Date: Fri Sep 11 18:57:59 CEST 2009
+Author: stefan
+Tag: xml2rst_1_150
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugging.
+**************************************
+Date: Fri Sep 11 18:33:40 CEST 2009
+Author: stefan
+Tag: xml2rst_1_149
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory paulla:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Modified Files:
+ class.rst
+
+--------------------------------------
+Log Message:
+Debugging.
+**************************************
+Date: Sat Sep 5 12:34:44 CEST 2009
+Author: stefan
+Tag: xml2rst_1_148
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Modified Files:
+ class.rst
+
+--------------------------------------
+Log Message:
+".. contents:: :local:" is supported.
+**************************************
+Date: Fri Sep 4 20:14:18 CEST 2009
+Author: stefan
+Tag: xml2rst_1_147
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory paulla:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Modified Files:
+ class.rst
+
+--------------------------------------
+Log Message:
+Debugging.
+**************************************
+Date: Sat Aug 22 21:43:38 CEST 2009
+Author: stefan
+Tag: xml2rst_1_146
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/real/expected
+In directory rosalu:/home/stefan/free/xml2rst/tests/real/expected
+
+Modified Files:
+ Machinery.rst MediaWikiFAQ.rst
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/simple/expected
+In directory rosalu:/home/stefan/free/xml2rst/tests/simple/expected
+
+Modified Files:
+ targets.rst
+
+--------------------------------------
+Log Message:
+Lists of names are processed correctly.
+**************************************
+Date: Sat Aug 22 19:36:42 CEST 2009
+Author: stefan
+Tag: xml2rst_1_145
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/real
+In directory rosalu:/home/stefan/free/xml2rst/tests/real
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/real/expected
+In directory rosalu:/home/stefan/free/xml2rst/tests/real/expected
+
+Added Files:
+ Machinery.rst MediaWikiFAQ.rst Technik.rst
+ WikiRequirements.rst
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/real/original
+In directory rosalu:/home/stefan/free/xml2rst/tests/real/original
+
+Added Files:
+ Machinery.rst MediaWikiFAQ.rst Technik.rst
+ WikiRequirements.rst
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/simple
+In directory rosalu:/home/stefan/free/xml2rst/tests/simple
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/simple/expected
+In directory rosalu:/home/stefan/free/xml2rst/tests/simple/expected
+
+Added Files:
+ header.rst manyLines.rst oneLine.rst targets.rst
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/simple/original
+In directory rosalu:/home/stefan/free/xml2rst/tests/simple/original
+
+Added Files:
+ header.rst manyLines.rst oneLine.rst targets.rst
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic
+
+Added Files:
+ filterunit.cfg
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/expected
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic/expected
+
+Added Files:
+ class.rst standard_0_3_7.rst
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests/synthetic/original
+In directory rosalu:/home/stefan/free/xml2rst/tests/synthetic/original
+
+Added Files:
+ class.rst standard_0_3_7.rst
+
+--------------------------------------
+Log Message:
+Added unit tests.
+**************************************
+Date: Sat Aug 22 19:34:11 CEST 2009
+Author: stefan
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst/tests
+In directory rosalu:/home/stefan/free/xml2rst/tests
+
+
+--------------------------------------
+Log Message:
+Directory /home/stefan/vault/sm/xml2rst/tests added to the repository
+**************************************
+Date: Thu Aug 20 23:53:50 CEST 2009
+Author: stefan
+Tag: xml2rst_1_144
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Adapted to new attribute names and semantics:
+
+* <at> id => <at> ids
+
+ May contain multiple ids seperated by spaces.
+
+* <at> name => <at> names
+
+ May contain quoted spaces and multiple names seperated by unquoted
+ spaces.
+
+* <at> dupname => <at> dupnames
+
+* <at> class => <at> classes
+
+ May contain multiple classes seperated by spaces.
+**************************************
+Date: Thu Aug 20 21:42:15 CEST 2009
+Author: stefan
+Tag: xml2rst_1_143
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added some comments.
+**************************************
+Date: Thu Aug 20 19:34:30 CEST 2009
+Author: stefan
+Tag: xml2rst_1_142
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Removed Files:
+ rst2xml.py
+
+--------------------------------------
+Log Message:
+Removed now superfluous script.
+**************************************
+Date: Mon Aug 17 12:19:05 CEST 2009
+Author: stefan
+Tag: xml2rst_1_141
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added some TODOs.
+**************************************
+Date: Thu Aug 3 09:10:06 CEST 2006
+Author: stefan
+Tag: xml2rst_1_140
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added comments.
+**************************************
+Date: Thu Jun 22 09:40:22 CEST 2006
+Author: stefan
+Tag: xml2rst_1_139
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added some todos to update to Docutils 0.4.
+**************************************
+Date: Wed Jun 14 09:30:50 CEST 2006
+Author: stefan
+Tag: xml2rst_1_138
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Improved class after transitions.
+**************************************
+Date: Wed Jun 14 09:26:51 CEST 2006
+Author: stefan
+Tag: xml2rst_1_137
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Improved class attributes after section titles.
+**************************************
+Date: Wed Jun 14 08:50:21 CEST 2006
+Author: stefan
+Tag: xml2rst_1_136
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+`figclass` attribute is supported.
+**************************************
+Date: Tue Jun 13 19:26:48 CEST 2006
+Author: stefan
+Tag: xml2rst_1_135
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+`contents` directive outputs class correctly.
+**************************************
+Date: Tue Jun 13 19:06:19 CEST 2006
+Author: stefan
+Tag: xml2rst_1_134
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Specific admonitions output class correctly.
+**************************************
+Date: Tue Jun 13 18:52:56 CEST 2006
+Author: stefan
+Tag: xml2rst_1_133
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Most class directives come out fine.
+**************************************
+Date: Tue Jun 13 09:54:15 CEST 2006
+Author: stefan
+Tag: xml2rst_1_132
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Improved output of class directive.
+**************************************
+Date: Tue Jun 13 09:14:39 CEST 2006
+Author: stefan
+Tag: xml2rst_1_131
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Merged bug fix on `V0_3_9` to current development version.
+**************************************
+Date: Tue Jun 13 09:11:30 CEST 2006
+Author: stefan
+Tag: xml2rst_1_130
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Reverted to `V0_3_8` and fixed a bug.
+**************************************
+Date: Tue Jun 13 08:55:22 CEST 2006
+Author: stefan
+Tag: xml2rst_1_129
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added comments.
+**************************************
+Date: Fri May 26 00:37:44 CEST 2006
+Author: stefan
+Tag: xml2rst_1_128
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added more support for `class` attribute. Many things are still wrong.
+**************************************
+Date: Thu May 25 23:22:07 CEST 2006
+Author: stefan
+Tag: xml2rst_1_127
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Started support for `class` attribute.
+**************************************
+Date: Sat Dec 17 12:22:35 CET 2005
+Author: stefan
+Tag: xml2rst_1_126
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+`inline' tag for user-defined roles supported.
+**************************************
+Date: Thu Dec 15 18:26:01 CET 2005
+Author: stefan
+Tag: xml2rst_1_125
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Folding works. Added TODOs for missing features.
+**************************************
+Date: Thu Dec 15 17:45:17 CET 2005
+Author: stefan
+Tag: xml2rst_1_124
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Folding improved. Still does not work for field bodies. Substiution
+bodies must fold. Quoted space must be handled special. Inline
+literals may need special handling.
+**************************************
+Date: Thu Dec 15 09:33:39 CET 2005
+Author: stefan
+Tag: xml2rst_1_123
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Folding works for inline elements. Field contents, line blocks, text
+in figures, generic admonitions need folding also.
+**************************************
+Date: Wed Dec 14 20:28:46 CET 2005
+Author: stefan
+Tag: xml2rst_1_122
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Removed most changes from `xml2rst_1_109' to `xml2rst_1_115'. Folding
+is not actively switched. This is a preparation for folding elements
+which explicitly fold considering inline elements. Folding code is
+retained.
+**************************************
+Date: Wed Dec 14 20:15:47 CET 2005
+Author: stefan
+Tag: xml2rst_1_121
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added some comments for correct folding considering inline elments
+also.
+**************************************
+Date: Sun Dec 11 16:57:16 CET 2005
+Author: stefan
+Tag: xml2rst_1_120
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Removed initial blank line for documents without ``title`` and
+``docinfo``.
+**************************************
+Date: Sun Dec 11 16:47:22 CET 2005
+Author: stefan
+Tag: xml2rst_1_119
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected compound element lists.
+**************************************
+Date: Sun Dec 11 16:04:02 CET 2005
+Author: stefan
+Tag: xml2rst_1_118
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Blank line added for paragraph after ``docinfo``.
+**************************************
+Date: Sat Dec 3 19:56:02 CET 2005
+Author: stefan
+Tag: xml2rst_1_117
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Changed standard adornment so section title adornment does not end in
+`::'.
+**************************************
+Date: Sat Nov 12 19:50:45 CET 2005
+Author: stefan
+Tag: xml2rst_1_116
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Enumerated list items are indented correctly and more nicely.
+**************************************
+Date: Sat Oct 1 19:21:07 CEST 2005
+Author: stefan
+Tag: xml2rst_1_115
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Classifiers do not fold.
+**************************************
+Date: Sat Oct 1 19:13:15 CEST 2005
+Author: stefan
+Tag: xml2rst_1_114
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected comment once more.
+**************************************
+Date: Sat Oct 1 19:11:08 CEST 2005
+Author: stefan
+Tag: xml2rst_1_113
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected comment.
+**************************************
+Date: Sat Oct 1 16:26:06 CEST 2005
+Author: stefan
+Tag: xml2rst_1_112
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugging for definition terms.
+**************************************
+Date: Fri Sep 30 18:01:29 CEST 2005
+Author: stefan
+Tag: xml2rst_1_111
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Folding now works fine. Inline markup is not considered, however.
+**************************************
+Date: Fri Sep 30 16:51:49 CEST 2005
+Author: stefan
+Tag: xml2rst_1_110
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added support for folding text chunks to a given length. Does not work
+with any inline markup.
+**************************************
+Date: Wed Sep 28 18:48:58 CEST 2005
+Author: stefan
+Tag: xml2rst_1_109
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Anonymous reference to explicit given URI is supported.
+**************************************
+Date: Thu Sep 1 16:31:46 CEST 2005
+Author: stefan
+Tag: xml2rst_1_108
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added TODO.
+**************************************
+Date: Fri Aug 19 17:33:19 CEST 2005
+Author: stefan
+Tag: xml2rst_1_107
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+For table columns too narrow for the contained text a warning is
+output.
+**************************************
+Date: Fri Aug 19 17:12:25 CEST 2005
+Author: stefan
+Tag: xml2rst_1_106
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Table title is rendered as correctly as possible.
+**************************************
+Date: Thu Aug 4 17:50:17 CEST 2005
+Author: stefan
+Tag: xml2rst_1_105
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Improved non-special bibliographic fields.
+**************************************
+Date: Thu Aug 4 17:37:54 CEST 2005
+Author: stefan
+Tag: xml2rst_1_104
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Clickable images to external targets are supported.
+**************************************
+Date: Sat Jul 30 15:41:13 CEST 2005
+Author: stefan
+Tag: xml2rst_1_103
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory paulla:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Minor improvements.
+**************************************
+Date: Thu Jul 21 21:55:52 CEST 2005
+Author: stefan
+Tag: xml2rst_1_102
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Improved comments.
+**************************************
+Date: Thu Jul 21 21:53:06 CEST 2005
+Author: stefan
+Tag: xml2rst_1_101
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Just to checkin.
+**************************************
+Date: Thu Jul 21 21:50:36 CEST 2005
+Author: stefan
+Tag: xml2rst_1_100
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added manual page.
+**************************************
+Date: Thu Jul 21 21:04:03 CEST 2005
+Author: stefan
+Tag: xml2rst_1_99
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ tag.log
+
+--------------------------------------
+Log Message:
+Corrected `tag.log'.
+**************************************
+Date: Thu Jul 21 21:00:01 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_98
+
+--------------------------------------
+Update of /home/stefan/vault/sm/xml2rst
+In directory rosalu:/home/stefan/free/xml2rst
+
+Modified Files:
+ global.log tag.log
+
+--------------------------------------
+Log Message:
+Moved `xml2rst.xsl' and other files to an own project.
+**************************************
+Date: Thu Jul 21 19:19:58 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_97
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Changed copyright.
+**************************************
+Date: Thu Jul 21 17:42:20 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_96
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ sdf2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugging. Sections are done correctly now.
+**************************************
+Date: Thu Jul 21 17:26:50 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_95
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ sdf2rst.xsl
+
+--------------------------------------
+Log Message:
+Restructured section generation. Does not work fully.
+**************************************
+Date: Thu Jul 21 11:32:24 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_94
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ sdf2rst.xsl
+
+--------------------------------------
+Log Message:
+Continued section generation.
+**************************************
+Date: Tue Jul 19 10:18:04 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_93
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ sdf2rst.xsl
+
+--------------------------------------
+Log Message:
+Headers called in `topLevel' behave correctly.
+**************************************
+Date: Mon Jul 18 20:52:30 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_92
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ sdf2rst.xsl
+
+--------------------------------------
+Log Message:
+Added more support for generating sections.
+**************************************
+Date: Mon Jul 18 20:03:06 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_91
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ sdf2rst.xsl
+
+--------------------------------------
+Log Message:
+Clarified use of modes.
+**************************************
+Date: Mon Jul 18 19:30:41 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_90
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ sdf2rst.xsl
+
+--------------------------------------
+Log Message:
+Implicit section before the first header is somewhat supported.
+**************************************
+Date: Mon Jul 18 16:35:45 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_89
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ sdf2rst.xsl
+
+--------------------------------------
+Log Message:
+First code for creating sections.
+**************************************
+Date: Sun Jul 17 23:12:29 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_88
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ sdf2rst.xsl
+
+--------------------------------------
+Log Message:
+Added conversion of some document level SDF constructs.
+**************************************
+Date: Sun Jul 17 21:18:35 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_87
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ sdf2rst.xsl
+
+--------------------------------------
+Log Message:
+Resolved namespace issues.
+**************************************
+Date: Sun Jul 17 18:40:17 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_86
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Added Files:
+ sdf2rst.xsl
+
+--------------------------------------
+Log Message:
+Added a copy of `sdf2ot.xsl' more or less unmodified.
+**************************************
+Date: Sat Jul 16 18:40:11 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_85
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added GPL.
+**************************************
+Date: Sat Jul 16 18:34:41 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_84
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected blank lining of `legend's and `figure's.
+
+Several minor improvments.
+
+Improved comments.
+**************************************
+Date: Sat Jul 16 16:09:11 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_83
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Special `block_quote's are supported.
+**************************************
+Date: Sat Jul 16 11:14:43 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_82
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Table entries with multiple lines are supported.
+**************************************
+Date: Sat Jul 16 10:21:45 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_81
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Rearranged code.
+**************************************
+Date: Sat Jul 16 10:16:56 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_80
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added code for multiple line entries in tables.
+**************************************
+Date: Fri Jul 15 19:49:13 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_79
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+".. section-numbering" is now generated.
+**************************************
+Date: Thu Jul 14 21:59:53 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_78
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Rendering of admonitions improved.
+**************************************
+Date: Thu Jul 14 21:24:19 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_77
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Quoted literal blocks are supported.
+**************************************
+Date: Thu Jul 14 18:05:35 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_76
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Enumerated lists have counting enumerators.
+**************************************
+Date: Thu Jul 14 17:42:46 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_75
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+`enumerated_list/list_item' is indented correctly.
+**************************************
+Date: Thu Jul 14 17:23:48 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_74
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Improved blank lining of `substitution_definition'.
+**************************************
+Date: Thu Jul 14 08:45:08 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_73
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Improved indentation.
+**************************************
+Date: Wed Jul 13 21:20:06 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_72
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected blank lining for `citation'.
+**************************************
+Date: Wed Jul 13 21:14:44 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_71
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected blank lining for `line_block's.
+**************************************
+Date: Wed Jul 13 19:17:19 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_70
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected blank lining for footnotes.
+**************************************
+Date: Wed Jul 13 19:13:58 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_69
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected blank lining for compounds.
+**************************************
+Date: Wed Jul 13 19:04:38 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_68
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected blank lining for some titled elements.
+**************************************
+Date: Wed Jul 13 18:36:48 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_67
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected blank lining for lists.
+**************************************
+Date: Sat Jul 9 23:06:26 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_66
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Minor rearrangements.
+**************************************
+Date: Fri Jul 8 18:17:26 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_65
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Minor corrections.
+**************************************
+Date: Fri Jul 8 08:53:01 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_64
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected blank lines for field bodies.
+**************************************
+Date: Thu Jul 7 20:23:27 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_63
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Correction.
+**************************************
+Date: Thu Jul 7 20:16:45 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_62
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added some comments putting the element classification to the
+respective template.
+**************************************
+Date: Wed Jul 6 01:16:43 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_61
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Imroved comments.
+**************************************
+Date: Wed Jul 6 00:33:51 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_60
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Multi-column entries in tables are considered correctly.
+**************************************
+Date: Mon Jul 4 22:00:33 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_59
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added some comments.
+**************************************
+Date: Mon Jul 4 21:54:47 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_58
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added some support for multi-column table entries.
+**************************************
+Date: Mon Jul 4 21:15:54 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_57
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Support added for simple tables with single-line rows and no spanning
+columns.
+**************************************
+Date: Mon Jul 4 20:39:28 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_56
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added some documentation for tables.
+
+Basic support for tables.
+**************************************
+Date: Mon Jul 4 17:29:03 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_55
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Removed superfluous comments.
+**************************************
+Date: Mon Jul 4 17:24:08 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_54
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Section with system messages is ignored.
+**************************************
+Date: Mon Jul 4 17:21:20 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_53
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added support for `raw'.
+**************************************
+Date: Mon Jul 4 16:49:37 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_52
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugged indendation for `literal_block'.
+**************************************
+Date: Mon Jul 4 16:37:40 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_51
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added support for `compound'.
+**************************************
+Date: Mon Jul 4 16:20:43 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_50
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added support for `substitution_definition'.
+**************************************
+Date: Mon Jul 4 15:40:39 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_49
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Directive `target-notes' added.
+**************************************
+Date: Mon Jul 4 14:41:25 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_48
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Parameters for figure indented correctly.
+**************************************
+Date: Mon Jul 4 12:44:40 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_47
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Clickable images are supported.
+**************************************
+Date: Sun Jul 3 21:09:33 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_46
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added anonymous targets.
+**************************************
+Date: Sun Jul 3 20:57:41 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_45
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugged footnotes.
+**************************************
+Date: Sun Jul 3 20:38:36 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_44
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added support for `doctest_block'.
+**************************************
+Date: Sun Jul 3 20:05:35 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_43
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected blank lines once again.
+**************************************
+Date: Sat Jul 2 00:48:16 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_42
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected indendation for `line_block's.
+**************************************
+Date: Sat Jul 2 00:27:40 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_41
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Implemented `line_block's according to current standard.
+**************************************
+Date: Fri Jul 1 18:14:00 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_40
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected indentation for indented line blocks.
+**************************************
+Date: Thu Jun 30 19:20:08 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_39
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Removed non-working support for fully minimized markup for literal
+blocks.
+**************************************
+Date: Thu Jun 30 19:12:39 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_38
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Minor changes.
+**************************************
+Date: Thu Jun 30 18:47:42 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_37
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugged spacing after definition items.
+**************************************
+Date: Thu Jun 30 18:35:22 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_36
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Improved insertion of blank lines once more.
+**************************************
+Date: Wed Jun 29 21:33:27 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_35
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Targets of embedded references handles correctly.
+**************************************
+Date: Wed Jun 29 20:51:22 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_34
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Insertion of blank lines seems correct now.
+**************************************
+Date: Tue Jun 28 21:23:04 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_33
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Improved empty lines after section titles.
+**************************************
+Date: Tue Jun 28 20:57:03 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_32
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Target directives are also indented correctly.
+**************************************
+Date: Tue Jun 28 20:53:15 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_31
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added support for tag `problematic'.
+**************************************
+Date: Tue Jun 28 20:47:37 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_30
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Images support inline substitutions.
+**************************************
+Date: Mon Jun 27 21:27:23 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_29
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Tag lists are searched correctly.
+**************************************
+Date: Mon Jun 27 21:08:36 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_28
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugged and enhanced role rendering.
+**************************************
+Date: Mon Jun 27 20:46:39 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_27
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugged and improved target rendering.
+**************************************
+Date: Sat Jun 25 19:27:33 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_26
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Refactoring.
+**************************************
+Date: Sat Jun 25 19:07:52 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_25
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Enhanced generation of references.
+**************************************
+Date: Tue Jun 21 20:05:58 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_24
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Corrected some tests to use identity instead of equality.
+**************************************
+Date: Mon Jun 20 21:25:31 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_23
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Adornment for titles is configurable.
+**************************************
+Date: Mon Jun 20 20:38:47 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_22
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Titles take inline markup and generated nodes into account.
+**************************************
+Date: Mon Jun 20 20:09:46 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_21
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Multiline comments are indented correctly.
+**************************************
+Date: Sat Jun 18 00:34:30 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_20
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Modified indendation of some elements.x
+**************************************
+Date: Fri Jun 17 23:59:50 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_19
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugged generation of targets.
+**************************************
+Date: Fri Jun 17 20:19:48 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_18
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Backslash escaping of adjacent inline elements and text is done.
+**************************************
+Date: Thu Jun 16 20:26:16 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_17
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Inline markup is prefixed/suffixed by `\ ' in case it is
+preceded/followed directly by a wrong character (e.g. whitespace).
+**************************************
+Date: Thu Jun 16 19:38:27 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_16
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Removes stripping of spaces from source documents because this
+stripped runs of whitespace between inline elements.
+**************************************
+Date: Wed Jun 15 19:26:50 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_15
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugged indentation of paragraphs in list items.
+**************************************
+Date: Wed Jun 15 18:49:10 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_14
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugged embedded targets.
+**************************************
+Date: Wed Jun 15 18:45:27 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_13
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Debugged blank line insertion.
+**************************************
+Date: Tue Jun 14 18:47:46 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_12
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Identified some problems.
+**************************************
+Date: Thu Jun 9 21:21:59 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_11
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Removed one superfluous blank line before section headers.
+**************************************
+Date: Thu Jun 9 21:12:42 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_10
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Improved blank lines for lists.
+**************************************
+Date: Thu Jun 9 20:54:40 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_9
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Embedded links are generated correct.
+**************************************
+Date: Thu Jun 9 20:15:22 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_8
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory paulla:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Some more cosmetics and various notes added.
+**************************************
+Date: Sat May 28 01:13:43 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_7
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Heavy cosmetics.
+**************************************
+Date: Thu May 26 18:56:45 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_6
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added output of some blank lines. Phrase delimiters are only used for
+references needing them.
+**************************************
+Date: Thu May 26 18:14:27 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_5
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Cosmetic changes.
+**************************************
+Date: Thu May 26 17:43:00 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_4
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Modified Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Removed some marker characters probably for debugging purposes.
+**************************************
+Date: Thu May 26 17:07:50 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_3
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Added Files:
+ rst2xml.py
+
+--------------------------------------
+Log Message:
+Added `rst2xml.py' producing Docutils XML from reST input.
+**************************************
+Date: Thu May 26 17:05:02 CEST 2005
+Author: stefan
+Tag: sdf2rst_1_2
+
+--------------------------------------
+Update of /home/stefan/vault/sm/sdf2rst
+In directory rosalu:/home/stefan/prog/sdf2rst
+
+Added Files:
+ xml2rst.xsl
+
+--------------------------------------
+Log Message:
+Added original version of `xml2rst.xsl' by David Priest.
+
Property changes on: trunk/sandbox/xml2rst/rst
___________________________________________________________________
Added: svn:ignore
+ *.dtd
*.ced
Property changes on: trunk/sandbox/xml2rst/rst/__init__.py
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/sandbox/xml2rst/rst/rst_xslt.py
===================================================================
--- trunk/sandbox/xml2rst/rst/rst_xslt.py (rev 0)
+++ trunk/sandbox/xml2rst/rst/rst_xslt.py 2010-11-01 12:05:38 UTC (rev 6465)
<at> <at> -0,0 +1,81 <at> <at>
+###############################################################################
+###############################################################################
+# Import
+
+import os.path
+
+try:
+ from lxml import etree
+except ImportError:
+ raise Exception("""
+Python package 'lxml' is not available.
+You may try to use 'xml2rst.xsl' with a standalone XSLT processor like 'xalan' or 'xsltproc'""")
+
+###############################################################################
+###############################################################################
+# Constants
+
+"""
+ <at> var MainXsltNm: Name of the main XSLT source file
+ <at> type MainXsltNm: str
+"""
+MainXsltNm = "xml2rst.xsl"
+
+###############################################################################
+###############################################################################
+# Specialized functions
+
+def convert(inNm, outNm, settings):
+ """
+ Do the conversion.
+
+ <at> param inNm: Filename of input file.
+ <at> type inNm: str
+
+ <at> param outNm: Filename of output file or None.
+ <at> type outNm: str | None
+ """
+ try:
+ inF = open(inNm)
+ except IOError, e:
+ raise Exception("Can't open input file %r: %s" % ( inNm, e, ))
+
+ modP = os.path.dirname(__file__)
+ mainXsltNm = os.path.join(modP, MainXsltNm)
+ try:
+ mainXsltF = open(mainXsltNm)
+ except IOError, e:
+ raise Exception("Can't open main XSLT file %r: %s" % ( mainXsltNm, e, ))
+
+ xsltParser = etree.XMLParser()
+ mainXsltDoc = etree.parse(mainXsltF, xsltParser)
+ mainXsltF.close()
+ mainXslt = etree.XSLT(mainXsltDoc)
+
+ inParser = etree.XMLParser()
+ try:
+ inDoc = etree.parse(inF, inParser)
+ except Exception, e:
+ raise Exception("Error parsing input file %r: %s" % ( inNm, e, ))
+ inF.close()
+
+ xsltParams = { }
+ if settings.fold is not None:
+ xsltParams['fold'] = str(settings.fold)
+ if settings.adornment is not None:
+ xsltParams['adornment'] = "'" + settings.adornment + "'"
+ try:
+ result = mainXslt(inDoc, **xsltParams)
+ except Exception, e:
+ raise Exception("Error transforming input file %r: %s" % ( inNm, e, ))
+ # Chop off trailing linefeed - added somehow
+ outS = str(result)[:-1]
+ if outNm:
+ try:
+ outF = open(outNm, "w")
+ except IOError, e:
+ raise Exception("Can't open output file %r: %s" % ( outNm, e, ))
+ outF.write(outS)
+ outF.close()
+ else:
+ print(outS)
Property changes on: trunk/sandbox/xml2rst/rst/rst_xslt.py
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Copied: trunk/sandbox/xml2rst/rst/xml2rst-noexslt.xsl (from rev 6464, trunk/sandbox/xml2rst/xml2rst-noexslt.xsl)
===================================================================
--- trunk/sandbox/xml2rst/rst/xml2rst-noexslt.xsl (rev 0)
+++ trunk/sandbox/xml2rst/rst/xml2rst-noexslt.xsl 2010-11-01 12:05:38 UTC (rev 6465)
<at> <at> -0,0 +1,4136 <at> <at>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY CR "
">
+<!-- "xml:space='preserve'" is needed for use with libxslt -->
+<!-- "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'" is needed for
+ use with xsltproc -->
+<!-- Used to create a blank line -->
+<!ENTITY tCR "<xsl:text xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xml:space='preserve'>&CR;</xsl:text>">
+<!-- Used when the line before must be ended -->
+<!ENTITY tEOL "<xsl:text xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xml:space='preserve'>&CR;</xsl:text>">
+<!ENTITY tSP "<xsl:text xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xml:space='preserve'> </xsl:text>">
+]>
+
+<!--
+ Copyright (C) 2005, 2006, 2009 Stefan Merten, David Priest
+
+ xml2rst.xsl 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., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+-->
+
+<!-- ********************************************************************** -->
+<!-- ********************************************************************** -->
+
+<!-- These elements in the DTD need support:
+
+ - ``colspec`` has attribute "stub %yesorno; #IMPLIED"
+
+ - ``document`` has attribute "title CDATA #IMPLIED"
+
+ Probably rendered by the `.. title::` directive
+
+ -->
+
+<!--
+Set namespace extensions. These are used as [shortname]:[tag] throughout the
+XSL-FO files.
+xsl: eXtensible Stylesheet Language
+u: user extensions (indicates utility 'call-template' routines defined in
+these XSL files)
+data: Data elements used by the stylesheet
+-->
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:u="u"
+ xmlns:data="a"
+ exclude-result-prefixes="data">
+
+ <xsl:output
+ method="text"
+ omit-xml-declaration="yes"
+ indent="no"/>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!-- Parameter to configure title markup; see manual page for description -->
+ <xsl:param
+ name="adornment"
+ select="'o=o-u=u-u~u`u,u.'"/>
+
+ <!-- Parameter for folding long lines; see manual page for description -->
+ <xsl:param
+ name="fold"
+ select="0"/>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <xsl:variable
+ name="apos"
+ select='"'"'/>
+
+ <xsl:variable
+ name="structural_elements"
+ select="'*document*section*topic*sidebar*'"/>
+
+ <xsl:variable
+ name="structural_subelements"
+ select="'*title*subtitle*docinfo*decoration*transition*'"/>
+
+ <xsl:variable
+ name="bibliographic_elements"
+ select="'*address*author*authors*contact*copyright*date*field*organization*revision*status*version*'"/>
+
+ <xsl:variable
+ name="decorative_elements"
+ select="'*footer*header*'"/>
+
+ <xsl:variable
+ name="simple_body_elements_no_substitution"
+ select="'*comment*doctest_block*image*literal_block*paragraph*pending*raw*rubric*target*'"/>
+
+ <xsl:variable
+ name="folding_elements"
+ select="concat('*comment*paragraph*rubric*attribution*caption*line*', substring-after($bibliographic_elements, '*'))"/>
+
+ <xsl:variable
+ name="simple_body_elements"
+ select="concat($simple_body_elements_no_substitution, 'substitution_definition*')"/>
+
+ <xsl:variable
+ name="compound_body_elements"
+ select="'*admonition*attention*block_quote*bullet_list*caution*citation*compound*danger*definition_list*enumerated_list*error*field_list*figure*footnote*hint*important*line_block*note*option_list*system_message*table*tip*warning*container*'"/>
+
+ <xsl:variable
+ name="body_elements"
+ select="concat($simple_body_elements, substring-after($compound_body_elements, '*'))"/>
+
+ <xsl:variable
+ name="admonitions"
+ select="'*admonition*attention*caution*danger*error*hint*important*note*tip*warning*'"/>
+
+ <xsl:variable
+ name="simple_body_subelements"
+ select="'*attribution*caption*classifier*colspec*field_name*label*line*option_argument*option_string*term*'"/>
+
+ <xsl:variable
+ name="compound_body_subelements"
+ select="'*definition*definition_list_item*description*entry*field*field_body*legend*list_item*option*option_group*option_list_item*row*tbody*tgroup*thead*'"/>
+
+ <xsl:variable
+ name="inline_elements"
+ select="'*abbreviation*acronym*citation_reference*emphasis*footnote_reference*generated*image*inline*literal*problematic*reference*strong*subscript*substitution_reference*superscript*target*title_reference*raw*'"/>
+
+ <xsl:variable
+ name="inline_containers"
+ select="concat($simple_body_elements_no_substitution, substring-after($inline_elements, '*'))"/>
+
+ <xsl:variable
+ name="directives"
+ select="'*admonition*attention*caution*comment*danger*error*footnote*hint*important*note*tip*warning*image*figure*topic*sidebar*rubric*meta*raw*citation*compound*substitution_definition*container*'"/>
+
+ <xsl:variable
+ name="titled_elements"
+ select="'*sidebar*topic*admonition*'"/>
+
+ <xsl:variable
+ name="blank_after"
+ select="concat($structural_elements, substring-after($structural_subelements, '*'), substring-after($body_elements, '*'))"/>
+
+ <xsl:variable
+ name="adornment_characters"
+ select="concat($apos, '!"#$%&()*+,-./:;<=>? <at> [\]^_`{|}~')"/>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: ((title, subtitle?)?, docinfo?, decoration?,
+ %structure.model;)
+
+ Attributes: The document element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+
+ Depending on the source of the data and the stage of processing, the
+ "document" may not initially contain a "title". A document title is not
+ directly representable in reStructuredText. Instead, a lone top-level section
+ may have its title promoted to become the document title, and similarly for a
+ lone second-level (sub)section's title to become the document subtitle. The
+ "docinfo" may be transformed from an initial field_list, and "decoration" is
+ usually constructed programmatically.
+ -->
+ <!-- == structural_element -->
+ <xsl:template
+ match="document">
+ <xsl:if
+ test="//generated[ <at> classes = 'sectnum']">
+ <xsl:text>.. section-numbering::</xsl:text>
+ &tEOL;
+ &tCR;
+ </xsl:if>
+ <xsl:call-template
+ name="u:outputClass">
+ <xsl:with-param
+ name="blankAfter"
+ select="true()"/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (title, %structure.model;)
+ Attributes: The section element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == structural_element -->
+ <xsl:template
+ match="section">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:blank"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- == structural_element -->
+ <xsl:template
+ match="section[ <at> classes = 'system-messages']"/>
+ <!-- Ignore system messages completely -->
+ <!-- This should be really in `generated' -->
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (title, subtitle?, (%body.elements;)+)
+ Attributes: The sidebar element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == structural_element == directive -->
+ <xsl:template
+ match="sidebar">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. sidebar:: </xsl:text>
+ <xsl:value-of
+ select="title"/>
+ &tEOL;
+ <xsl:if
+ test="subtitle">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'subtitle'"/>
+ <xsl:with-param
+ name="value"
+ select="subtitle"/>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:call-template
+ name="u:params"/>
+ <!-- Always blank line after parameter block -->
+ &tCR;
+ <xsl:apply-templates
+ select="*[not(self::title) and not(self::subtitle)]"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (title?, (%body.elements;)+)
+ Attributes: The topic element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == structural_element == directive -->
+ <xsl:template
+ match="topic">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. topic:: </xsl:text>
+ <xsl:value-of
+ select="title"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:params"/>
+ <xsl:apply-templates
+ select="*[not(self::title)]"/>
+ </xsl:template>
+
+ <!-- == structural_element == directive -->
+ <xsl:template
+ match="topic[starts-with( <at> classes, 'contents')]">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. contents:: </xsl:text>
+ <xsl:apply-templates
+ select="title"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:params">
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'ids' and name() != 'names' and name() != 'classes']"/>
+ </xsl:call-template>
+ <xsl:variable
+ name="isLocal"
+ select="substring-before( <at> classes, ' local')"/>
+ <xsl:variable
+ name="realClassesLocal"
+ select="normalize-space(substring-after( <at> classes, 'contents'))"/>
+ <xsl:variable
+ name="realClassesNode">
+ <xsl:choose>
+ <xsl:when
+ test="$isLocal">
+ <xsl:value-of
+ select="normalize-space(substring-before($realClassesLocal, 'local'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$realClassesLocal"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable
+ name="realClasses"
+ select="string($realClassesNode)"/>
+ <xsl:if
+ test="$isLocal">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'local'"/>
+ <xsl:with-param
+ name="value"
+ select="''"/>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if
+ test="$realClasses">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'class'"/>
+ <xsl:with-param
+ name="value"
+ select="$realClasses"/>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- Autogenerated content is discarded -->
+ &tCR;
+ </xsl:template>
+
+ <!-- == structural_element == directive -->
+ <xsl:template
+ match="topic[ <at> classes='dedication' or <at> classes='abstract']">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>:</xsl:text>
+ <xsl:apply-templates
+ select="title"/>
+ <xsl:text>: </xsl:text>
+ &tEOL;
+ <xsl:apply-templates
+ select="*[not(self::title)]"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (title, (%body.elements;)+)
+ Attributes: The admonition element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="admonition">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. admonition:: </xsl:text>
+ <xsl:apply-templates
+ select="title"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:params">
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'classes' or not(starts-with(., 'admonition-'))]"/>
+ </xsl:call-template>
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:apply-templates
+ select="*[not(self::title)]"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)+
+ Attributes: The note element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="attention | caution | danger | error | hint | important | note | tip | warning">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. </xsl:text>
+ <xsl:value-of
+ select="name()"/>
+ <xsl:text>:: </xsl:text>
+ <xsl:call-template
+ name="u:params">
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'classes']"/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (header?, footer?)
+ Attributes: The decoration element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+
+ Although the content model doesn't specifically require contents, no empty
+ decoration elements are ever created.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="//document/decoration">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- TODO To be rendered as `.. header::` directive -->
+ <!-- == decorative_element -->
+ <xsl:template
+ match="//document/decoration/header">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- TODO To be rendered as `.. footer::` directive -->
+ <!-- == decorative_element -->
+ <xsl:template
+ match="//document/decoration/footer">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%bibliographic.elements;)+
+ Attributes: The docinfo element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="docinfo">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:blank"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: ((author, organization?, address?, contact?)+)
+ Attributes: The authors element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+
+ In reStructuredText, multiple author's names are separated with semicolons
+ (";") or commas (","); semicolons take precedence. There is currently no way
+ to represent the author's organization, address, or contact in a
+ reStructuredText "Authors" field.
+ -->
+ <!-- == bibliographic_element == folding_element -->
+ <xsl:template
+ match="docinfo/authors">
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>:</xsl:text>
+ <xsl:value-of
+ select="name()"/>
+ <xsl:text>: </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Content Model: %text.model;
+ Attributes: All docinfo elements contains the common attributes (ids,
+ names, dupnames, source, and classes)
+ Some docinfo elements also have xml:space.
+ -->
+ <xsl:template
+ match="docinfo/authors/*">
+ <xsl:apply-templates/>
+ <!-- no semicolon after final author -->
+ <xsl:if
+ test="generate-id(current()) != generate-id(../*[last()])">
+ <xsl:text>; </xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Content Model: (field_name, field_body)
+ Attributes: The field element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == bibliographic_element -->
+ <xsl:template
+ match="docinfo/field">
+ <!-- contents handled by ordinary field lists -->
+ <xsl:apply-templates/>
+ <!-- Supply an EOL because following elements do not recognize this -->
+ &tEOL;
+ </xsl:template>
+
+ <!--
+ Content Model: %text.model;
+ Attributes: All docinfo elements contains the common attributes (ids,
+ names, dupnames, source, and classes)
+ Some docinfo elements also have xml:space.
+ -->
+ <!-- == bibliographic_element == folding_element -->
+ <xsl:template
+ match="docinfo/*[name()!='authors' and name()!='field']">
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>:</xsl:text>
+ <xsl:value-of
+ select="name()"/>
+ <xsl:text>: </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: EMPTY
+ Attributes: The transition element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="transition">
+ <xsl:call-template
+ name="u:outputClass"/>
+ &tCR; <!-- req: blank line before -->
+ <xsl:text>-----</xsl:text>
+ &tEOL;
+ <!-- Add a required blank line after unless class follows immediately -->
+ <xsl:if
+ test="not(following-sibling::*[1]/ <at> classes)">
+ &tCR;
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!--
+ IFF there is a /document/title element, it is the publication's title. All
+ other titles will appear within sections.
+
+ Content Model: %text.model;
+ Attributes: The title element contains the common attributes (ids, names,
+ dupnames, source, and classes), plus refid and auto.
+ refid is used as a backlink to a table of contents entry.
+ auto is used to indicate (with value "1") that the title has been
+ numbered automatically.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="//document/title">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:variable
+ name="textWS">
+ <!-- Catch the title text as it is rendered so its length can be
+ determined -->
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <xsl:variable
+ name="text"
+ select="normalize-space($textWS)"/>
+ <xsl:variable
+ name="length"
+ select="string-length($text)"/>
+ <xsl:call-template
+ name="u:overline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="1"/>
+ </xsl:call-template>
+ <xsl:value-of
+ select="$text"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:underline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="1"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Title Underlines are defined by their position within the tree.
+
+ Content Model: %text.model;
+ Attributes: The title element contains the common attributes (ids, names,
+ dupnames, source, and classes), plus refid and auto.
+ refid is used as a backlink to a table of contents entry.
+ auto is used to indicate (with value "1") that the title has been
+ numbered automatically.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="section/title">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:variable
+ name="textWS">
+ <!-- catch the title text as it is rendered -->
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <xsl:variable
+ name="text"
+ select="normalize-space($textWS)"/>
+ <xsl:variable
+ name="length"
+ select="string-length($text)"/>
+ <xsl:variable
+ name="depth"
+ select="count(ancestor::section)"/>
+ <xsl:call-template
+ name="u:overline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="$depth + 2"/>
+ </xsl:call-template>
+ <xsl:value-of
+ select="$text"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:underline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="$depth + 2"/>
+ </xsl:call-template>
+ <!-- Add a blank line after unless structure follows immediately -->
+ <xsl:if
+ test="not(contains(concat($structural_elements, $compound_body_elements), concat('*', name(following-sibling::*[1]), '*')) or following-sibling::*[1]/ <at> classes)">
+ &tCR;
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The title element contains the common attributes (ids, names,
+ dupnames, source, and classes), plus refid and auto.
+ refid is used as a backlink to a table of contents entry.
+ auto is used to indicate (with value "1") that the title has been
+ numbered automatically.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="title">
+ <xsl:call-template
+ name="u:outputClass">
+ <xsl:with-param
+ name="alreadyBlanked"
+ select="true()"/>
+ </xsl:call-template>
+ <!-- blank line provided by parent -->
+ <xsl:apply-templates/>
+ <!-- no EOL: provided by parent -->
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ IFF there is a /document/title element, it is the publication's title. All
+ other titles will appear within sections.
+
+ Content Model: %text.model;
+ Attributes: The subtitle element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="//document/subtitle">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:variable
+ name="textWS">
+ <!-- Catch the title text as it is rendered -->
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <xsl:variable
+ name="text"
+ select="normalize-space($textWS)"/>
+ <xsl:variable
+ name="length"
+ select="string-length($text)"/>
+
+ <!-- always a blank line above -->
+ &tCR;
+ <xsl:call-template
+ name="u:overline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="2"/>
+ </xsl:call-template>
+ <xsl:value-of
+ select="$text"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:underline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="2"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The subtitle element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="sidebar/subtitle">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:apply-templates/>
+ &tEOL;
+ &tCR;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The comment element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_element == folding_element == directive -->
+ <xsl:template
+ match="comment">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>.. </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The doctest_block element contains the common attributes (ids,
+ names, dupnames, source, and classes), plus xml:space.
+ -->
+ <!-- == simple_body_element -->
+ <xsl:template
+ match="doctest_block">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:apply-templates/>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- An image element can have various roles; they are all covered here -->
+ <!-- == simple_body_element == inline_element == directive -->
+ <xsl:template
+ match="image">
+ <xsl:choose>
+ <xsl:when
+ test="contains($inline_containers, concat('*', name(..), '*')) and <at> alt">
+ <!-- An inline image with an ` <at> alt' - must be a substitution
+ reference -->
+ <xsl:text>|</xsl:text>
+ <!-- Original text is lost - use what we have -->
+ <xsl:value-of
+ select=" <at> alt"/>
+ <xsl:text>|</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- A directive -->
+ <xsl:if
+ test="not(parent::figure)">
+ <xsl:if
+ test="not(parent::substitution_definition)">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. </xsl:text>
+ </xsl:if>
+ <xsl:text>image:: </xsl:text>
+ </xsl:if>
+ <xsl:value-of
+ select=" <at> uri"/>
+ &tEOL;
+ <xsl:choose>
+ <xsl:when
+ test="parent::figure">
+ <!-- ` <at> classes' is special because it is in the parent -->
+ <xsl:if
+ test="../ <at> classes">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'figclass'"/>
+ <xsl:with-param
+ name="value"
+ select="../ <at> classes"/>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- ` <at> align' is special because it is in the parent -->
+ <xsl:if
+ test="../ <at> align">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'align'"/>
+ <xsl:with-param
+ name="value"
+ select="../ <at> align"/>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:call-template
+ name="u:params">
+ <!-- `figure' would add one level of indentation -->
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor::*"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when
+ test="parent::substitution_definition">
+ <xsl:call-template
+ name="u:params">
+ <!-- ` <at> alt' only for the real images -->
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'alt']"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:params">
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'ids' and name() != 'names']"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if
+ test="parent::reference">
+ <!-- A clickable image -->
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'target'"/>
+ <xsl:with-param
+ name="value">
+ <xsl:choose>
+ <xsl:when
+ test="../ <at> name">
+ <!-- An internal link -->
+ <xsl:call-template
+ name="u:inlineReference">
+ <xsl:with-param
+ name="text"
+ select="../ <at> refid"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- An external link -->
+ <xsl:value-of
+ select="../ <at> refuri"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- Always blank line after parameter block -->
+ &tCR;
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (line_block | line)+
+ Attributes: The line_block element contains the common attributes (ids,
+ names, dupnames, source, and classes), plus xml:space.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="line_block">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:variable
+ name="isEmbedded"
+ select="name(..) = 'line_block'"/>
+ <xsl:if
+ test="not($isEmbedded)">
+ <xsl:call-template
+ name="u:blank"/>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The line element contains the common attributes (ids,
+ names, dupnames, source, and classes).
+ -->
+ <!-- == simple_body_subelement == folding_element -->
+ <xsl:template
+ match="line">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:variable
+ name="indent">
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:variable>
+ <xsl:value-of
+ select="$indent"/>
+ <xsl:choose>
+ <xsl:when
+ test="node()">
+ <!-- Only for non-empty lines -->
+ <xsl:variable
+ name="lineBlockIndent">
+ <!-- Very special indendation for nested `line_block's -->
+ <xsl:for-each
+ select="ancestor::line_block[position() > 1]">
+ <xsl:call-template
+ name="u:repeat">
+ <xsl:with-param
+ name="length"
+ select="4"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>| </xsl:text>
+ <xsl:value-of
+ select="$lineBlockIndent"/>
+ </xsl:with-param>
+ <xsl:with-param
+ name="indent"
+ select="concat($indent, ' ', $lineBlockIndent)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>|</xsl:text>
+ &tEOL;
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The literal_block element contains the common attributes (ids,
+ names, dupnames, source, and classes), plus xml:space.
+ -->
+ <!-- == simple_body_element == directive -->
+ <xsl:template
+ match="literal_block">
+ <xsl:choose>
+ <xsl:when
+ test=".//*[contains($inline_elements, concat('*', name(), '*'))]">
+ <!-- If it contains inline elements this is a parsed-literal -->
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. parsed-literal::</xsl:text>
+ &tEOL;
+ <xsl:call-template
+ name="u:params"/>
+ &tCR;
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:outputClass"/>
+ <!-- TODO Support for the (fully) minimized style would be nice but
+ is difficult to accomplish because there is a linefeed
+ already when we arrive here :-( -->
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>::</xsl:text>
+ &tEOL;
+ &tCR;
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:variable
+ name="isQuotedLiteral">
+ <xsl:call-template
+ name="u:isQuotedLiteral"/>
+ </xsl:variable>
+ <!-- Indent correctly depending on quoted literal or not -->
+ <xsl:choose>
+ <xsl:when
+ test="string-length($isQuotedLiteral)">
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor::*"/>
+ </xsl:call-template>
+ <xsl:apply-templates
+ mode="quotedLiteral"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ &tEOL;
+ </xsl:template>
+
+ <!-- Indent a text of a quoted literal containing line feeds correctly -->
+ <xsl:template
+ match="text()"
+ mode="quotedLiteral">
+ <xsl:call-template
+ name="u:indentLF">
+ <xsl:with-param
+ name="indent">
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor::*[position() > 1]"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- Determine whether `$text' is a quoted literal and return the quote
+ character if so -->
+ <xsl:template
+ name="u:isQuotedLiteral">
+ <xsl:param
+ name="text"
+ select="text()"/>
+ <xsl:param
+ name="quote"
+ select="substring($text, 1, 1)"/>
+ <xsl:if
+ test="contains($adornment_characters, $quote) and substring($text, 1, 1) = $quote">
+ <!-- Given quote is an adornment character and first character is this
+ quote -->
+ <xsl:choose>
+ <xsl:when
+ test="contains($text, '
')">
+ <!-- Test the remaining lines -->
+ <xsl:call-template
+ name="u:isQuotedLiteral">
+ <xsl:with-param
+ name="text"
+ select="substring-after($text, '
')"/>
+ <xsl:with-param
+ name="quote"
+ select="$quote"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- No more lines to test so this is a quoted literal -->
+ <xsl:value-of
+ select="$quote"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The paragraph element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_element == folding_element -->
+ <xsl:template
+ match="paragraph">
+ <xsl:variable
+ name="previous"
+ select="preceding-sibling::*[1]"/>
+ <!-- Do indent except first element in some compound elements -->
+ <xsl:variable
+ name="needsIndent"
+ select="($previous or not(parent::list_item or parent::field_body or contains($admonitions, concat('*', name(..), '*')))) and name($previous) != 'label'"/>
+ <!-- Blank line in front if following a body element, except first
+ elements in some compound elements -->
+ <xsl:variable
+ name="needsBlank"
+ select="($previous or not(parent::list_item or ../parent::option_list_item or parent::field_body or parent::document or contains($admonitions, concat('*', name(..), '*')))) and (not($previous) or contains($body_elements, concat('*', name($previous), '*')) or name($previous) = 'title' and contains($titled_elements, concat('*', name(..), '*')) or name($previous) = 'docinfo')"/>
+ <xsl:if
+ test="$needsBlank">
+ &tCR;
+ </xsl:if>
+ <xsl:if
+ test="$needsIndent">
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:if>
+ <xsl:if
+ test=" <at> classes">
+ <!-- This paragraph has a classes attribute - always needs newline and
+ indent -->
+ <xsl:call-template
+ name="u:outputClass">
+ <xsl:with-param
+ name="alreadyBlanked"
+ select="$needsBlank"/>
+ <xsl:with-param
+ name="alreadyIndented"
+ select="$needsIndent"/>
+ </xsl:call-template>
+ <xsl:call-template
+ name="u:BandI"/>
+ </xsl:if>
+ <xsl:call-template
+ name="u:outputFolding"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_element -->
+ <xsl:template
+ match="pending">
+ <xsl:call-template
+ name="u:notSupported"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_element == inline_element == directive -->
+ <xsl:template
+ match="raw">
+ <xsl:choose>
+ <xsl:when
+ test="contains($inline_containers, concat('*', name(..), '*'))">
+ <!-- Used as a custom role -->
+ <!-- TODO `role' directives must be generated for user-defined raw
+ roles. -->
+ <!-- The name of the custom role is not contained in the input -->
+ <xsl:text>:RAW-ROLE:`</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>`</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- A directive -->
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. raw:: </xsl:text>
+ <xsl:value-of
+ select=" <at> format"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:params">
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'format' and name() != 'classes']"/>
+ </xsl:call-template>
+ &tCR;
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
+ &tEOL;
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_element == folding_element == directive -->
+ <xsl:template
+ match="rubric">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>.. rubric:: </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template
+ name="u:params"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="compound">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. compound::</xsl:text>
+ &tEOL;
+ <xsl:call-template
+ name="u:params"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="container">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. container::</xsl:text>
+ <xsl:if
+ test=" <at> classes">
+ &tSP;
+ <xsl:value-of
+ select=" <at> classes"/>
+ </xsl:if>
+ &tEOL;
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_element == directive -->
+ <xsl:template
+ match="substitution_definition">
+ <!-- More than one child or not a directive is a replacement text -->
+ <xsl:variable
+ name="isReplace"
+ select="not(* and count(node()) = 1 and contains($directives, concat('*', name(*[1]), '*')))"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:variable
+ name="prefix">
+ <xsl:text>.. |</xsl:text>
+ <xsl:call-template
+ name="u:outputNames"/>
+ <xsl:text>| </xsl:text>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when
+ test="$isReplace">
+ <!-- TODO Substitution references for replace can not be found because
+ they are not marked as such; embedding them in `generated'
+ would be nice -->
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:value-of
+ select="$prefix"/>
+ <xsl:text>replace:: </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$prefix"/>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: ((%body.elements;)+, attribution?)
+ Attributes: The block_quote element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="block_quote">
+ <xsl:if
+ test=" <at> classes = 'epigraph' or <at> classes = 'highlights' or <at> classes = 'pull-quote'">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. </xsl:text>
+ <xsl:value-of
+ select=" <at> classes"/>
+ <xsl:text>::</xsl:text>
+ &tEOL;
+ <xsl:call-template
+ name="u:params"/>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_subelement == folding_element -->
+ <xsl:template
+ match="attribution">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <!-- blank line between quote and attribution -->
+ &tCR;
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>-- </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="citation">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. [</xsl:text>
+ <xsl:value-of
+ select="label"/>
+ <xsl:text>] </xsl:text>
+ <xsl:apply-templates
+ select="*[not(self::label)]"/>
+ </xsl:template>
+
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="citation/label">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="figure">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. figure:: </xsl:text>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_subelement == folding_element -->
+ <xsl:template
+ match="caption">
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:call-template
+ name="u:outputFolding"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="legend">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- TODO Footnotes should continue on line of definition -->
+
+ <!-- user-numbered footnotes lack <at> auto -->
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="footnote[not( <at> auto)]">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. [</xsl:text>
+ <xsl:apply-templates
+ select="label"/>
+ <xsl:text>] </xsl:text>
+ <xsl:apply-templates
+ select="*[not(self::label)]"/>
+ </xsl:template>
+
+ <!-- autonumbered footnotes have <at> auto -->
+ <!-- if the target footnote_reference <at> names matches its label, it was not a
+ numbered-name footnote -->
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="footnote[ <at> auto='1']">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. [#</xsl:text>
+ <xsl:if
+ test=" <at> names = <at> ids">
+ <xsl:call-template
+ name="u:outputNames"/>
+ </xsl:if>
+ <xsl:text>] </xsl:text>
+ <xsl:apply-templates
+ select="*[not(self::label)]"/>
+ </xsl:template>
+
+ <!-- autosymboled footnotes have <at> auto -->
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="footnote[ <at> auto='*']">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. [*] </xsl:text>
+ <xsl:apply-templates
+ select="*[not(self::label)]"/>
+ </xsl:template>
+
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="footnote[starts-with( <at> names, 'TARGET_NOTE:\ ')]">
+ <!-- This is not a footnote but a hint for a directive -->
+ <xsl:if
+ test="generate-id(//footnote[starts-with( <at> names, 'TARGET_NOTE:\ ')][1]) = generate-id(.)">
+ <!-- Only for the first one -->
+ <xsl:call-template
+ name="u:BandI"/>
+ <!-- TODO May have a `classes` attribute -->
+ <xsl:text>.. target-notes::</xsl:text>
+ &tEOL;
+ </xsl:if>
+ </xsl:template>
+
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="footnote/label">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (list_item +)
+ Attributes: The bullet_list element contains the common attributes (ids,
+ names, dupnames, source, and classes), plus bullet.
+ bullet is used to record the style of bullet from the input data.
+ In documents processed from reStructuredText, it contains one of "-",
+ "+", or "*". It may be ignored in processing.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="bullet_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates
+ mode="bullet_list"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (definition_list_item +)
+ Attributes: The definition_list element contains only the common
+ attributes: ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="definition_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (term, classifier?, definition)
+ Attributes: The definition_list_item element contains only the common
+ attributes: ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="definition_list_item">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The term element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="term">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The classifier element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="classifier">
+ <xsl:text> : </xsl:text>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)+
+ Attributes: The definition element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="definition">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (list_item +)
+ Attributes: The enumerated_list element contains the common attributes
+ (ids, names, dupnames, source, and classes), plus enumtype, prefix, suffix, and
+ start.
+ enumtype is used to record the intended enumeration sequence, one
+ of "arabic" (1, 2, 3, ...), "loweralpha" (a, b, c, ..., z), "upperalpha" (A,
+ B, C, ..., Z), "lowerroman" (i, ii, iii, iv, ..., mmmmcmxcix [4999]), or
+ "upperroman" (I, II, III, IV, ..., MMMMCMXCIX [4999]).
+ prefix stores the formatting characters used before the enumerator. In
+ documents originating from reStructuredText data, it will contain either ""
+ (empty string) or "(" (left parenthesis). It may or may not affect
+ processing.
+ suffix stores the formatting characters used after the enumerator. In
+ documents originating from reStructuredText data, it will contain either "."
+ (period) or ")" (right parenthesis). Depending on the capabilities of the
+ output format, this attribute may or may not affect processing.
+ start contains the ordinal value of the first item in the list, in
+ decimal. For lists beginning at value 1 ("1", "a", "A", "i", or "I"), this
+ attribute may be omitted.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="enumerated_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates
+ mode="enumerated_list"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (field +)
+ Attributes: The field_list element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="field_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (field_name, field_body)
+ Attributes: The field element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="field">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ********************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The field_name element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="field_name">
+ <xsl:text>:</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>: </xsl:text>
+ <!-- no EOL: field_body starts on same line -->
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)*
+ Attributes: The field_body element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="field_body">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (option_list_item +)
+ Attributes: The option_list element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="option_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:blank"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (option_group, description)
+ Attributes: The option_list_item element contains only the common
+ attributes: ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="option_list_item">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (option_group, description)
+ Attributes: The option_group element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="option_group">
+ <xsl:apply-templates/>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (option_string, option_argument *)
+ Attributes: The option element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="option">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ <xsl:if
+ test="generate-id(current()) != generate-id(../*[last()])">
+ <!-- No comma after final option -->
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <!-- no EOL: description on same line -->
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (#PCDATA)
+ Attributes: The option_string element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="option_string">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (#PCDATA)
+ Attributes: The option_argument element contains the common attributes
+ (ids, names, dupnames, source, and classes), plus delimiter.
+ delimiter contains the text preceding the option_argument:
+ either the text separating it from the option_string (typically
+ either "=" or " ")
+ or the text between option arguments (typically either "," or " ").
+ -->
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="option_argument">
+ <xsl:value-of
+ select=" <at> delimiter"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)+
+ Attributes: The description element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="description">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)+
+ Attributes: The list_item element contains only the common attributes:
+ ids, names, dupnames, source, and classes
+
+ BULLET LIST
+ bullet is used to record the style of bullet from the input data.
+ In documents processed from reStructuredText, it contains one of "-",
+ "+", or "*". It may be ignored in processing.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="list_item"
+ mode="bullet_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:value-of
+ select="../ <at> bullet"/>
+ &tSP; <!-- space after bullet -->
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ ENUMERATED LIST
+ enumtype is used to record the intended enumeration sequence, one of
+ "arabic" (1, 2, 3, ...), "loweralpha" (a, b, c, ..., z), "upperalpha" (A, B,
+ C, ..., Z), "lowerroman" (i, ii, iii, iv, ..., mmmmcmxcix [4999]), or
+ "upperroman" (I, II, III, IV, ..., MMMMCMXCIX [4999]).
+ prefix stores the formatting characters used before the enumerator. In
+ documents originating from reStructuredText data, it will contain either ""
+ (empty string) or "(" (left parenthesis). It may or may not affect
+ processing.
+ suffix stores the formatting characters used after the enumerator. In
+ documents originating from reStructuredText data, it will contain either "."
+ (period) or ")" (right parenthesis). Depending on the capabilities of the
+ output format, this attribute may or may not affect processing.
+ start contains the ordinal value of the first item in the list, in
+ decimal. For lists beginning at value 1 ("1", "a", "A", "i", or "I"), this
+ attribute may be omitted.
+
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="list_item"
+ mode="enumerated_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:call-template
+ name="u:outputEnumerator"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- Outputs a complete enumerator when called in an
+ enumerated_list/list_item -->
+ <xsl:template
+ name="u:outputEnumerator">
+ <!-- Use parent's numeration attribute -->
+ <xsl:variable
+ name="enumType"
+ select="../ <at> enumtype"/>
+ <!-- Determine starting point -->
+ <xsl:variable
+ name="start">
+ <xsl:choose>
+ <xsl:when
+ test="../ <at> start">
+ <xsl:value-of
+ select="../ <at> start"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Determine position of this item in its real context -->
+ <xsl:variable
+ name="position">
+ <xsl:variable
+ name="wanted"
+ select="generate-id()"/>
+ <!-- Generate the right current node list -->
+ <xsl:for-each
+ select="../list_item">
+ <xsl:if
+ test="generate-id() = $wanted">
+ <xsl:value-of
+ select="position()"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <!-- Determine encoding of the number for the given numeration -->
+ <xsl:variable
+ name="cur">
+ <xsl:call-template
+ name="u:position2Enumerator">
+ <xsl:with-param
+ name="enumType"
+ select="$enumType"/>
+ <xsl:with-param
+ name="position"
+ select="$position"/>
+ <xsl:with-param
+ name="start"
+ select="$start"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Determine encoding of the maximum number -->
+ <xsl:variable
+ name="max">
+ <xsl:call-template
+ name="u:position2Enumerator">
+ <xsl:with-param
+ name="enumType"
+ select="$enumType"/>
+ <xsl:with-param
+ name="position"
+ select="count(../list_item)"/>
+ <xsl:with-param
+ name="start"
+ select="$start"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Output complete enumerator -->
+ <xsl:value-of
+ select="../ <at> prefix"/>
+ <xsl:value-of
+ select="$cur"/>
+ <xsl:value-of
+ select="../ <at> suffix"/>
+ <!-- Output at least one trailing space -->
+ &tSP;
+ <!-- Output more whitespace to align with the maximum enumerator -->
+ <xsl:if
+ test="$enumType != 'lowerroman' and $enumType != 'upperroman'">
+ <xsl:call-template
+ name="u:repeat">
+ <!-- Assumes that the maximum number has maximum string length -->
+ <xsl:with-param
+ name="length"
+ select="string-length($max) - string-length($cur)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Determine the right ordinal enumerator based on the parameters -->
+ <xsl:template
+ name="u:position2Enumerator">
+ <xsl:param
+ name="enumType"/>
+ <xsl:param
+ name="start"/>
+ <xsl:param
+ name="position"/>
+ <!-- Determine logical number -->
+ <xsl:variable
+ name="ordinal"
+ select="$start - 1 + $position"/>
+ <xsl:choose>
+ <xsl:when
+ test="$enumType = 'arabic'">
+ <xsl:value-of
+ select="$ordinal"/>
+ </xsl:when>
+ <xsl:when
+ test="$enumType = 'loweralpha'">
+ <xsl:value-of
+ select="substring('abcdefghijklmnopqrstzuvwxyz', $ordinal, 1)"/>
+ </xsl:when>
+ <xsl:when
+ test="$enumType = 'upperalpha'">
+ <xsl:value-of
+ select="substring('ABCDEFGHIJKLMNOPQRSTZUVWXYZ', $ordinal, 1)"/>
+ </xsl:when>
+ <!-- TODO Support for counting roman numbers -->
+ <xsl:when
+ test="$enumType = 'lowerroman'">
+ <xsl:text>i</xsl:text>
+ </xsl:when>
+ <xsl:when
+ test="$enumType = 'upperroman'">
+ <xsl:text>I</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (title?, tgroup+)
+ Attributes: The table element contains the common attributes and:
+ frame, colsep, rowsep, pgwide
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="table">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:blank"/>
+ <xsl:apply-templates
+ select="tgroup"/>
+ <xsl:if
+ test="title">
+ <!-- TODO A table title must be rendered by using the `.. table::'
+ directive -->
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:apply-templates
+ select="title"/>
+ &tEOL;
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (colspec*, thead?, tbody)
+ Attributes: The tgroup element contains the common attributes and:
+ cols, colsep, rowsep, align
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="tgroup">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: EMPTY
+ Attributes: The colspec element contains the common attributes and:
+ colnum, colname, colwidth, colsep, rowsep, align, char, charoff
+
+ The colwidth attribute gives the width of the respective column in characters
+ including padding whitespace but no separator markup.
+ -->
+ <!-- == simple_body_subelement -->
+ <!-- <at> colwidth needed by children but element has no own output -->
+ <xsl:template
+ match="colspec"/>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (row+)
+ Attributes: The thead element contains the common attributes and:
+ valign
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="thead">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!--
+ Content Model: (row+)
+ Attributes: The tbody element contains the common attributes and:
+ valign
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="tbody">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (entry+)
+ Attributes: The row element contains the common attributes and:
+ rowsep, valign
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="row">
+ <!-- Separator line above unless first row of a tbody with no previous
+ thead (in this case the separator line is output already as the
+ closing separator line of thead) -->
+ <xsl:if
+ test="position() > 1 or parent::thead or parent::tbody and not(../../thead)">
+ <xsl:call-template
+ name="u:rowSeparatorLine"/>
+ </xsl:if>
+ <!-- Determine heights in physical lines of all entries -->
+ <xsl:variable
+ name="heights">
+ <xsl:for-each
+ select="entry">
+ <xsl:variable
+ name="text">
+ <!-- Catch the text of all entries -->
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <!-- Compute height of this entry; leading and trailing EOL must be
+ subtracted -->
+ <xsl:value-of
+ select="string-length($text) - string-length(translate($text, '
', '')) - 1"/>
+ &tSP; <!-- A space as a list separator -->
+ </xsl:for-each>
+ </xsl:variable>
+ <!-- Determine maximum height so every entry must be this high -->
+ <xsl:variable
+ name="maxHeight">
+ <xsl:call-template
+ name="u:maxNumber">
+ <xsl:with-param
+ name="numbers"
+ select="$heights"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Output all the physical lines of this row -->
+ <xsl:call-template
+ name="u:rowLines">
+ <xsl:with-param
+ name="currentLine"
+ select="1"/>
+ <xsl:with-param
+ name="maxLine"
+ select="$maxHeight"/>
+ </xsl:call-template>
+ <!-- Output final separator line if this is the last row -->
+ <xsl:if
+ test="position() = last()">
+ <xsl:call-template
+ name="u:rowSeparatorLine">
+ <xsl:with-param
+ name="char">
+ <!-- Determine correct character for the separator line -->
+ <xsl:choose>
+ <xsl:when
+ test="parent::thead">
+ <xsl:value-of
+ select="'='"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="'-'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Output physical line $currentLine of a row and continue until
+ line $maxLine is output -->
+ <xsl:template
+ name="u:rowLines">
+ <xsl:param
+ name="currentLine"/>
+ <xsl:param
+ name="maxLine"/>
+ <xsl:if
+ test="$currentLine <= $maxLine">
+ <!-- If there are still physical lines to output do it -->
+ <xsl:call-template
+ name="u:indent"/>
+ <!-- Leading bar -->
+ <xsl:text>|</xsl:text>
+ <xsl:apply-templates>
+ <xsl:with-param
+ name="currentLine"
+ select="$currentLine"/>
+ </xsl:apply-templates>
+ <!-- End of this physical line -->
+ &tEOL;
+ <!-- Continue with the next physical line -->
+ <xsl:call-template
+ name="u:rowLines">
+ <xsl:with-param
+ name="currentLine"
+ select="$currentLine + 1"/>
+ <xsl:with-param
+ name="maxLine"
+ select="$maxLine"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Output a separator line with all the right characters -->
+ <xsl:template
+ name="u:rowSeparatorLine">
+ <xsl:param
+ name="char"
+ select="'-'"/>
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:text>+</xsl:text>
+ <xsl:for-each
+ select="../../colspec">
+ <xsl:call-template
+ name="u:repeat">
+ <xsl:with-param
+ name="length"
+ select=" <at> colwidth"/>
+ <xsl:with-param
+ name="chars"
+ select="$char"/>
+ </xsl:call-template>
+ <xsl:text>+</xsl:text>
+ </xsl:for-each>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)*
+ Attributes: The entry element contains the common attributes and:
+ colname, namest, morerows, colsep, rowsep, align, char, charoff, valign and
+ morecols
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="entry">
+ <!-- TODO `classes` attribute needs support -->
+ <!-- This is called in two ways; if $currentLine = 0 all physical lines
+ of this entry must be output; if $currentLine > 0 the physical line
+ with exactly this number shall be output -->
+ <xsl:param
+ name="currentLine"
+ select="0"/>
+ <xsl:variable
+ name="column"
+ select="position() + sum(preceding-sibling::entry/ <at> morecols)"/>
+ <!-- Determine width in characters needed for this entry -->
+ <xsl:variable
+ name="width">
+ <xsl:call-template
+ name="u:computeEntryWidth">
+ <xsl:with-param
+ name="colspecs"
+ select="../../../colspec"/>
+ <xsl:with-param
+ name="column"
+ select="$column"/>
+ <xsl:with-param
+ name="span"
+ select=" <at> morecols"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Output the entry completely or a certain physical line -->
+ <xsl:call-template
+ name="u:outputEntry">
+ <xsl:with-param
+ name="string">
+ <!-- Capture physical lines of the entry in a variable -->
+ <xsl:apply-templates/>
+ </xsl:with-param>
+ <xsl:with-param
+ name="width"
+ select="$width"/>
+ <xsl:with-param
+ name="expectedIndent">
+ <!-- Capture indent for the entry generated by the normal template
+ rules to remove it later -->
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:with-param>
+ <xsl:with-param
+ name="outputLine"
+ select="$currentLine"/>
+ </xsl:call-template>
+ <!-- Final bar after the entry -->
+ <xsl:text>|</xsl:text>
+ </xsl:template>
+
+ <!-- Compute width of the entry -->
+ <xsl:template
+ name="u:computeEntryWidth">
+ <!-- The colspec elements of all columns -->
+ <xsl:param
+ name="colspecs"/>
+ <!-- Column of this entry -->
+ <xsl:param
+ name="column"/>
+ <!-- Number of columns this entry spans -->
+ <xsl:param
+ name="span"
+ select="0"/>
+ <xsl:param
+ name="sum"
+ select="0"/>
+ <xsl:choose>
+ <xsl:when
+ test="$span">
+ <!-- If entry spans multiple columns compute their width -->
+ <xsl:call-template
+ name="u:computeEntryWidth">
+ <xsl:with-param
+ name="colspecs"
+ select="$colspecs"/>
+ <xsl:with-param
+ name="column"
+ select="$column + 1"/>
+ <xsl:with-param
+ name="span"
+ select="$span - 1"/>
+ <!-- Add the separator character and the following column width -->
+ <xsl:with-param
+ name="sum"
+ select="$sum + 1 + $colspecs[$column]/ <at> colwidth"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Does not span more columns so return sum and width of this
+ column -->
+ <xsl:value-of
+ select="$sum + $colspecs[$column]/ <at> colwidth"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Outputs one or all lines of a table entry as a string trimmed left and
+ padded -->
+ <xsl:template
+ name="u:outputEntry">
+ <!-- Width of the entry; there is no provision for actual physical lines
+ longer than this width -->
+ <xsl:param
+ name="width"/>
+ <!-- The string containing the remaining physical lines; may be an empty
+ string -->
+ <xsl:param
+ name="string"
+ select="''"/>
+ <!-- The indendation which is expected to be prefixed before every
+ physical line -->
+ <xsl:param
+ name="expectedIndent"
+ select="''"/>
+ <!-- Is this the first call to this template -->
+ <xsl:param
+ name="isFirst"
+ select="true()"/>
+ <!-- Number of physical line to output or 0 to output all lines -->
+ <xsl:param
+ name="outputLine"
+ select="0"/>
+ <!-- Output is wanted if all or the first physical line are to be
+ output -->
+ <xsl:variable
+ name="doOutput"
+ select="$outputLine = 0 or $outputLine = 1"/>
+ <xsl:variable
+ name="stringLFHalfTrimmed">
+ <xsl:choose>
+ <xsl:when
+ test="$isFirst and substring($string, 1, 1) = '
'">
+ <!-- Remove leading linefeed if this is the first time -->
+ <xsl:value-of
+ select="substring($string, 2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable
+ name="stringLFTrimmed">
+ <xsl:choose>
+ <xsl:when
+ test="$isFirst and substring($stringLFHalfTrimmed, string-length($stringLFHalfTrimmed), 1) = '
'">
+ <!-- Remove trailing linefeed if this is the first time -->
+ <xsl:value-of
+ select="substring($stringLFHalfTrimmed, 1, string-length($stringLFHalfTrimmed) - 1)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$stringLFHalfTrimmed"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Determine remaining lines after the first one -->
+ <xsl:variable
+ name="remainingLines">
+ <xsl:if
+ test="contains($stringLFTrimmed, '
')">
+ <xsl:value-of
+ select="substring-after($stringLFTrimmed, '
')"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:if
+ test="$doOutput">
+ <!-- If this physical line must be output determine the first physical
+ line -->
+ <xsl:variable
+ name="firstLine">
+ <xsl:choose>
+ <xsl:when
+ test="string-length($remainingLines)">
+ <xsl:value-of
+ select="substring-before($stringLFTrimmed, '
')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$stringLFTrimmed"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Remove the leading indentation from the physical line which is
+ brought there by the normal templates -->
+ <xsl:variable
+ name="trimmed">
+ <xsl:if
+ test="string-length($firstLine)">
+ <!-- Trim only non-empty lines -->
+ <xsl:value-of
+ select="substring-after($firstLine, $expectedIndent)"/>
+ </xsl:if>
+ </xsl:variable>
+ <!-- Pad the line with a leading and a trailing space -->
+ <xsl:variable
+ name="padded"
+ select="concat(' ', $trimmed, ' ')"/>
+ <!-- Output the padded value -->
+ <xsl:value-of
+ select="$padded"/>
+ <!-- Fill up the width of the entry with spaces -->
+ <xsl:if
+ test="$width - string-length($padded) < 0">
+ <xsl:message>
+ <xsl:text>WARNING: Table column too narrow (minimum: </xsl:text>
+ <xsl:value-of
+ select="string-length($padded)"/>
+ <xsl:text>)</xsl:text>
+ &tEOL;
+ </xsl:message>
+ </xsl:if>
+ <xsl:call-template
+ name="u:repeat">
+ <xsl:with-param
+ name="length"
+ select="$width - string-length($padded)"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if
+ test="$outputLine > 1 or $outputLine = 0 and string-length($remainingLines)">
+ <!-- If a following physical line must be output or if all physical
+ lines shall be output and there are remaining physical lines -->
+ <xsl:if
+ test="$outputLine = 0">
+ <!-- Output linefeed only if we output all the lines -->
+ &tEOL;
+ </xsl:if>
+ <!-- Output the remaining lines -->
+ <xsl:call-template
+ name="u:outputEntry">
+ <xsl:with-param
+ name="width"
+ select="$width"/>
+ <xsl:with-param
+ name="string"
+ select="$remainingLines"/>
+ <xsl:with-param
+ name="expectedIndent"
+ select="$expectedIndent"/>
+ <xsl:with-param
+ name="isFirst"
+ select="false()"/>
+ <xsl:with-param
+ name="outputLine">
+ <xsl:choose>
+ <xsl:when
+ test="$outputLine = 0">
+ <xsl:value-of
+ select="0"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$outputLine - 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!-- == inline_element -->
+ <xsl:template
+ match="citation_reference">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>[</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>]_</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == inline_element -->
+ <xsl:template
+ match="emphasis">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>*</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>*</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- user-numbered footnotes lack <at> auto -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="footnote_reference[not( <at> auto)]">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>[</xsl:text>
+ <xsl:value-of
+ select="text()"/>
+ <xsl:text>]_</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ <!-- child paragraph provides blank line -->
+ </xsl:template>
+
+ <!-- automatically numbered footnotes have <at> auto -->
+ <!-- if <at> names is different from label content, it is a named footnote -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="footnote_reference[ <at> auto='1']">
+ <xsl:variable
+ name="ref"
+ select=" <at> refid"/>
+ <xsl:if
+ test="not(starts-with(//footnote[ <at> ids=$ref]/ <at> names, 'TARGET_NOTE:\ '))">
+ <!-- Not a generated footnote reference for a `.. target-notes::';
+ such footnote reference and the preceding space should be
+ embedded in `generated'! -->
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>[#</xsl:text>
+ <xsl:if
+ test="//footnote[ <at> ids=$ref]/ <at> names != //footnote[ <at> ids=$ref]/label">
+ <xsl:call-template
+ name="u:outputNames">
+ <xsl:with-param
+ name="names"
+ select="//footnote[ <at> ids=$ref]/ <at> names"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:text>]_</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- automatically symboled footnotes have <at> auto=* -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="footnote_reference[ <at> auto='*']">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>[*]_</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="literal">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>``</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>``</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Attribute combinations found in `standard' text and other examples:
+ <at> refuri = standalone hyperlink
+ <at> ids <at> refid = TOC, probably all in <generated>
+ <at> name <at> refuri with matching <target> in document = named external hyperlink _
+ <at> name <at> refuri immediately followed by matching <target> = named embedded URI _
+ <at> name <at> refuri with no matching <target> in document = anonymous embedded URI __
+ <at> anonymous <at> name <at> refuri with no matching <target> in document = anonymous explicit URI __
+ <at> name <at> refid = internal cross-reference _
+ <at> anonymous <at> name <at> refid = anonymous implicit internal reference __
+ <at> name <at> refid image = clickable image to internal reference _
+ <at> refuri image = clickable image to standalone hyperlink
+
+ A target matches if target/ <at> names contains the lower cased, whitespace
+ quoted reference/ <at> name
+ -->
+
+ <!-- Standalone hyperlink -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="reference[not( <at> name or <at> anonymous)]">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:choose>
+ <xsl:when
+ test="starts-with(., 'PEP ')">
+ <xsl:text>:PEP:`</xsl:text>
+ <xsl:value-of
+ select="substring-after(., 'PEP ')"/>
+ <xsl:text>`</xsl:text>
+ </xsl:when>
+ <xsl:when
+ test="starts-with(., 'RFC ')">
+ <xsl:text>:RFC:`</xsl:text>
+ <xsl:value-of
+ select="substring-after(., 'RFC ')"/>
+ <xsl:text>`</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- External references -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="reference[ <at> name and <at> refuri]">
+ <!-- Determine normalized name by downcasing it -->
+ <xsl:variable
+ name="normalized"
+ select="translate(normalize-space( <at> name), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
+ <xsl:variable
+ name="quoted">
+ <xsl:call-template
+ name="u:quoteWhite">
+ <xsl:with-param
+ name="string"
+ select="$normalized"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable
+ name="matching"
+ select="//target[contains( <at> names, $quoted)]"/>
+ <xsl:call-template
+ name="u:inlineReference">
+ <xsl:with-param
+ name="anonymous"
+ select="not($matching) or <at> anonymous"/>
+ <xsl:with-param
+ name="embedded"
+ select="not( <at> anonymous) and (not($matching) or generate-id(following-sibling::node()[1]) = generate-id($matching))"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- Internal references -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="reference[ <at> name and <at> refid]">
+ <xsl:call-template
+ name="u:inlineReference">
+ <xsl:with-param
+ name="anonymous"
+ select=" <at> anonymous"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- Image references -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="reference[image]">
+ <!-- All done by the `image' tag -->
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="strong">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>**</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>**</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == inline_element -->
+ <xsl:template
+ match="subscript">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>:sub:`</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>`</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == inline_element -->
+ <xsl:template
+ match="superscript">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>:sup:`</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>`</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- The target element has various roles depending on context; they are
+ all handled here -->
+ <!-- == simple_body_element == inline_element == directive -->
+ <xsl:template
+ match="target">
+ <xsl:choose>
+ <xsl:when
+ test="name(preceding-sibling::*[1]) = 'reference'">
+ <!-- An embedded inline target - handled by the reference itself -->
+ </xsl:when>
+ <xsl:when
+ test="contains($inline_containers, concat('*', name(..), '*'))">
+ <!-- An inline target of some sort -->
+ <xsl:call-template
+ name="u:inlineReference">
+ <xsl:with-param
+ name="isTarget"
+ select="true()"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when
+ test=" <at> anonymous">
+ <!-- An anonymous target directive -->
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>__ </xsl:text>
+ <xsl:choose>
+ <xsl:when
+ test=" <at> refid">
+ <xsl:call-template
+ name="u:outputNamesRefid"/>
+ <xsl:text>_</xsl:text>
+ </xsl:when>
+ <xsl:when
+ test=" <at> refuri">
+ <xsl:value-of
+ select=" <at> refuri"/>
+ </xsl:when>
+ </xsl:choose>
+ &tEOL;
+ </xsl:when>
+ <xsl:when
+ test=" <at> names | <at> refid">
+ <!-- A target directive -->
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. _</xsl:text>
+ <xsl:choose>
+ <xsl:when
+ test=" <at> refid">
+ <xsl:call-template
+ name="u:outputNamesRefid"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:outputNames"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>:</xsl:text>
+ <xsl:if
+ test=" <at> refuri">
+ <xsl:text> </xsl:text>
+ <xsl:value-of
+ select=" <at> refuri"/>
+ </xsl:if>
+ &tEOL;
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Should not happen -->
+ <xsl:call-template
+ name="u:notSupported"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="title_reference">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>`</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>`</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="inline">
+ <!-- TODO `role' directives must be generated for plain and derived
+ user-defined roles. -->
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>:</xsl:text>
+ <xsl:value-of
+ select=" <at> classes"/>
+ <xsl:text>:`</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>`</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- TODO `meta` directive must be implemented. -->
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Docutils wraps generated elements around text that is inserted (generated) by
+ Docutils; i.e., text that was not in the document, like section numbers
+ inserted by the "sectnum" directive.
+ -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="generated"/>
+
+ <!-- == inline_element -->
+ <xsl:template
+ match="problematic">
+ <!-- Simply output the contained text because this is probably the
+ original text-->
+ <xsl:value-of
+ select="text()"/>
+ </xsl:template>
+
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="system_message"/>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!--
+ When a block of text contains linefeeds, it was indented relative to a marker
+ on the first line
+ -->
+ <xsl:template
+ match="text()">
+ <xsl:call-template
+ name="u:indentLF"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!-- Add a blank line if necessary and indent -->
+ <xsl:template
+ name="u:BandI">
+ <xsl:call-template
+ name="u:blank"/>
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Add a blank line in certain contexts -->
+ <xsl:template
+ name="u:blank">
+ <xsl:apply-templates
+ mode="blankSkipInline"
+ select="preceding::*[1]"/>
+ </xsl:template>
+
+ <!-- Find the preceding element we are really interested in and act
+ according to this element -->
+ <xsl:template
+ mode="blankSkipInline"
+ match="*">
+ <xsl:choose>
+ <!-- Skip all inline elements and body subelements and check their
+ parents -->
+ <xsl:when
+ test="contains(concat($inline_elements, $simple_body_subelements, $compound_body_subelements), concat('*', name(.), '*'))">
+ <xsl:apply-templates
+ mode="blankSkipInline"
+ select=".."/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Reached the type of element we decide on -->
+ <xsl:if
+ test="contains($blank_after, concat('*', name(.), '*'))">
+ &tCR;
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Indent a block if it's a child of...
+ -->
+ <data:lookup>
+ <node
+ name="address"
+ indent="10"/>
+ <node
+ name="author"
+ indent="9"/>
+ <node
+ name="authors"
+ indent="10"/>
+ <node
+ name="contact"
+ indent="10"/>
+ <node
+ name="copyright"
+ indent="12"/>
+ <node
+ name="date"
+ indent="7"/>
+ <node
+ name="organization"
+ indent="15"/>
+ <node
+ name="revision"
+ indent="11"/>
+ <node
+ name="status"
+ indent="9"/>
+ <node
+ name="version"
+ indent="10"/>
+ <!-- This is only for `bullet_list/list_item';
+ `enumerated_list/list_item' is handled special -->
+ <node
+ name="list_item"
+ indent="2"/>
+ <node
+ name="definition_list_item"
+ indent="4"/>
+ <node
+ name="field_body"
+ indent="4"/>
+ <node
+ name="option_list_item"
+ indent="4"/>
+ <!-- This is also the indentation if block_quote comes as one of the
+ special directives -->
+ <node
+ name="block_quote"
+ indent="4"/>
+ <node
+ name="literal_block"
+ indent="4"/>
+ <node
+ name="attribution"
+ indent="3"/>
+ <node
+ name="line"
+ indent="2"/>
+ </data:lookup>
+
+ <!-- Do indent according to ancestor -->
+ <xsl:template
+ name="u:indent">
+ <!-- In some cases the ancestors to indent for need to be determined
+ by the calling template -->
+ <xsl:param
+ name="ancestors"
+ select="ancestor::*"/>
+ <xsl:for-each
+ select="$ancestors">
+ <xsl:variable
+ name="this"
+ select="name()"/>
+ <xsl:choose>
+ <xsl:when
+ test="contains($directives, concat('*', $this, '*'))">
+ <xsl:call-template
+ name="u:repeat">
+ <!-- TODO Indentation of lines after some directives must be
+ indented to align with the directive instead of a
+ fixed indentation; however, this is rather complicated
+ since identation for parameters should be fixed -->
+ <xsl:with-param
+ name="length"
+ select="3"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when
+ test="$this = 'list_item' and parent::enumerated_list">
+ <!-- Enumerated list items base their indentation on the
+ numeration -->
+ <xsl:variable
+ name="enumerator">
+ <xsl:call-template
+ name="u:outputEnumerator"/>
+ </xsl:variable>
+ <xsl:call-template
+ name="u:repeat">
+ <xsl:with-param
+ name="length"
+ select="string-length($enumerator)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:repeat">
+ <xsl:with-param
+ name="length"
+ select="document('')//data:lookup/node[ <at> name=$this]/ <at> indent"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Create a repeated character string
+ Shamelessly borrowed from Jeni Tennison's work on EXSLT
+ -->
+ <xsl:template
+ name="u:repeat">
+ <xsl:param
+ name="length"
+ select="0"/>
+ <xsl:param
+ name="chars"
+ select="' '"/>
+ <xsl:choose>
+ <xsl:when
+ test="not($length) or $length <= 0 or not($chars)"/>
+ <xsl:otherwise>
+ <xsl:variable
+ name="string"
+ select="concat($chars, $chars, $chars, $chars, $chars, $chars, $chars, $chars, $chars, $chars)"/>
+ <xsl:choose>
+ <xsl:when
+ test="string-length($string) >= $length">
+ <xsl:value-of
+ select="substring($string, 1, $length)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:repeat">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="chars"
+ select="$string"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Indent a text containing line feeds correctly -->
+ <xsl:template
+ name="u:indentLF">
+ <xsl:param
+ name="string"
+ select="."/>
+ <!-- A fixed indentation may be given by caller -->
+ <xsl:param
+ name="indent">
+ <!-- If not given compute it -->
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:param>
+ <xsl:choose>
+ <xsl:when
+ test="contains($string,'
')">
+ <!-- Output first physical line -->
+ <xsl:value-of
+ select="substring-before($string, '
')"/>
+ &tEOL;
+ <!-- Indent before the next line -->
+ <xsl:value-of
+ select="$indent"/>
+ <!-- Output remaining physical lines -->
+ <xsl:call-template
+ name="u:indentLF">
+ <xsl:with-param
+ name="string"
+ select="substring-after($string, '
')"/>
+ <xsl:with-param
+ name="indent"
+ select="$indent"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- String does not contain newline, so just output it -->
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Do output for those elements which do fold their inline content -->
+ <xsl:template
+ name="u:outputFolding">
+ <!-- The prefix text to be output before the body -->
+ <xsl:param
+ name="prefix"
+ select="''"/>
+ <!-- The indentation for this body -->
+ <xsl:param
+ name="indent">
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ </xsl:param>
+ <xsl:variable
+ name="string">
+ <!-- TODO Whitespace count of inline literals must be preserved -->
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <!-- Always output prefix with all trailing and leading spaces -->
+ <xsl:value-of
+ select="$prefix"/>
+ <xsl:choose>
+ <xsl:when
+ test="$fold > 0">
+ <xsl:variable
+ name="normalized"
+ select="normalize-space($string)"/>
+ <xsl:choose>
+ <xsl:when
+ test="$string = ''">
+ <!-- Empty strings need no output -->
+ </xsl:when>
+ <xsl:when
+ test="$normalized = ''">
+ <!-- Only white-space in string; output a single space here -->
+ &tSP;
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Output leading white-space here -->
+ <xsl:if
+ test="normalize-space(substring($string, 1, 1)) = ''">
+ &tSP;
+ </xsl:if>
+ <xsl:call-template
+ name="u:indentFold">
+ <xsl:with-param
+ name="string"
+ select="$normalized"/>
+ <xsl:with-param
+ name="indent"
+ select="$indent"/>
+ <xsl:with-param
+ name="cursorColumn"
+ select="string-length($indent) + string-length($prefix)"/>
+ </xsl:call-template>
+ <!-- Output trailing white-space here -->
+ <xsl:if
+ test="normalize-space(substring($string, string-length($string), 1)) = ''">
+ &tSP;
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Indent a string with folding -->
+ <xsl:template
+ name="u:indentFold">
+ <!-- Normalized string to output -->
+ <xsl:param
+ name="string"/>
+ <!-- Indentation to use for a new line -->
+ <xsl:param
+ name="indent"/>
+ <!-- Current output column -->
+ <!-- TODO This is not a correct assumption for field definitions where
+ the field name effectively determines the column of the first
+ line -->
+ <xsl:param
+ name="cursorColumn"
+ select="string-length($indent)"/>
+ <!-- Do we start on a new (indented) line? -->
+ <xsl:param
+ name="isNewLine"
+ select="true()"/>
+ <xsl:variable
+ name="firstWord">
+ <xsl:choose>
+ <!-- TODO Quoted spaces must not end a word -->
+ <xsl:when
+ test="contains($string, ' ')">
+ <xsl:value-of
+ select="substring-before($string, ' ')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable
+ name="rest"
+ select="substring-after($string, ' ')"/>
+ <xsl:choose>
+ <xsl:when
+ test="$string = ''"/>
+ <xsl:when
+ test="$isNewLine">
+ <!-- Output at least first word -->
+ <xsl:value-of
+ select="$firstWord"/>
+ <xsl:call-template
+ name="u:indentFold">
+ <xsl:with-param
+ name="string"
+ select="$rest"/>
+ <xsl:with-param
+ name="indent"
+ select="$indent"/>
+ <xsl:with-param
+ name="cursorColumn"
+ select="$cursorColumn + string-length($firstWord)"/>
+ <xsl:with-param
+ name="isNewLine"
+ select="false()"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when
+ test="$cursorColumn + 1 + string-length($firstWord) > $fold">
+ <!-- Line would get too long; start new line, indent and continue -->
+ &tEOL;
+ <xsl:value-of
+ select="$indent"/>
+ <xsl:call-template
+ name="u:indentFold">
+ <xsl:with-param
+ name="string"
+ select="$string"/>
+ <xsl:with-param
+ name="indent"
+ select="$indent"/>
+ <xsl:with-param
+ name="cursorColumn"
+ select="string-length($indent)"/>
+ <xsl:with-param
+ name="isNewLine"
+ select="true()"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- In a line and first word fits; separate and add word -->
+ &tSP;
+ <xsl:value-of
+ select="$firstWord"/>
+ <xsl:call-template
+ name="u:indentFold">
+ <xsl:with-param
+ name="string"
+ select="$rest"/>
+ <xsl:with-param
+ name="indent"
+ select="$indent"/>
+ <xsl:with-param
+ name="cursorColumn"
+ select="$cursorColumn + 1 + string-length($firstWord)"/>
+ <xsl:with-param
+ name="isNewLine"
+ select="false()"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output attributes of the current element as a field list -->
+ <xsl:template
+ name="u:params">
+ <xsl:param
+ name="params"
+ select=" <at> *"/>
+ <!-- Ancestors are needed for determining indentation; caller may give
+ them -->
+ <xsl:param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ <xsl:for-each
+ select="$params">
+ <!-- Skip URIs based on parent -->
+ <xsl:if
+ test="name() != 'uri' and name() != 'xml:space'">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="ancestors"
+ select="$ancestors"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Output one attribute of the current element as a field list -->
+ <xsl:template
+ name="u:param">
+ <xsl:param
+ name="name"
+ select="name()"/>
+ <xsl:param
+ name="value"
+ select="."/>
+ <!-- Ancestors are needed for determining indentation; caller may give
+ them -->
+ <xsl:param
+ name="ancestors"
+ select="ancestor::*"/>
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="$ancestors"/>
+ </xsl:call-template>
+ <xsl:text>:</xsl:text>
+ <xsl:choose>
+ <xsl:when
+ test="$name = 'classes'">
+ <xsl:text>class</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>:</xsl:text>
+ <xsl:if
+ test="$value">
+ <xsl:text> </xsl:text>
+ <xsl:value-of
+ select="$value"/>
+ </xsl:if>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output `\' or `\ ' before some inline element if necessary -->
+ <xsl:template
+ name="u:bkslshEscPre">
+ <!-- Get the sibling node directly before the current element -->
+ <xsl:variable
+ name="before"
+ select="preceding-sibling::node()[1]"/>
+ <xsl:choose>
+ <!-- No sibling before this node -->
+ <xsl:when
+ test="not($before)"/>
+ <!-- Element directly before this - must be another inline element -->
+ <xsl:when
+ test="name($before)">
+ <!-- So separate it by a quoted space -->
+ <xsl:text>\ </xsl:text>
+ </xsl:when>
+ <!-- Node directly before this is text - check it -->
+ <xsl:when
+ test="not(contains(concat($apos, ' 
	
"([{<-/:'), substring($before, string-length($before), 1)))">
+ <!-- Does not end in one of the allowed characters so separate it -->
+ <xsl:text>\ </xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Output `\' or `\ ' after some inline element if necessary -->
+ <xsl:template
+ name="u:bkslshEscSuf">
+ <!-- Get the sibling node directly after the current element -->
+ <xsl:variable
+ name="after"
+ select="following-sibling::node()[1]"/>
+ <xsl:choose>
+ <!-- No sibling after this node -->
+ <xsl:when
+ test="not($after)"/>
+ <!-- Element directly after this - must be another inline element
+ handling itself -->
+ <xsl:when
+ test="name($after)"/>
+ <!-- Node directly after this is text - check it -->
+ <xsl:when
+ test="not(contains(concat($apos, ' 
	
")]}>-/:.,;!?\'), substring($after, 1, 1)))">
+ <!-- Does not start with one of the allowed characters so separate
+ it -->
+ <xsl:text>\</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <xsl:template
+ name="u:notSupported">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>######## NOT SUPPORTED: `</xsl:text>
+ <xsl:value-of
+ select="name(.)"/>
+ <xsl:text>' ########</xsl:text>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <xsl:template
+ name="u:overline">
+ <!-- Length of the rendered(!) text -->
+ <xsl:param
+ name="length"/>
+ <!-- Depth 1 and 2 are document title and subtitle while depths
+ greater than 2 are normal section titles -->
+ <xsl:param
+ name="depth"/>
+ <!-- Test whether a overline is wanted at all -->
+ <xsl:if
+ test="substring($adornment, 2 * ($depth - 1) + 1, 1) = 'o'">
+ <xsl:call-template
+ name="u:repeat">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="chars"
+ select="substring($adornment, 2 * ($depth - 1) + 2, 1)"/>
+ </xsl:call-template>
+ &tEOL;
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template
+ name="u:underline">
+ <!-- Length of the rendered(!) text -->
+ <xsl:param
+ name="length"/>
+ <!-- Depth 1 and 2 are document title and subtitle while depths
+ greater than 2 are normal section titles -->
+ <xsl:param
+ name="depth"/>
+ <xsl:call-template
+ name="u:repeat">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="chars"
+ select="substring($adornment, 2 * ($depth - 1) + 2, 1)"/>
+ </xsl:call-template>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output a non-standalone reference or target -->
+ <xsl:template
+ name="u:inlineReference">
+ <xsl:param
+ name="anonymous"
+ select="false()"/>
+ <xsl:param
+ name="embedded"
+ select="false()"/>
+ <!-- Is this a target instead of a reference? -->
+ <xsl:param
+ name="isTarget"
+ select="false()"/>
+ <xsl:param
+ name="text"
+ select="node()"/>
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <!-- Delimiter only if link contains other than alphanumerics -->
+ <xsl:variable
+ name="delimiter">
+ <xsl:if
+ test="* or translate($text, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', '') or $embedded">
+ <xsl:text>`</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:if
+ test="$isTarget">
+ <xsl:text>_</xsl:text>
+ </xsl:if>
+ <xsl:value-of
+ select="$delimiter"/>
+ <xsl:apply-templates
+ select="$text"/>
+ <xsl:if
+ test="$embedded">
+ <xsl:text> <</xsl:text>
+ <xsl:value-of
+ select=" <at> refuri"/>
+ <xsl:text>></xsl:text>
+ </xsl:if>
+ <xsl:value-of
+ select="$delimiter"/>
+ <xsl:if
+ test="not($isTarget)">
+ <xsl:text>_</xsl:text>
+ <xsl:if
+ test="$anonymous">
+ <xsl:text>_</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Determine the maximum number from a whitespace separated number list -->
+ <xsl:template
+ name="u:maxNumber">
+ <xsl:param
+ name="numbers"/>
+ <!-- If this is not given by the caller a list of negative numbers will
+ not work -->
+ <xsl:param
+ name="currentMax"
+ select="0"/>
+ <xsl:variable
+ name="cleanNumbers"
+ select="normalize-space($numbers)"/>
+ <xsl:choose>
+ <xsl:when
+ test="contains($cleanNumbers, ' ')">
+ <xsl:variable
+ name="head"
+ select="substring-before($cleanNumbers, ' ')"/>
+ <xsl:choose>
+ <xsl:when
+ test="$head > $currentMax">
+ <xsl:call-template
+ name="u:maxNumber">
+ <xsl:with-param
+ name="numbers"
+ select="substring-after($cleanNumbers, ' ')"/>
+ <xsl:with-param
+ name="currentMax"
+ select="$head"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:maxNumber">
+ <xsl:with-param
+ name="numbers"
+ select="substring-after($cleanNumbers, ' ')"/>
+ <xsl:with-param
+ name="currentMax"
+ select="$currentMax"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when
+ test="$cleanNumbers > $currentMax">
+ <xsl:value-of
+ select="$cleanNumbers"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$currentMax"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output a class directive for the directly following element. -->
+ <!-- TODO A class directive can also be used as a container putting the
+ respective attribute to its content; however, this is not
+ reflected in XML - you'd need to check a sequence of elements
+ whether they all have the same attribute; furthermore class
+ settings for block quotes needs to be treated special -->
+ <xsl:template
+ name="u:outputClass">
+ <!-- Blank line already output? -->
+ <xsl:param
+ name="alreadyBlanked"
+ select="false()"/>
+ <!-- Indentation already output? -->
+ <xsl:param
+ name="alreadyIndented"
+ select="false()"/>
+ <!-- Add a blank line after class directive? -->
+ <xsl:param
+ name="blankAfter"
+ select="false()"/>
+ <xsl:if
+ test=" <at> classes">
+ <xsl:if
+ test="not($alreadyBlanked)">
+ <xsl:call-template
+ name="u:blank"/>
+ </xsl:if>
+ <xsl:if
+ test="not($alreadyIndented)">
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:if>
+ <xsl:text>.. class:: </xsl:text>
+ <xsl:value-of
+ select=" <at> classes"/>
+ &tEOL;
+ <xsl:if
+ test="$blankAfter">
+ &tCR;
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output a string with backslashed stripped -->
+ <xsl:template
+ name="u:outputUnbackslashed">
+ <xsl:param
+ name="string"/>
+ <xsl:choose>
+ <xsl:when
+ test="not(contains($string, '\'))">
+ <xsl:value-of
+ select="$string"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="substring-before($string, '\')"/>
+ <xsl:call-template
+ name="u:outputUnbackslashed">
+ <xsl:with-param
+ name="string"
+ select="substring-after($string, '\')"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Returns a name at an index -->
+ <xsl:template
+ name="u:name4Index">
+ <xsl:param
+ name="names"/>
+ <xsl:param
+ name="index"/>
+ <xsl:param
+ name="name0"
+ select="''"/>
+ <xsl:choose>
+ <xsl:when
+ test="not(contains($names, ' '))">
+ <xsl:choose>
+ <xsl:when
+ test="not($index)">
+ <xsl:value-of
+ select="concat($name0, $names)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- No string with this index -->
+ <xsl:value-of
+ select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable
+ name="before"
+ select="substring-before($names, ' ')"/>
+ <xsl:choose>
+ <xsl:when
+ test="substring($before, string-length($before)) = '\'">
+ <!-- Quoted space found -->
+ <xsl:call-template
+ name="u:name4Index">
+ <xsl:with-param
+ name="names"
+ select="substring-after($names, ' ')"/>
+ <xsl:with-param
+ name="index"
+ select="$index"/>
+ <xsl:with-param
+ name="name0"
+ select="concat($name0, $before, ' ')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Separating space found -->
+ <xsl:choose>
+ <xsl:when
+ test="not($index)">
+ <xsl:value-of
+ select="concat($name0, $before)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:name4Index">
+ <xsl:with-param
+ name="names"
+ select="substring-after($names, ' ')"/>
+ <xsl:with-param
+ name="index"
+ select="$index - 1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Output a names attribute at index considering quoted spaces. -->
+ <xsl:template
+ name="u:outputNames">
+ <!-- Blank line already output? -->
+ <xsl:param
+ name="names"
+ select=" <at> names"/>
+ <xsl:param
+ name="index"
+ select="0"/>
+ <xsl:variable
+ name="name">
+ <xsl:call-template
+ name="u:name4Index">
+ <xsl:with-param
+ name="names"
+ select="$names"/>
+ <xsl:with-param
+ name="index"
+ select="$index"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template
+ name="u:outputUnbackslashed">
+ <xsl:with-param
+ name="string"
+ select="$name"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Finds an id in a list and returns its index or empty string if not
+ contained exactly. -->
+ <xsl:template
+ name="u:findId">
+ <xsl:param
+ name="list"/>
+ <xsl:param
+ name="id"/>
+ <xsl:param
+ name="index"
+ select="0"/>
+ <xsl:choose>
+ <xsl:when
+ test="$list = ''">
+ <xsl:value-of
+ select="''"/>
+ </xsl:when>
+ <xsl:when
+ test="$list = $id or starts-with($list, concat($id, ' '))">
+ <xsl:value-of
+ select="$index"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:findId">
+ <xsl:with-param
+ name="list"
+ select="substring-after($list, ' ')"/>
+ <xsl:with-param
+ name="id"
+ select="$id"/>
+ <xsl:with-param
+ name="index"
+ select="$index + 1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- In a number of elements find the one containing exactly id and return
+ the index of the element as well as the index of the id -->
+ <xsl:template
+ name="u:findRefElem">
+ <xsl:param
+ name="possibleElems"/>
+ <xsl:param
+ name="id"/>
+ <!-- XSLT is 1-based -->
+ <xsl:param
+ name="elemIndex"
+ select="1"/>
+ <xsl:variable
+ name="elem"
+ select="$possibleElems[1]"/>
+ <xsl:choose>
+ <!-- No more elements - return empty string -->
+ <xsl:when
+ test="not($possibleElems)">
+ <xsl:value-of
+ select="''"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Check whether the first element contains the id -->
+ <xsl:variable
+ name="fnd">
+ <xsl:call-template
+ name="u:findId">
+ <xsl:with-param
+ name="list"
+ select="$elem/ <at> ids"/>
+ <xsl:with-param
+ name="id"
+ select="$id"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when
+ test="$fnd != ''">
+ <xsl:value-of
+ select="concat($elemIndex, ' ', $fnd)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:findRefElem">
+ <xsl:with-param
+ name="possibleElems"
+ select="$possibleElems[position() != 1]"/>
+ <xsl:with-param
+ name="id"
+ select="$id"/>
+ <xsl:with-param
+ name="elemIndex"
+ select="$elemIndex + 1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Output a names attribute for a refid. -->
+ <xsl:template
+ name="u:outputNamesRefid">
+ <xsl:param
+ name="refid"
+ select=" <at> refid"/>
+ <!-- Determine all possible elements which might be referred -->
+ <xsl:variable
+ name="possibleElems"
+ select="//*[contains( <at> ids, $refid)]"/>
+ <xsl:variable
+ name="refElem_index">
+ <xsl:call-template
+ name="u:findRefElem">
+ <xsl:with-param
+ name="possibleElems"
+ select="$possibleElems"/>
+ <xsl:with-param
+ name="id"
+ select="$refid"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template
+ name="u:outputNames">
+ <xsl:with-param
+ name="names"
+ select="$possibleElems[position() = substring-before($refElem_index, ' ')]/ <at> names"/>
+ <xsl:with-param
+ name="index"
+ select="number(substring-after($refElem_index, ' '))"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output a string with each space character quoted -->
+ <xsl:template
+ name="u:quoteWhite">
+ <xsl:param
+ name="string"/>
+ <xsl:variable
+ name="head"
+ select="substring-before($string, ' ')"/>
+ <xsl:choose>
+ <xsl:when
+ test="$head = ''">
+ <xsl:value-of
+ select="$string"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="concat($head, '\ ')"/>
+ <xsl:call-template
+ name="u:quoteWhite">
+ <xsl:with-param
+ name="string"
+ select="substring-after($string, ' ')"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!-- Report unknown tags -->
+ <xsl:template
+ match="*">
+ <xsl:message>
+ <xsl:text>`</xsl:text>
+ <xsl:value-of
+ select="name(.)"/>
+ <xsl:text>' encountered</xsl:text>
+ <xsl:if
+ test="parent::*">
+ <xsl:text> in `</xsl:text>
+ <xsl:value-of
+ select="name(parent::*)"/>
+ <xsl:text>'</xsl:text>
+ </xsl:if>
+ <xsl:text>, but no template matches.</xsl:text>
+ </xsl:message>
+ </xsl:template>
+
+</xsl:stylesheet>
+
+<!-- ********************************************************************** -->
+<!-- ********************************************************************** -->
+<!-- ********************************************************************** -->
+<!-- POD manual page
+
+=head1 NAME
+
+xml2rst.xsl - An XSLT script to convert Docutils XML to reStructuredText
+
+=head1 SYNOPSIS
+
+ Xalan docutils.xml xml2rst.xsl
+
+=head1 DESCRIPTION
+
+B<xml2rst.xsl> is an XSLT script to convert Docutils XML to
+reStructuredText. You can use your favorite XSLT processor (e.g. Xalan
+from the Apache project) to generate reStructuredText from the
+Docutils intermediate XML representation. Its main use is to generate
+reStructuredText from some other format where a converter to Docutils
+XML already exists.
+
+=head2 Options
+
+The following options are supported. They are XSLT parameters for the
+whole script and must be given to the XSLT processor by the respective
+option (Xalan: B<-p>).
+
+=over 4
+
+=item adornment
+
+Configures title markup to use so different styles can be requested
+easily.
+
+The value of the parameter must be a string made up of a sequence of
+character pairs. The first character of a pair is C<o> (overline) or
+C<u> (underline) and the second character is the character to use for
+the markup.
+
+The first and the second character pair is used for document title and
+subtitle, the following pairs are used for section titles where the
+third pair is used for the top level section title.
+
+Defaults to C<o=o-u=u-u~u:u.u`>.
+
+=item fold
+
+Configures whether long text lines in paragraphs should be folded and
+to which length. This option is for input not coming from reST which
+may have no internal line feeds in plain text strings.
+
+If folding is enabled text strings not in a line feed preserving
+context are first white-space normalized and then broken according to
+the folding rules. Folding rules put out the first word and continue
+to do so with the following words unless the next word would cross
+the folding boundary. Words are delimited by white-space.
+
+Defaults to C<0>, i.e. no folding.
+
+=back
+
+=head2 Unsupported features
+
+It is generally not possible to create an exact reproduction of an
+original reStructuredText source from an intermediate XML file. The
+reason is that Docutils transports pretty much but not all information
+of the original source into the XML. Also the sequence is changed
+sometimes.
+
+However, the coverage of Docutils features of B<xml2rst.xsl> is pretty
+good. A few minor features are not supported:
+
+=over 4
+
+=item * Fully minimized style for literal blocks
+
+=item * Substitution references for C<replace::> substitutions
+
+=item * Counting roman numbers in enumerated lists
+
+=item * Special table types like C<list-table::> and C<csv-table::>
+
+=item * Custom role definitions
+
+=back
+
+=head1 INSTALLATION
+
+Installation is not necessary. Just use the file as downloaded with
+your favorite XSLT processor.
+
+=head1 AUTHOR
+
+Stefan Merten <smerten <at> oekonux.de> based on works by David Priest.
+
+=head1 LICENSE
+
+This program is licensed under the terms of the GPL. See
+
+ http://www.gnu.org/licenses/gpl.txt
+
+=head1 AVAILABILTY
+
+See
+
+ http://www.merten-home.de/FreeSoftware/xml2rst/
+
+=cut
+
+-->
Copied: trunk/sandbox/xml2rst/rst/xml2rst.xsl (from rev 6464, trunk/sandbox/xml2rst/xml2rst.xsl)
===================================================================
--- trunk/sandbox/xml2rst/rst/xml2rst.xsl (rev 0)
+++ trunk/sandbox/xml2rst/rst/xml2rst.xsl 2010-11-01 12:05:38 UTC (rev 6465)
<at> <at> -0,0 +1,3727 <at> <at>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY CR "
">
+<!-- "xml:space='preserve'" is needed for use with libxslt -->
+<!-- "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'" is needed for
+ use with xsltproc -->
+<!-- Used to create a blank line -->
+<!ENTITY tCR "<xsl:text xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xml:space='preserve'>&CR;</xsl:text>">
+<!-- Used when the line before must be ended -->
+<!ENTITY tEOL "<xsl:text xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xml:space='preserve'>&CR;</xsl:text>">
+<!ENTITY tSP "<xsl:text xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xml:space='preserve'> </xsl:text>">
+]>
+
+<!--
+ Copyright (C) 2005, 2006 Stefan Merten, David Priest
+ Copyright (C) 2009, 2010 Stefan Merten
+
+ xml2rst.xsl 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., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+-->
+
+<!-- ********************************************************************** -->
+<!-- ********************************************************************** -->
+
+<!-- These elements in the DTD need support:
+
+ - ``colspec`` has attribute "stub %yesorno; #IMPLIED"
+
+ - ``document`` has attribute "title CDATA #IMPLIED"
+
+ Probably rendered by the `.. title::` directive
+
+ -->
+
+<!--
+Set namespace extensions. These are used as [shortname]:[tag] throughout the
+XSL-FO files.
+xsl: eXtensible Stylesheet Language
+u: user extensions (indicates utility 'call-template' routines defined in
+these XSL files)
+data: Data elements used by the stylesheet
+-->
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:u="u"
+ xmlns:data="a"
+ exclude-result-prefixes="data"
+ xmlns:str="http://exslt.org/strings"
+ xmlns:dyn="http://exslt.org/dynamic"
+ xmlns:math="http://exslt.org/math"
+ extension-element-prefixes="str dyn math">
+
+ <!-- xmlns:regexp="http://exslt.org/regular-expressions" not supported :-( -->
+
+ <xsl:output
+ method="text"
+ omit-xml-declaration="yes"
+ indent="no"/>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!-- Parameter to configure title markup; see manual page for description -->
+ <xsl:param
+ name="adornment"
+ select="'o=o-u=u-u~u`u,u.'"/>
+
+ <!-- Parameter for folding long lines; see manual page for description -->
+ <xsl:param
+ name="fold"
+ select="0"/>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <xsl:variable
+ name="apos"
+ select='"'"'/>
+
+ <xsl:variable
+ name="structural_elements"
+ select="'*document*section*topic*sidebar*'"/>
+
+ <xsl:variable
+ name="structural_subelements"
+ select="'*title*subtitle*docinfo*decoration*transition*'"/>
+
+ <xsl:variable
+ name="bibliographic_elements"
+ select="'*address*author*authors*contact*copyright*date*field*organization*revision*status*version*'"/>
+
+ <xsl:variable
+ name="decorative_elements"
+ select="'*footer*header*'"/>
+
+ <xsl:variable
+ name="simple_body_elements_no_substitution"
+ select="'*comment*doctest_block*image*literal_block*paragraph*pending*raw*rubric*target*'"/>
+
+ <xsl:variable
+ name="folding_elements"
+ select="concat('*comment*paragraph*rubric*attribution*caption*line*', substring-after($bibliographic_elements, '*'))"/>
+
+ <xsl:variable
+ name="simple_body_elements"
+ select="concat($simple_body_elements_no_substitution, 'substitution_definition*')"/>
+
+ <xsl:variable
+ name="compound_body_elements"
+ select="'*admonition*attention*block_quote*bullet_list*caution*citation*compound*danger*definition_list*enumerated_list*error*field_list*figure*footnote*hint*important*line_block*note*option_list*system_message*table*tip*warning*container*'"/>
+
+ <xsl:variable
+ name="body_elements"
+ select="concat($simple_body_elements, substring-after($compound_body_elements, '*'))"/>
+
+ <xsl:variable
+ name="admonitions"
+ select="'*admonition*attention*caution*danger*error*hint*important*note*tip*warning*'"/>
+
+ <xsl:variable
+ name="simple_body_subelements"
+ select="'*attribution*caption*classifier*colspec*field_name*label*line*option_argument*option_string*term*'"/>
+
+ <xsl:variable
+ name="compound_body_subelements"
+ select="'*definition*definition_list_item*description*entry*field*field_body*legend*list_item*option*option_group*option_list_item*row*tbody*tgroup*thead*'"/>
+
+ <xsl:variable
+ name="inline_elements"
+ select="'*abbreviation*acronym*citation_reference*emphasis*footnote_reference*generated*image*inline*literal*problematic*reference*strong*subscript*substitution_reference*superscript*target*title_reference*raw*'"/>
+
+ <xsl:variable
+ name="inline_containers"
+ select="concat($simple_body_elements_no_substitution, substring-after($inline_elements, '*'))"/>
+
+ <xsl:variable
+ name="directives"
+ select="'*admonition*attention*caution*comment*danger*error*footnote*hint*important*note*tip*warning*image*figure*topic*sidebar*rubric*meta*raw*citation*compound*substitution_definition*container*'"/>
+
+ <xsl:variable
+ name="titled_elements"
+ select="'*sidebar*topic*admonition*'"/>
+
+ <xsl:variable
+ name="blank_after"
+ select="concat($structural_elements, substring-after($structural_subelements, '*'), substring-after($body_elements, '*'))"/>
+
+ <xsl:variable
+ name="adornment_characters"
+ select="concat($apos, '!"#$%&()*+,-./:;<=>? <at> [\]^_`{|}~')"/>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: ((title, subtitle?)?, docinfo?, decoration?,
+ %structure.model;)
+
+ Attributes: The document element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+
+ Depending on the source of the data and the stage of processing, the
+ "document" may not initially contain a "title". A document title is not
+ directly representable in reStructuredText. Instead, a lone top-level section
+ may have its title promoted to become the document title, and similarly for a
+ lone second-level (sub)section's title to become the document subtitle. The
+ "docinfo" may be transformed from an initial field_list, and "decoration" is
+ usually constructed programmatically.
+ -->
+ <!-- == structural_element -->
+ <xsl:template
+ match="document">
+ <xsl:if
+ test="//generated[ <at> classes = 'sectnum']">
+ <xsl:text>.. section-numbering::</xsl:text>
+ &tEOL;
+ &tCR;
+ </xsl:if>
+ <xsl:call-template
+ name="u:outputClass">
+ <xsl:with-param
+ name="blankAfter"
+ select="true()"/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (title, %structure.model;)
+ Attributes: The section element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == structural_element -->
+ <xsl:template
+ match="section">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:blank"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- == structural_element -->
+ <xsl:template
+ match="section[ <at> classes = 'system-messages']"/>
+ <!-- Ignore system messages completely -->
+ <!-- This should be really in `generated' -->
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (title, subtitle?, (%body.elements;)+)
+ Attributes: The sidebar element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == structural_element == directive -->
+ <xsl:template
+ match="sidebar">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. sidebar:: </xsl:text>
+ <xsl:value-of
+ select="title"/>
+ &tEOL;
+ <xsl:if
+ test="subtitle">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'subtitle'"/>
+ <xsl:with-param
+ name="value"
+ select="subtitle"/>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:call-template
+ name="u:params"/>
+ <!-- Always blank line after parameter block -->
+ &tCR;
+ <xsl:apply-templates
+ select="*[not(self::title) and not(self::subtitle)]"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (title?, (%body.elements;)+)
+ Attributes: The topic element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == structural_element == directive -->
+ <xsl:template
+ match="topic">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. topic:: </xsl:text>
+ <xsl:value-of
+ select="title"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:params"/>
+ <xsl:apply-templates
+ select="*[not(self::title)]"/>
+ </xsl:template>
+
+ <!-- == structural_element == directive -->
+ <xsl:template
+ match="topic[starts-with( <at> classes, 'contents')]">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. contents:: </xsl:text>
+ <xsl:apply-templates
+ select="title"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:params">
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'ids' and name() != 'names' and name() != 'classes']"/>
+ </xsl:call-template>
+ <xsl:variable
+ name="isLocal"
+ select="substring-before( <at> classes, ' local')"/>
+ <xsl:variable
+ name="realClassesLocal"
+ select="normalize-space(substring-after( <at> classes, 'contents'))"/>
+ <xsl:variable
+ name="realClassesNode">
+ <xsl:choose>
+ <xsl:when
+ test="$isLocal">
+ <xsl:value-of
+ select="normalize-space(substring-before($realClassesLocal, 'local'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$realClassesLocal"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable
+ name="realClasses"
+ select="string($realClassesNode)"/>
+ <xsl:if
+ test="$isLocal">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'local'"/>
+ <xsl:with-param
+ name="value"
+ select="''"/>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if
+ test="$realClasses">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'class'"/>
+ <xsl:with-param
+ name="value"
+ select="$realClasses"/>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- Autogenerated content is discarded -->
+ &tCR;
+ </xsl:template>
+
+ <!-- == structural_element == directive -->
+ <xsl:template
+ match="topic[ <at> classes='dedication' or <at> classes='abstract']">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>:</xsl:text>
+ <xsl:apply-templates
+ select="title"/>
+ <xsl:text>: </xsl:text>
+ &tEOL;
+ <xsl:apply-templates
+ select="*[not(self::title)]"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (title, (%body.elements;)+)
+ Attributes: The admonition element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="admonition">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. admonition:: </xsl:text>
+ <xsl:apply-templates
+ select="title"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:params">
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'classes' or not(starts-with(., 'admonition-'))]"/>
+ </xsl:call-template>
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:apply-templates
+ select="*[not(self::title)]"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)+
+ Attributes: The note element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="attention | caution | danger | error | hint | important | note | tip | warning">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. </xsl:text>
+ <xsl:value-of
+ select="name()"/>
+ <xsl:text>:: </xsl:text>
+ <xsl:call-template
+ name="u:params">
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'classes']"/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (header?, footer?)
+ Attributes: The decoration element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+
+ Although the content model doesn't specifically require contents, no empty
+ decoration elements are ever created.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="//document/decoration">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- TODO To be rendered as `.. header::` directive -->
+ <!-- == decorative_element -->
+ <xsl:template
+ match="//document/decoration/header">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- TODO To be rendered as `.. footer::` directive -->
+ <!-- == decorative_element -->
+ <xsl:template
+ match="//document/decoration/footer">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%bibliographic.elements;)+
+ Attributes: The docinfo element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="docinfo">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:blank"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: ((author, organization?, address?, contact?)+)
+ Attributes: The authors element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+
+ In reStructuredText, multiple author's names are separated with semicolons
+ (";") or commas (","); semicolons take precedence. There is currently no way
+ to represent the author's organization, address, or contact in a
+ reStructuredText "Authors" field.
+ -->
+ <!-- == bibliographic_element == folding_element -->
+ <xsl:template
+ match="docinfo/authors">
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>:</xsl:text>
+ <xsl:value-of
+ select="name()"/>
+ <xsl:text>: </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Content Model: %text.model;
+ Attributes: All docinfo elements contains the common attributes (ids,
+ names, dupnames, source, and classes)
+ Some docinfo elements also have xml:space.
+ -->
+ <xsl:template
+ match="docinfo/authors/*">
+ <xsl:apply-templates/>
+ <!-- no semicolon after final author -->
+ <xsl:if
+ test="generate-id(current()) != generate-id(../*[last()])">
+ <xsl:text>; </xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Content Model: (field_name, field_body)
+ Attributes: The field element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == bibliographic_element -->
+ <xsl:template
+ match="docinfo/field">
+ <!-- contents handled by ordinary field lists -->
+ <xsl:apply-templates/>
+ <!-- Supply an EOL because following elements do not recognize this -->
+ &tEOL;
+ </xsl:template>
+
+ <!--
+ Content Model: %text.model;
+ Attributes: All docinfo elements contains the common attributes (ids,
+ names, dupnames, source, and classes)
+ Some docinfo elements also have xml:space.
+ -->
+ <!-- == bibliographic_element == folding_element -->
+ <xsl:template
+ match="docinfo/*[name()!='authors' and name()!='field']">
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>:</xsl:text>
+ <xsl:value-of
+ select="name()"/>
+ <xsl:text>: </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: EMPTY
+ Attributes: The transition element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="transition">
+ <xsl:call-template
+ name="u:outputClass"/>
+ &tCR; <!-- req: blank line before -->
+ <xsl:text>-----</xsl:text>
+ &tEOL;
+ <!-- Add a required blank line after unless class follows immediately -->
+ <xsl:if
+ test="not(following-sibling::*[1]/ <at> classes)">
+ &tCR;
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!--
+ IFF there is a /document/title element, it is the publication's title. All
+ other titles will appear within sections.
+
+ Content Model: %text.model;
+ Attributes: The title element contains the common attributes (ids, names,
+ dupnames, source, and classes), plus refid and auto.
+ refid is used as a backlink to a table of contents entry.
+ auto is used to indicate (with value "1") that the title has been
+ numbered automatically.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="//document/title">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:variable
+ name="textWS">
+ <!-- Catch the title text as it is rendered so its length can be
+ determined -->
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <xsl:variable
+ name="text"
+ select="normalize-space($textWS)"/>
+ <xsl:variable
+ name="length"
+ select="string-length($text)"/>
+ <xsl:call-template
+ name="u:overline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="1"/>
+ </xsl:call-template>
+ <xsl:value-of
+ select="$text"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:underline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="1"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Title Underlines are defined by their position within the tree.
+
+ Content Model: %text.model;
+ Attributes: The title element contains the common attributes (ids, names,
+ dupnames, source, and classes), plus refid and auto.
+ refid is used as a backlink to a table of contents entry.
+ auto is used to indicate (with value "1") that the title has been
+ numbered automatically.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="section/title">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:variable
+ name="textWS">
+ <!-- catch the title text as it is rendered -->
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <xsl:variable
+ name="text"
+ select="normalize-space($textWS)"/>
+ <xsl:variable
+ name="length"
+ select="string-length($text)"/>
+ <xsl:variable
+ name="depth"
+ select="count(ancestor::section)"/>
+ <xsl:call-template
+ name="u:overline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="$depth + 2"/>
+ </xsl:call-template>
+ <xsl:value-of
+ select="$text"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:underline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="$depth + 2"/>
+ </xsl:call-template>
+ <!-- Add a blank line after unless structure follows immediately -->
+ <xsl:if
+ test="not(contains(concat($structural_elements, $compound_body_elements), concat('*', name(following-sibling::*[1]), '*')) or following-sibling::*[1]/ <at> classes)">
+ &tCR;
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The title element contains the common attributes (ids, names,
+ dupnames, source, and classes), plus refid and auto.
+ refid is used as a backlink to a table of contents entry.
+ auto is used to indicate (with value "1") that the title has been
+ numbered automatically.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="title">
+ <xsl:call-template
+ name="u:outputClass">
+ <xsl:with-param
+ name="alreadyBlanked"
+ select="true()"/>
+ </xsl:call-template>
+ <!-- blank line provided by parent -->
+ <xsl:apply-templates/>
+ <!-- no EOL: provided by parent -->
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ IFF there is a /document/title element, it is the publication's title. All
+ other titles will appear within sections.
+
+ Content Model: %text.model;
+ Attributes: The subtitle element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="//document/subtitle">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:variable
+ name="textWS">
+ <!-- Catch the title text as it is rendered -->
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <xsl:variable
+ name="text"
+ select="normalize-space($textWS)"/>
+ <xsl:variable
+ name="length"
+ select="string-length($text)"/>
+
+ <!-- always a blank line above -->
+ &tCR;
+ <xsl:call-template
+ name="u:overline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="2"/>
+ </xsl:call-template>
+ <xsl:value-of
+ select="$text"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:underline">
+ <xsl:with-param
+ name="length"
+ select="$length"/>
+ <xsl:with-param
+ name="depth"
+ select="2"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The subtitle element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == structural_subelement -->
+ <xsl:template
+ match="sidebar/subtitle">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:apply-templates/>
+ &tEOL;
+ &tCR;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The comment element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_element == folding_element == directive -->
+ <xsl:template
+ match="comment">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>.. </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The doctest_block element contains the common attributes (ids,
+ names, dupnames, source, and classes), plus xml:space.
+ -->
+ <!-- == simple_body_element -->
+ <xsl:template
+ match="doctest_block">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:apply-templates/>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- An image element can have various roles; they are all covered here -->
+ <!-- == simple_body_element == inline_element == directive -->
+ <xsl:template
+ match="image">
+ <xsl:choose>
+ <xsl:when
+ test="contains($inline_containers, concat('*', name(..), '*')) and <at> alt">
+ <!-- An inline image with an ` <at> alt' - must be a substitution
+ reference -->
+ <xsl:text>|</xsl:text>
+ <!-- Original text is lost - use what we have -->
+ <xsl:value-of
+ select=" <at> alt"/>
+ <xsl:text>|</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- A directive -->
+ <xsl:if
+ test="not(parent::figure)">
+ <xsl:if
+ test="not(parent::substitution_definition)">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. </xsl:text>
+ </xsl:if>
+ <xsl:text>image:: </xsl:text>
+ </xsl:if>
+ <xsl:value-of
+ select=" <at> uri"/>
+ &tEOL;
+ <xsl:choose>
+ <xsl:when
+ test="parent::figure">
+ <!-- ` <at> classes' is special because it is in the parent -->
+ <xsl:if
+ test="../ <at> classes">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'figclass'"/>
+ <xsl:with-param
+ name="value"
+ select="../ <at> classes"/>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- ` <at> align' is special because it is in the parent -->
+ <xsl:if
+ test="../ <at> align">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'align'"/>
+ <xsl:with-param
+ name="value"
+ select="../ <at> align"/>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:call-template
+ name="u:params">
+ <!-- `figure' would add one level of indentation -->
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor::*"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when
+ test="parent::substitution_definition">
+ <xsl:call-template
+ name="u:params">
+ <!-- ` <at> alt' only for the real images -->
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'alt']"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:params">
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'ids' and name() != 'names']"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if
+ test="parent::reference">
+ <!-- A clickable image -->
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="name"
+ select="'target'"/>
+ <xsl:with-param
+ name="value">
+ <xsl:choose>
+ <xsl:when
+ test="../ <at> name">
+ <!-- An internal link -->
+ <xsl:call-template
+ name="u:inlineReference">
+ <xsl:with-param
+ name="text"
+ select="../ <at> refid"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- An external link -->
+ <xsl:value-of
+ select="../ <at> refuri"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- Always blank line after parameter block -->
+ &tCR;
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (line_block | line)+
+ Attributes: The line_block element contains the common attributes (ids,
+ names, dupnames, source, and classes), plus xml:space.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="line_block">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:variable
+ name="isEmbedded"
+ select="name(..) = 'line_block'"/>
+ <xsl:if
+ test="not($isEmbedded)">
+ <xsl:call-template
+ name="u:blank"/>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The line element contains the common attributes (ids,
+ names, dupnames, source, and classes).
+ -->
+ <!-- == simple_body_subelement == folding_element -->
+ <xsl:template
+ match="line">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:variable
+ name="indent">
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:variable>
+ <xsl:value-of
+ select="$indent"/>
+ <xsl:choose>
+ <xsl:when
+ test="node()">
+ <!-- Only for non-empty lines -->
+ <xsl:variable
+ name="lineBlockIndent">
+ <!-- Very special indendation for nested `line_block's -->
+ <xsl:for-each
+ select="ancestor::line_block[position() > 1]">
+ <xsl:value-of
+ select="str:padding(4)"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>| </xsl:text>
+ <xsl:value-of
+ select="$lineBlockIndent"/>
+ </xsl:with-param>
+ <xsl:with-param
+ name="indent"
+ select="concat($indent, ' ', $lineBlockIndent)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>|</xsl:text>
+ &tEOL;
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The literal_block element contains the common attributes (ids,
+ names, dupnames, source, and classes), plus xml:space.
+ -->
+ <!-- == simple_body_element == directive -->
+ <xsl:template
+ match="literal_block">
+ <xsl:choose>
+ <xsl:when
+ test=".//*[contains($inline_elements, concat('*', name(), '*'))]">
+ <!-- If it contains inline elements this is a parsed-literal -->
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. parsed-literal::</xsl:text>
+ &tEOL;
+ <xsl:call-template
+ name="u:params"/>
+ &tCR;
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:outputClass"/>
+ <!-- TODO Support for the (fully) minimized style would be nice but
+ is difficult to accomplish because there is a linefeed
+ already when we arrive here :-( -->
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>::</xsl:text>
+ &tEOL;
+ &tCR;
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:variable
+ name="isQuotedLiteral">
+ <xsl:call-template
+ name="u:isQuotedLiteral"/>
+ </xsl:variable>
+ <!-- Indent correctly depending on quoted literal or not -->
+ <xsl:choose>
+ <xsl:when
+ test="string-length($isQuotedLiteral)">
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor::*"/>
+ </xsl:call-template>
+ <xsl:apply-templates
+ mode="quotedLiteral"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ &tEOL;
+ </xsl:template>
+
+ <!-- Indent a text of a quoted literal containing line feeds correctly -->
+ <xsl:template
+ match="text()"
+ mode="quotedLiteral">
+ <xsl:call-template
+ name="u:indentLF">
+ <xsl:with-param
+ name="indent">
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor::*[position() > 1]"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- Determine whether `$text' is a quoted literal and return the quote
+ character if so -->
+ <xsl:template
+ name="u:isQuotedLiteral">
+ <xsl:param
+ name="text"
+ select="text()"/>
+ <xsl:param
+ name="quote"
+ select="substring($text, 1, 1)"/>
+ <xsl:if
+ test="contains($adornment_characters, $quote) and substring($text, 1, 1) = $quote">
+ <!-- Given quote is an adornment character and first character is this
+ quote -->
+ <xsl:choose>
+ <xsl:when
+ test="contains($text, '
')">
+ <!-- Test the remaining lines -->
+ <xsl:call-template
+ name="u:isQuotedLiteral">
+ <xsl:with-param
+ name="text"
+ select="substring-after($text, '
')"/>
+ <xsl:with-param
+ name="quote"
+ select="$quote"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- No more lines to test so this is a quoted literal -->
+ <xsl:value-of
+ select="$quote"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The paragraph element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_element == folding_element -->
+ <xsl:template
+ match="paragraph">
+ <xsl:variable
+ name="previous"
+ select="preceding-sibling::*[1]"/>
+ <!-- Do indent except first element in some compound elements -->
+ <xsl:variable
+ name="needsIndent"
+ select="($previous or not(parent::list_item or parent::field_body or contains($admonitions, concat('*', name(..), '*')))) and name($previous) != 'label'"/>
+ <!-- Blank line in front if following a body element, except first
+ elements in some compound elements -->
+ <xsl:variable
+ name="needsBlank"
+ select="($previous or not(parent::list_item or ../parent::option_list_item or parent::field_body or parent::document or contains($admonitions, concat('*', name(..), '*')))) and (not($previous) or contains($body_elements, concat('*', name($previous), '*')) or name($previous) = 'title' and contains($titled_elements, concat('*', name(..), '*')) or name($previous) = 'docinfo')"/>
+ <xsl:if
+ test="$needsBlank">
+ &tCR;
+ </xsl:if>
+ <xsl:if
+ test="$needsIndent">
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:if>
+ <xsl:if
+ test=" <at> classes">
+ <!-- This paragraph has a classes attribute - always needs newline and
+ indent -->
+ <xsl:call-template
+ name="u:outputClass">
+ <xsl:with-param
+ name="alreadyBlanked"
+ select="$needsBlank"/>
+ <xsl:with-param
+ name="alreadyIndented"
+ select="$needsIndent"/>
+ </xsl:call-template>
+ <xsl:call-template
+ name="u:BandI"/>
+ </xsl:if>
+ <xsl:call-template
+ name="u:outputFolding"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_element -->
+ <xsl:template
+ match="pending">
+ <xsl:call-template
+ name="u:notSupported"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_element == inline_element == directive -->
+ <xsl:template
+ match="raw">
+ <xsl:choose>
+ <xsl:when
+ test="contains($inline_containers, concat('*', name(..), '*'))">
+ <!-- Used as a custom role -->
+ <!-- TODO `role' directives must be generated for user-defined raw
+ roles. -->
+ <!-- The name of the custom role is not contained in the input -->
+ <xsl:text>:RAW-ROLE:`</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>`</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- A directive -->
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. raw:: </xsl:text>
+ <xsl:value-of
+ select=" <at> format"/>
+ &tEOL;
+ <xsl:call-template
+ name="u:params">
+ <xsl:with-param
+ name="params"
+ select=" <at> *[name() != 'format' and name() != 'classes']"/>
+ </xsl:call-template>
+ &tCR;
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
+ &tEOL;
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_element == folding_element == directive -->
+ <xsl:template
+ match="rubric">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>.. rubric:: </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template
+ name="u:params"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="compound">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. compound::</xsl:text>
+ &tEOL;
+ <xsl:call-template
+ name="u:params"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="container">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. container::</xsl:text>
+ <xsl:if
+ test=" <at> classes">
+ &tSP;
+ <xsl:value-of
+ select=" <at> classes"/>
+ </xsl:if>
+ &tEOL;
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_element == directive -->
+ <xsl:template
+ match="substitution_definition">
+ <!-- More than one child or not a directive is a replacement text -->
+ <xsl:variable
+ name="isReplace"
+ select="not(* and count(node()) = 1 and contains($directives, concat('*', name(*[1]), '*')))"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:variable
+ name="prefix">
+ <xsl:text>.. |</xsl:text>
+ <xsl:call-template
+ name="u:outputNames"/>
+ <xsl:text>| </xsl:text>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when
+ test="$isReplace">
+ <!-- TODO Substitution references for replace can not be found because
+ they are not marked as such; embedding them in `generated'
+ would be nice -->
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:value-of
+ select="$prefix"/>
+ <xsl:text>replace:: </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$prefix"/>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: ((%body.elements;)+, attribution?)
+ Attributes: The block_quote element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="block_quote">
+ <xsl:if
+ test=" <at> classes = 'epigraph' or <at> classes = 'highlights' or <at> classes = 'pull-quote'">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. </xsl:text>
+ <xsl:value-of
+ select=" <at> classes"/>
+ <xsl:text>::</xsl:text>
+ &tEOL;
+ <xsl:call-template
+ name="u:params"/>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_subelement == folding_element -->
+ <xsl:template
+ match="attribution">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <!-- blank line between quote and attribution -->
+ &tCR;
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:call-template
+ name="u:outputFolding">
+ <xsl:with-param
+ name="prefix">
+ <xsl:text>-- </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="citation">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. [</xsl:text>
+ <xsl:value-of
+ select="label"/>
+ <xsl:text>] </xsl:text>
+ <xsl:apply-templates
+ select="*[not(self::label)]"/>
+ </xsl:template>
+
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="citation/label">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="figure">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. figure:: </xsl:text>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == simple_body_subelement == folding_element -->
+ <xsl:template
+ match="caption">
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:call-template
+ name="u:outputFolding"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="legend">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- TODO Footnotes should continue on line of definition -->
+
+ <!-- user-numbered footnotes lack <at> auto -->
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="footnote[not( <at> auto)]">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. [</xsl:text>
+ <xsl:apply-templates
+ select="label"/>
+ <xsl:text>] </xsl:text>
+ <xsl:apply-templates
+ select="*[not(self::label)]"/>
+ </xsl:template>
+
+ <!-- autonumbered footnotes have <at> auto -->
+ <!-- if the target footnote_reference <at> names matches its label, it was not a
+ numbered-name footnote -->
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="footnote[ <at> auto='1']">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. [#</xsl:text>
+ <xsl:if
+ test=" <at> names = <at> ids">
+ <xsl:call-template
+ name="u:outputNames"/>
+ </xsl:if>
+ <xsl:text>] </xsl:text>
+ <xsl:apply-templates
+ select="*[not(self::label)]"/>
+ </xsl:template>
+
+ <!-- autosymboled footnotes have <at> auto -->
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="footnote[ <at> auto='*']">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. [*] </xsl:text>
+ <xsl:apply-templates
+ select="*[not(self::label)]"/>
+ </xsl:template>
+
+ <!-- == compound_body_element == directive -->
+ <xsl:template
+ match="footnote[starts-with( <at> names, 'TARGET_NOTE:\ ')]">
+ <!-- This is not a footnote but a hint for a directive -->
+ <xsl:if
+ test="generate-id(//footnote[starts-with( <at> names, 'TARGET_NOTE:\ ')][1]) = generate-id(.)">
+ <!-- Only for the first one -->
+ <xsl:call-template
+ name="u:BandI"/>
+ <!-- TODO May have a `classes` attribute -->
+ <xsl:text>.. target-notes::</xsl:text>
+ &tEOL;
+ </xsl:if>
+ </xsl:template>
+
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="footnote/label">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (list_item +)
+ Attributes: The bullet_list element contains the common attributes (ids,
+ names, dupnames, source, and classes), plus bullet.
+ bullet is used to record the style of bullet from the input data.
+ In documents processed from reStructuredText, it contains one of "-",
+ "+", or "*". It may be ignored in processing.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="bullet_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates
+ mode="bullet_list"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (definition_list_item +)
+ Attributes: The definition_list element contains only the common
+ attributes: ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="definition_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (term, classifier?, definition)
+ Attributes: The definition_list_item element contains only the common
+ attributes: ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="definition_list_item">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The term element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="term">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The classifier element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="classifier">
+ <xsl:text> : </xsl:text>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)+
+ Attributes: The definition element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="definition">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (list_item +)
+ Attributes: The enumerated_list element contains the common attributes
+ (ids, names, dupnames, source, and classes), plus enumtype, prefix, suffix, and
+ start.
+ enumtype is used to record the intended enumeration sequence, one
+ of "arabic" (1, 2, 3, ...), "loweralpha" (a, b, c, ..., z), "upperalpha" (A,
+ B, C, ..., Z), "lowerroman" (i, ii, iii, iv, ..., mmmmcmxcix [4999]), or
+ "upperroman" (I, II, III, IV, ..., MMMMCMXCIX [4999]).
+ prefix stores the formatting characters used before the enumerator. In
+ documents originating from reStructuredText data, it will contain either ""
+ (empty string) or "(" (left parenthesis). It may or may not affect
+ processing.
+ suffix stores the formatting characters used after the enumerator. In
+ documents originating from reStructuredText data, it will contain either "."
+ (period) or ")" (right parenthesis). Depending on the capabilities of the
+ output format, this attribute may or may not affect processing.
+ start contains the ordinal value of the first item in the list, in
+ decimal. For lists beginning at value 1 ("1", "a", "A", "i", or "I"), this
+ attribute may be omitted.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="enumerated_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates
+ mode="enumerated_list"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (field +)
+ Attributes: The field_list element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="field_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (field_name, field_body)
+ Attributes: The field element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="field">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ********************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ Attributes: The field_name element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="field_name">
+ <xsl:text>:</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>: </xsl:text>
+ <!-- no EOL: field_body starts on same line -->
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)*
+ Attributes: The field_body element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="field_body">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (option_list_item +)
+ Attributes: The option_list element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="option_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:blank"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (option_group, description)
+ Attributes: The option_list_item element contains only the common
+ attributes: ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="option_list_item">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (option_group, description)
+ Attributes: The option_group element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="option_group">
+ <xsl:apply-templates/>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (option_string, option_argument *)
+ Attributes: The option element contains only the common attributes: ids,
+ names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="option">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ <xsl:if
+ test="generate-id(current()) != generate-id(../*[last()])">
+ <!-- No comma after final option -->
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <!-- no EOL: description on same line -->
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (#PCDATA)
+ Attributes: The option_string element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="option_string">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (#PCDATA)
+ Attributes: The option_argument element contains the common attributes
+ (ids, names, dupnames, source, and classes), plus delimiter.
+ delimiter contains the text preceding the option_argument:
+ either the text separating it from the option_string (typically
+ either "=" or " ")
+ or the text between option arguments (typically either "," or " ").
+ -->
+ <!-- == simple_body_subelement -->
+ <xsl:template
+ match="option_argument">
+ <xsl:value-of
+ select=" <at> delimiter"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)+
+ Attributes: The description element contains only the common attributes:
+ ids, names, dupnames, source, and classes.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="description">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:apply-templates/>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)+
+ Attributes: The list_item element contains only the common attributes:
+ ids, names, dupnames, source, and classes
+
+ BULLET LIST
+ bullet is used to record the style of bullet from the input data.
+ In documents processed from reStructuredText, it contains one of "-",
+ "+", or "*". It may be ignored in processing.
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="list_item"
+ mode="bullet_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:value-of
+ select="../ <at> bullet"/>
+ &tSP; <!-- space after bullet -->
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ ENUMERATED LIST
+ enumtype is used to record the intended enumeration sequence, one of
+ "arabic" (1, 2, 3, ...), "loweralpha" (a, b, c, ..., z), "upperalpha" (A, B,
+ C, ..., Z), "lowerroman" (i, ii, iii, iv, ..., mmmmcmxcix [4999]), or
+ "upperroman" (I, II, III, IV, ..., MMMMCMXCIX [4999]).
+ prefix stores the formatting characters used before the enumerator. In
+ documents originating from reStructuredText data, it will contain either ""
+ (empty string) or "(" (left parenthesis). It may or may not affect
+ processing.
+ suffix stores the formatting characters used after the enumerator. In
+ documents originating from reStructuredText data, it will contain either "."
+ (period) or ")" (right parenthesis). Depending on the capabilities of the
+ output format, this attribute may or may not affect processing.
+ start contains the ordinal value of the first item in the list, in
+ decimal. For lists beginning at value 1 ("1", "a", "A", "i", or "I"), this
+ attribute may be omitted.
+
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="list_item"
+ mode="enumerated_list">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:call-template
+ name="u:outputEnumerator"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- Outputs a complete enumerator when called in an
+ enumerated_list/list_item -->
+ <xsl:template
+ name="u:outputEnumerator">
+ <!-- Use parent's numeration attribute -->
+ <xsl:variable
+ name="enumType"
+ select="../ <at> enumtype"/>
+ <!-- Determine starting point -->
+ <xsl:variable
+ name="start">
+ <xsl:choose>
+ <xsl:when
+ test="../ <at> start">
+ <xsl:value-of
+ select="../ <at> start"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Determine position of this item in its real context -->
+ <xsl:variable
+ name="position">
+ <xsl:variable
+ name="wanted"
+ select="generate-id()"/>
+ <!-- Generate the right current node list -->
+ <xsl:for-each
+ select="../list_item">
+ <xsl:if
+ test="generate-id() = $wanted">
+ <xsl:value-of
+ select="position()"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <!-- Determine encoding of the number for the given numeration -->
+ <xsl:variable
+ name="cur">
+ <xsl:call-template
+ name="u:position2Enumerator">
+ <xsl:with-param
+ name="enumType"
+ select="$enumType"/>
+ <xsl:with-param
+ name="position"
+ select="$position"/>
+ <xsl:with-param
+ name="start"
+ select="$start"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Determine encoding of the maximum number -->
+ <xsl:variable
+ name="max">
+ <xsl:call-template
+ name="u:position2Enumerator">
+ <xsl:with-param
+ name="enumType"
+ select="$enumType"/>
+ <xsl:with-param
+ name="position"
+ select="count(../list_item)"/>
+ <xsl:with-param
+ name="start"
+ select="$start"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Output complete enumerator -->
+ <xsl:value-of
+ select="../ <at> prefix"/>
+ <xsl:value-of
+ select="$cur"/>
+ <xsl:value-of
+ select="../ <at> suffix"/>
+ <!-- Output at least one trailing space -->
+ &tSP;
+ <!-- Output more whitespace to align with the maximum enumerator -->
+ <xsl:if
+ test="$enumType != 'lowerroman' and $enumType != 'upperroman'">
+ <!-- Assumes that the maximum number has maximum string length -->
+ <xsl:value-of
+ select="str:padding(string-length($max) - string-length($cur))"/>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Determine the right ordinal enumerator based on the parameters -->
+ <xsl:template
+ name="u:position2Enumerator">
+ <xsl:param
+ name="enumType"/>
+ <xsl:param
+ name="start"/>
+ <xsl:param
+ name="position"/>
+ <!-- Determine logical number -->
+ <xsl:variable
+ name="ordinal"
+ select="$start - 1 + $position"/>
+ <xsl:choose>
+ <xsl:when
+ test="$enumType = 'arabic'">
+ <xsl:value-of
+ select="$ordinal"/>
+ </xsl:when>
+ <xsl:when
+ test="$enumType = 'loweralpha'">
+ <xsl:value-of
+ select="substring('abcdefghijklmnopqrstzuvwxyz', $ordinal, 1)"/>
+ </xsl:when>
+ <xsl:when
+ test="$enumType = 'upperalpha'">
+ <xsl:value-of
+ select="substring('ABCDEFGHIJKLMNOPQRSTZUVWXYZ', $ordinal, 1)"/>
+ </xsl:when>
+ <!-- TODO Support for counting roman numbers -->
+ <xsl:when
+ test="$enumType = 'lowerroman'">
+ <xsl:text>i</xsl:text>
+ </xsl:when>
+ <xsl:when
+ test="$enumType = 'upperroman'">
+ <xsl:text>I</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (title?, tgroup+)
+ Attributes: The table element contains the common attributes and:
+ frame, colsep, rowsep, pgwide
+ -->
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="table">
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:blank"/>
+ <xsl:apply-templates
+ select="tgroup"/>
+ <xsl:if
+ test="title">
+ <!-- TODO A table title must be rendered by using the `.. table::'
+ directive -->
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:apply-templates
+ select="title"/>
+ &tEOL;
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (colspec*, thead?, tbody)
+ Attributes: The tgroup element contains the common attributes and:
+ cols, colsep, rowsep, align
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="tgroup">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: EMPTY
+ Attributes: The colspec element contains the common attributes and:
+ colnum, colname, colwidth, colsep, rowsep, align, char, charoff
+
+ The colwidth attribute gives the width of the respective column in characters
+ including padding whitespace but no separator markup.
+ -->
+ <!-- == simple_body_subelement -->
+ <!-- <at> colwidth needed by children but element has no own output -->
+ <xsl:template
+ match="colspec"/>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (row+)
+ Attributes: The thead element contains the common attributes and:
+ valign
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="thead">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!--
+ Content Model: (row+)
+ Attributes: The tbody element contains the common attributes and:
+ valign
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="tbody">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (entry+)
+ Attributes: The row element contains the common attributes and:
+ rowsep, valign
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="row">
+ <!-- Separator line above unless first row of a tbody with no previous
+ thead (in this case the separator line is output already as the
+ closing separator line of thead) -->
+ <xsl:if
+ test="position() > 1 or parent::thead or parent::tbody and not(../../thead)">
+ <xsl:call-template
+ name="u:rowSeparatorLine"/>
+ </xsl:if>
+ <!-- Determine heights in physical lines of all entries -->
+ <xsl:variable
+ name="heights">
+ <xsl:for-each
+ select="entry">
+ <xsl:variable
+ name="text">
+ <!-- Catch the text of all entries -->
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <!-- Compute height of this entry; leading and trailing EOL must be
+ subtracted -->
+ <xsl:value-of
+ select="string-length($text) - string-length(translate($text, '
', '')) - 1"/>
+ &tSP; <!-- A space as a list separator -->
+ </xsl:for-each>
+ </xsl:variable>
+ <!-- Determine maximum height so every entry must be this high -->
+ <xsl:variable
+ name="maxHeight"
+ select="math:max(str:tokenize(normalize-space($heights)))"/>
+ <!-- Output all the physical lines of this row -->
+ <xsl:call-template
+ name="u:rowLines">
+ <xsl:with-param
+ name="currentLine"
+ select="1"/>
+ <xsl:with-param
+ name="maxLine"
+ select="$maxHeight"/>
+ </xsl:call-template>
+ <!-- Output final separator line if this is the last row -->
+ <xsl:if
+ test="position() = last()">
+ <xsl:call-template
+ name="u:rowSeparatorLine">
+ <xsl:with-param
+ name="char">
+ <!-- Determine correct character for the separator line -->
+ <xsl:choose>
+ <xsl:when
+ test="parent::thead">
+ <xsl:value-of
+ select="'='"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="'-'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Output physical line $currentLine of a row and continue until
+ line $maxLine is output -->
+ <xsl:template
+ name="u:rowLines">
+ <xsl:param
+ name="currentLine"/>
+ <xsl:param
+ name="maxLine"/>
+ <xsl:if
+ test="$currentLine <= $maxLine">
+ <!-- If there are still physical lines to output do it -->
+ <xsl:call-template
+ name="u:indent"/>
+ <!-- Leading bar -->
+ <xsl:text>|</xsl:text>
+ <xsl:apply-templates>
+ <xsl:with-param
+ name="currentLine"
+ select="$currentLine"/>
+ </xsl:apply-templates>
+ <!-- End of this physical line -->
+ &tEOL;
+ <!-- Continue with the next physical line -->
+ <xsl:call-template
+ name="u:rowLines">
+ <xsl:with-param
+ name="currentLine"
+ select="$currentLine + 1"/>
+ <xsl:with-param
+ name="maxLine"
+ select="$maxLine"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Output a separator line with all the right characters -->
+ <xsl:template
+ name="u:rowSeparatorLine">
+ <xsl:param
+ name="char"
+ select="'-'"/>
+ <xsl:call-template
+ name="u:indent"/>
+ <xsl:text>+</xsl:text>
+ <xsl:for-each
+ select="../../colspec">
+ <xsl:value-of
+ select="str:padding( <at> colwidth, $char)"/>
+ <xsl:text>+</xsl:text>
+ </xsl:for-each>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: (%body.elements;)*
+ Attributes: The entry element contains the common attributes and:
+ colname, namest, morerows, colsep, rowsep, align, char, charoff, valign and
+ morecols
+ -->
+ <!-- == compound_body_subelement -->
+ <xsl:template
+ match="entry">
+ <!-- TODO `classes` attribute needs support -->
+ <!-- This is called in two ways; if $currentLine = 0 all physical lines
+ of this entry must be output; if $currentLine > 0 the physical line
+ with exactly this number shall be output -->
+ <xsl:param
+ name="currentLine"
+ select="0"/>
+ <xsl:variable
+ name="column"
+ select="position() + sum(preceding-sibling::entry/ <at> morecols)"/>
+ <!-- Determine width in characters needed for this entry -->
+ <xsl:variable
+ name="width">
+ <xsl:call-template
+ name="u:computeEntryWidth">
+ <xsl:with-param
+ name="colspecs"
+ select="../../../colspec"/>
+ <xsl:with-param
+ name="column"
+ select="$column"/>
+ <xsl:with-param
+ name="span"
+ select=" <at> morecols"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Output the entry completely or a certain physical line -->
+ <xsl:call-template
+ name="u:outputEntry">
+ <xsl:with-param
+ name="string">
+ <!-- Capture physical lines of the entry in a variable -->
+ <xsl:apply-templates/>
+ </xsl:with-param>
+ <xsl:with-param
+ name="width"
+ select="$width"/>
+ <xsl:with-param
+ name="expectedIndent">
+ <!-- Capture indent for the entry generated by the normal template
+ rules to remove it later -->
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:with-param>
+ <xsl:with-param
+ name="outputLine"
+ select="$currentLine"/>
+ </xsl:call-template>
+ <!-- Final bar after the entry -->
+ <xsl:text>|</xsl:text>
+ </xsl:template>
+
+ <!-- Compute width of the entry -->
+ <xsl:template
+ name="u:computeEntryWidth">
+ <!-- The colspec elements of all columns -->
+ <xsl:param
+ name="colspecs"/>
+ <!-- Column of this entry -->
+ <xsl:param
+ name="column"/>
+ <!-- Number of columns this entry spans -->
+ <xsl:param
+ name="span"
+ select="0"/>
+ <xsl:param
+ name="sum"
+ select="0"/>
+ <xsl:choose>
+ <xsl:when
+ test="$span">
+ <!-- If entry spans multiple columns compute their width -->
+ <xsl:call-template
+ name="u:computeEntryWidth">
+ <xsl:with-param
+ name="colspecs"
+ select="$colspecs"/>
+ <xsl:with-param
+ name="column"
+ select="$column + 1"/>
+ <xsl:with-param
+ name="span"
+ select="$span - 1"/>
+ <!-- Add the separator character and the following column width -->
+ <xsl:with-param
+ name="sum"
+ select="$sum + 1 + $colspecs[$column]/ <at> colwidth"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Does not span more columns so return sum and width of this
+ column -->
+ <xsl:value-of
+ select="$sum + $colspecs[$column]/ <at> colwidth"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Outputs one or all lines of a table entry as a string trimmed left and
+ padded -->
+ <xsl:template
+ name="u:outputEntry">
+ <!-- Width of the entry; there is no provision for actual physical lines
+ longer than this width -->
+ <xsl:param
+ name="width"/>
+ <!-- The string containing the remaining physical lines; may be an empty
+ string -->
+ <xsl:param
+ name="string"
+ select="''"/>
+ <!-- The indendation which is expected to be prefixed before every
+ physical line -->
+ <xsl:param
+ name="expectedIndent"
+ select="''"/>
+ <!-- Is this the first call to this template -->
+ <xsl:param
+ name="isFirst"
+ select="true()"/>
+ <!-- Number of physical line to output or 0 to output all lines -->
+ <xsl:param
+ name="outputLine"
+ select="0"/>
+ <!-- Output is wanted if all or the first physical line are to be
+ output -->
+ <xsl:variable
+ name="doOutput"
+ select="$outputLine = 0 or $outputLine = 1"/>
+ <xsl:variable
+ name="stringLFHalfTrimmed">
+ <xsl:choose>
+ <xsl:when
+ test="$isFirst and substring($string, 1, 1) = '
'">
+ <!-- Remove leading linefeed if this is the first time -->
+ <xsl:value-of
+ select="substring($string, 2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable
+ name="stringLFTrimmed">
+ <xsl:choose>
+ <xsl:when
+ test="$isFirst and substring($stringLFHalfTrimmed, string-length($stringLFHalfTrimmed), 1) = '
'">
+ <!-- Remove trailing linefeed if this is the first time -->
+ <xsl:value-of
+ select="substring($stringLFHalfTrimmed, 1, string-length($stringLFHalfTrimmed) - 1)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$stringLFHalfTrimmed"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Determine remaining lines after the first one -->
+ <xsl:variable
+ name="remainingLines">
+ <xsl:if
+ test="contains($stringLFTrimmed, '
')">
+ <xsl:value-of
+ select="substring-after($stringLFTrimmed, '
')"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:if
+ test="$doOutput">
+ <!-- If this physical line must be output determine the first physical
+ line -->
+ <xsl:variable
+ name="firstLine">
+ <xsl:choose>
+ <xsl:when
+ test="string-length($remainingLines)">
+ <xsl:value-of
+ select="substring-before($stringLFTrimmed, '
')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$stringLFTrimmed"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Remove the leading indentation from the physical line which is
+ brought there by the normal templates -->
+ <xsl:variable
+ name="trimmed">
+ <xsl:if
+ test="string-length($firstLine)">
+ <!-- Trim only non-empty lines -->
+ <xsl:value-of
+ select="substring-after($firstLine, $expectedIndent)"/>
+ </xsl:if>
+ </xsl:variable>
+ <!-- Pad the line with a leading and a trailing space -->
+ <xsl:variable
+ name="padded"
+ select="concat(' ', $trimmed, ' ')"/>
+ <!-- Output the padded value -->
+ <xsl:value-of
+ select="$padded"/>
+ <!-- Fill up the width of the entry with spaces -->
+ <xsl:if
+ test="$width - string-length($padded) < 0">
+ <xsl:message>
+ <xsl:text>WARNING: Table column too narrow (minimum: </xsl:text>
+ <xsl:value-of
+ select="string-length($padded)"/>
+ <xsl:text>)</xsl:text>
+ &tEOL;
+ </xsl:message>
+ </xsl:if>
+ <xsl:value-of
+ select="str:padding($width - string-length($padded))"/>
+ </xsl:if>
+ <xsl:if
+ test="$outputLine > 1 or $outputLine = 0 and string-length($remainingLines)">
+ <!-- If a following physical line must be output or if all physical
+ lines shall be output and there are remaining physical lines -->
+ <xsl:if
+ test="$outputLine = 0">
+ <!-- Output linefeed only if we output all the lines -->
+ &tEOL;
+ </xsl:if>
+ <!-- Output the remaining lines -->
+ <xsl:call-template
+ name="u:outputEntry">
+ <xsl:with-param
+ name="width"
+ select="$width"/>
+ <xsl:with-param
+ name="string"
+ select="$remainingLines"/>
+ <xsl:with-param
+ name="expectedIndent"
+ select="$expectedIndent"/>
+ <xsl:with-param
+ name="isFirst"
+ select="false()"/>
+ <xsl:with-param
+ name="outputLine">
+ <xsl:choose>
+ <xsl:when
+ test="$outputLine = 0">
+ <xsl:value-of
+ select="0"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$outputLine - 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!-- == inline_element -->
+ <xsl:template
+ match="citation_reference">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>[</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>]_</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == inline_element -->
+ <xsl:template
+ match="emphasis">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>*</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>*</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- user-numbered footnotes lack <at> auto -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="footnote_reference[not( <at> auto)]">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>[</xsl:text>
+ <xsl:value-of
+ select="text()"/>
+ <xsl:text>]_</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ <!-- child paragraph provides blank line -->
+ </xsl:template>
+
+ <!-- automatically numbered footnotes have <at> auto -->
+ <!-- if <at> names is different from label content, it is a named footnote -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="footnote_reference[ <at> auto='1']">
+ <xsl:variable
+ name="ref"
+ select=" <at> refid"/>
+ <xsl:if
+ test="not(starts-with(//footnote[ <at> ids=$ref]/ <at> names, 'TARGET_NOTE:\ '))">
+ <!-- Not a generated footnote reference for a `.. target-notes::';
+ such footnote reference and the preceding space should be
+ embedded in `generated'! -->
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>[#</xsl:text>
+ <xsl:if
+ test="//footnote[ <at> ids=$ref]/ <at> names != //footnote[ <at> ids=$ref]/label">
+ <xsl:call-template
+ name="u:outputNames">
+ <xsl:with-param
+ name="names"
+ select="//footnote[ <at> ids=$ref]/ <at> names"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:text>]_</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- automatically symboled footnotes have <at> auto=* -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="footnote_reference[ <at> auto='*']">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>[*]_</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="literal">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>``</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>``</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Attribute combinations found in `standard' text and other examples:
+ <at> refuri = standalone hyperlink
+ <at> ids <at> refid = TOC, probably all in <generated>
+ <at> name <at> refuri with matching <target> in document = named external hyperlink _
+ <at> name <at> refuri immediately followed by matching <target> = named embedded URI _
+ <at> name <at> refuri with no matching <target> in document = anonymous embedded URI __
+ <at> anonymous <at> name <at> refuri with no matching <target> in document = anonymous explicit URI __
+ <at> name <at> refid = internal cross-reference _
+ <at> anonymous <at> name <at> refid = anonymous implicit internal reference __
+ <at> name <at> refid image = clickable image to internal reference _
+ <at> refuri image = clickable image to standalone hyperlink
+
+ A target matches if target/ <at> names contains the lower cased, whitespace
+ quoted reference/ <at> name
+ -->
+
+ <!-- Standalone hyperlink -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="reference[not( <at> name or <at> anonymous)]">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:choose>
+ <xsl:when
+ test="starts-with(., 'PEP ')">
+ <xsl:text>:PEP:`</xsl:text>
+ <xsl:value-of
+ select="substring-after(., 'PEP ')"/>
+ <xsl:text>`</xsl:text>
+ </xsl:when>
+ <xsl:when
+ test="starts-with(., 'RFC ')">
+ <xsl:text>:RFC:`</xsl:text>
+ <xsl:value-of
+ select="substring-after(., 'RFC ')"/>
+ <xsl:text>`</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- External references -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="reference[ <at> name and <at> refuri]">
+ <!-- Determine normalized name by downcasing it -->
+ <xsl:variable
+ name="normalized"
+ select="translate(normalize-space( <at> name), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
+ <xsl:variable
+ name="quoted"
+ select="str:replace($normalized, ' ', '\ ')"/>
+ <xsl:variable
+ name="matching"
+ select="//target[contains( <at> names, $quoted)]"/>
+ <xsl:call-template
+ name="u:inlineReference">
+ <xsl:with-param
+ name="anonymous"
+ select="not($matching) or <at> anonymous"/>
+ <xsl:with-param
+ name="embedded"
+ select="not( <at> anonymous) and (not($matching) or generate-id(following-sibling::node()[1]) = generate-id($matching))"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- Internal references -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="reference[ <at> name and <at> refid]">
+ <xsl:call-template
+ name="u:inlineReference">
+ <xsl:with-param
+ name="anonymous"
+ select=" <at> anonymous"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- Image references -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="reference[image]">
+ <!-- All done by the `image' tag -->
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="strong">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>**</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>**</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == inline_element -->
+ <xsl:template
+ match="subscript">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>:sub:`</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>`</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- == inline_element -->
+ <xsl:template
+ match="superscript">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>:sup:`</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>`</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- The target element has various roles depending on context; they are
+ all handled here -->
+ <!-- == simple_body_element == inline_element == directive -->
+ <xsl:template
+ match="target">
+ <xsl:choose>
+ <xsl:when
+ test="name(preceding-sibling::*[1]) = 'reference'">
+ <!-- An embedded inline target - handled by the reference itself -->
+ </xsl:when>
+ <xsl:when
+ test="contains($inline_containers, concat('*', name(..), '*'))">
+ <!-- An inline target of some sort -->
+ <xsl:call-template
+ name="u:inlineReference">
+ <xsl:with-param
+ name="isTarget"
+ select="true()"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when
+ test=" <at> anonymous">
+ <!-- An anonymous target directive -->
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>__ </xsl:text>
+ <xsl:choose>
+ <xsl:when
+ test=" <at> refid">
+ <xsl:call-template
+ name="u:outputNamesRefid"/>
+ <xsl:text>_</xsl:text>
+ </xsl:when>
+ <xsl:when
+ test=" <at> refuri">
+ <xsl:value-of
+ select=" <at> refuri"/>
+ </xsl:when>
+ </xsl:choose>
+ &tEOL;
+ </xsl:when>
+ <xsl:when
+ test=" <at> names | <at> refid">
+ <!-- A target directive -->
+ <xsl:call-template
+ name="u:outputClass"/>
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>.. _</xsl:text>
+ <xsl:choose>
+ <xsl:when
+ test=" <at> refid">
+ <xsl:call-template
+ name="u:outputNamesRefid"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template
+ name="u:outputNames"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>:</xsl:text>
+ <xsl:if
+ test=" <at> refuri">
+ <xsl:text> </xsl:text>
+ <xsl:value-of
+ select=" <at> refuri"/>
+ </xsl:if>
+ &tEOL;
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Should not happen -->
+ <xsl:call-template
+ name="u:notSupported"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="title_reference">
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>`</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>`</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Content Model: %text.model;
+ -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="inline">
+ <!-- TODO `role' directives must be generated for plain and derived
+ user-defined roles. -->
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <xsl:text>:</xsl:text>
+ <xsl:value-of
+ select=" <at> classes"/>
+ <xsl:text>:`</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>`</xsl:text>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- TODO `meta` directive must be implemented. -->
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Docutils wraps generated elements around text that is inserted (generated) by
+ Docutils; i.e., text that was not in the document, like section numbers
+ inserted by the "sectnum" directive.
+ -->
+ <!-- == inline_element -->
+ <xsl:template
+ match="generated"/>
+
+ <!-- == inline_element -->
+ <xsl:template
+ match="problematic">
+ <!-- Simply output the contained text because this is probably the
+ original text-->
+ <xsl:value-of
+ select="text()"/>
+ </xsl:template>
+
+ <!-- == compound_body_element -->
+ <xsl:template
+ match="system_message"/>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!--
+ When a block of text contains linefeeds, it was indented relative to a marker
+ on the first line
+ -->
+ <xsl:template
+ match="text()">
+ <xsl:call-template
+ name="u:indentLF"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!-- Add a blank line if necessary and indent -->
+ <xsl:template
+ name="u:BandI">
+ <xsl:call-template
+ name="u:blank"/>
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Add a blank line in certain contexts -->
+ <xsl:template
+ name="u:blank">
+ <xsl:apply-templates
+ mode="blankSkipInline"
+ select="preceding::*[1]"/>
+ </xsl:template>
+
+ <!-- Find the preceding element we are really interested in and act
+ according to this element -->
+ <xsl:template
+ mode="blankSkipInline"
+ match="*">
+ <xsl:choose>
+ <!-- Skip all inline elements and body subelements and check their
+ parents -->
+ <xsl:when
+ test="contains(concat($inline_elements, $simple_body_subelements, $compound_body_subelements), concat('*', name(.), '*'))">
+ <xsl:apply-templates
+ mode="blankSkipInline"
+ select=".."/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Reached the type of element we decide on -->
+ <xsl:if
+ test="contains($blank_after, concat('*', name(.), '*'))">
+ &tCR;
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!--
+ Indent a block if it's a child of...
+ -->
+ <data:lookup>
+ <node
+ name="address"
+ indent="10"/>
+ <node
+ name="author"
+ indent="9"/>
+ <node
+ name="authors"
+ indent="10"/>
+ <node
+ name="contact"
+ indent="10"/>
+ <node
+ name="copyright"
+ indent="12"/>
+ <node
+ name="date"
+ indent="7"/>
+ <node
+ name="organization"
+ indent="15"/>
+ <node
+ name="revision"
+ indent="11"/>
+ <node
+ name="status"
+ indent="9"/>
+ <node
+ name="version"
+ indent="10"/>
+ <!-- This is only for `bullet_list/list_item';
+ `enumerated_list/list_item' is handled special -->
+ <node
+ name="list_item"
+ indent="2"/>
+ <node
+ name="definition_list_item"
+ indent="4"/>
+ <node
+ name="field_body"
+ indent="4"/>
+ <node
+ name="option_list_item"
+ indent="4"/>
+ <!-- This is also the indentation if block_quote comes as one of the
+ special directives -->
+ <node
+ name="block_quote"
+ indent="4"/>
+ <node
+ name="literal_block"
+ indent="4"/>
+ <node
+ name="attribution"
+ indent="3"/>
+ <node
+ name="line"
+ indent="2"/>
+ </data:lookup>
+
+ <!-- Do indent according to ancestor -->
+ <xsl:template
+ name="u:indent">
+ <!-- In some cases the ancestors to indent for need to be determined
+ by the calling template -->
+ <xsl:param
+ name="ancestors"
+ select="ancestor::*"/>
+ <xsl:for-each
+ select="$ancestors">
+ <xsl:variable
+ name="this"
+ select="name()"/>
+ <xsl:choose>
+ <xsl:when
+ test="contains($directives, concat('*', $this, '*'))">
+ <!-- TODO Indentation of lines after some directives must be
+ indented to align with the directive instead of a
+ fixed indentation; however, this is rather complicated
+ since identation for parameters should be fixed -->
+ <xsl:value-of
+ select="str:padding(3)"/>
+ </xsl:when>
+ <xsl:when
+ test="$this = 'list_item' and parent::enumerated_list">
+ <!-- Enumerated list items base their indentation on the
+ numeration -->
+ <xsl:variable
+ name="enumerator">
+ <xsl:call-template
+ name="u:outputEnumerator"/>
+ </xsl:variable>
+ <xsl:value-of
+ select="str:padding(string-length($enumerator))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="str:padding(document('')//data:lookup/node[ <at> name=$this]/ <at> indent)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Indent a text containing line feeds correctly -->
+ <xsl:template
+ name="u:indentLF">
+ <xsl:param
+ name="string"
+ select="."/>
+ <!-- A fixed indentation may be given by caller -->
+ <xsl:param
+ name="indent">
+ <!-- If not given compute it -->
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:param>
+ <xsl:choose>
+ <xsl:when
+ test="contains($string,'
')">
+ <!-- Output first physical line -->
+ <xsl:value-of
+ select="substring-before($string, '
')"/>
+ &tEOL;
+ <!-- Indent before the next line -->
+ <xsl:value-of
+ select="$indent"/>
+ <!-- Output remaining physical lines -->
+ <xsl:call-template
+ name="u:indentLF">
+ <xsl:with-param
+ name="string"
+ select="substring-after($string, '
')"/>
+ <xsl:with-param
+ name="indent"
+ select="$indent"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- String does not contain newline, so just output it -->
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Do output for those elements which do fold their inline content -->
+ <xsl:template
+ name="u:outputFolding">
+ <!-- The prefix text to be output before the body -->
+ <xsl:param
+ name="prefix"
+ select="''"/>
+ <!-- The indentation for this body -->
+ <xsl:param
+ name="indent">
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ </xsl:call-template>
+ </xsl:param>
+ <xsl:variable
+ name="string">
+ <!-- TODO Whitespace count of inline literals must be preserved -->
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <!-- Always output prefix with all trailing and leading spaces -->
+ <xsl:value-of
+ select="$prefix"/>
+ <xsl:choose>
+ <xsl:when
+ test="$fold > 0">
+ <xsl:variable
+ name="normalized"
+ select="normalize-space($string)"/>
+ <xsl:choose>
+ <xsl:when
+ test="$string = ''">
+ <!-- Empty strings need no output -->
+ </xsl:when>
+ <xsl:when
+ test="$normalized = ''">
+ <!-- Only white-space in string; output a single space here -->
+ &tSP;
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Output leading white-space here -->
+ <xsl:if
+ test="normalize-space(substring($string, 1, 1)) = ''">
+ &tSP;
+ </xsl:if>
+ <xsl:call-template
+ name="u:indentFold">
+ <xsl:with-param
+ name="string"
+ select="$normalized"/>
+ <xsl:with-param
+ name="indent"
+ select="$indent"/>
+ <xsl:with-param
+ name="cursorColumn"
+ select="string-length($indent) + string-length($prefix)"/>
+ </xsl:call-template>
+ <!-- Output trailing white-space here -->
+ <xsl:if
+ test="normalize-space(substring($string, string-length($string), 1)) = ''">
+ &tSP;
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Indent a string with folding -->
+ <xsl:template
+ name="u:indentFold">
+ <!-- Normalized string to output -->
+ <xsl:param
+ name="string"/>
+ <!-- Indentation to use for a new line -->
+ <xsl:param
+ name="indent"/>
+ <!-- Current output column -->
+ <!-- TODO This is not a correct assumption for field definitions where
+ the field name effectively determines the column of the first
+ line -->
+ <xsl:param
+ name="cursorColumn"
+ select="string-length($indent)"/>
+ <!-- Do we start on a new (indented) line? -->
+ <xsl:param
+ name="isNewLine"
+ select="true()"/>
+ <xsl:variable
+ name="firstWord">
+ <xsl:choose>
+ <!-- TODO Quoted spaces must not end a word -->
+ <xsl:when
+ test="contains($string, ' ')">
+ <xsl:value-of
+ select="substring-before($string, ' ')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable
+ name="rest"
+ select="substring-after($string, ' ')"/>
+ <xsl:choose>
+ <xsl:when
+ test="$string = ''"/>
+ <xsl:when
+ test="$isNewLine">
+ <!-- Output at least first word -->
+ <xsl:value-of
+ select="$firstWord"/>
+ <xsl:call-template
+ name="u:indentFold">
+ <xsl:with-param
+ name="string"
+ select="$rest"/>
+ <xsl:with-param
+ name="indent"
+ select="$indent"/>
+ <xsl:with-param
+ name="cursorColumn"
+ select="$cursorColumn + string-length($firstWord)"/>
+ <xsl:with-param
+ name="isNewLine"
+ select="false()"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when
+ test="$cursorColumn + 1 + string-length($firstWord) > $fold">
+ <!-- Line would get too long; start new line, indent and continue -->
+ &tEOL;
+ <xsl:value-of
+ select="$indent"/>
+ <xsl:call-template
+ name="u:indentFold">
+ <xsl:with-param
+ name="string"
+ select="$string"/>
+ <xsl:with-param
+ name="indent"
+ select="$indent"/>
+ <xsl:with-param
+ name="cursorColumn"
+ select="string-length($indent)"/>
+ <xsl:with-param
+ name="isNewLine"
+ select="true()"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- In a line and first word fits; separate and add word -->
+ &tSP;
+ <xsl:value-of
+ select="$firstWord"/>
+ <xsl:call-template
+ name="u:indentFold">
+ <xsl:with-param
+ name="string"
+ select="$rest"/>
+ <xsl:with-param
+ name="indent"
+ select="$indent"/>
+ <xsl:with-param
+ name="cursorColumn"
+ select="$cursorColumn + 1 + string-length($firstWord)"/>
+ <xsl:with-param
+ name="isNewLine"
+ select="false()"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output attributes of the current element as a field list -->
+ <xsl:template
+ name="u:params">
+ <xsl:param
+ name="params"
+ select=" <at> *"/>
+ <!-- Ancestors are needed for determining indentation; caller may give
+ them -->
+ <xsl:param
+ name="ancestors"
+ select="ancestor-or-self::*"/>
+ <xsl:for-each
+ select="$params">
+ <!-- Skip URIs based on parent -->
+ <xsl:if
+ test="name() != 'uri' and name() != 'xml:space'">
+ <xsl:call-template
+ name="u:param">
+ <xsl:with-param
+ name="ancestors"
+ select="$ancestors"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Output one attribute of the current element as a field list -->
+ <xsl:template
+ name="u:param">
+ <xsl:param
+ name="name"
+ select="name()"/>
+ <xsl:param
+ name="value"
+ select="."/>
+ <!-- Ancestors are needed for determining indentation; caller may give
+ them -->
+ <xsl:param
+ name="ancestors"
+ select="ancestor::*"/>
+ <xsl:call-template
+ name="u:indent">
+ <xsl:with-param
+ name="ancestors"
+ select="$ancestors"/>
+ </xsl:call-template>
+ <xsl:text>:</xsl:text>
+ <xsl:choose>
+ <xsl:when
+ test="$name = 'classes'">
+ <xsl:text>class</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>:</xsl:text>
+ <xsl:if
+ test="$value">
+ <xsl:text> </xsl:text>
+ <xsl:value-of
+ select="$value"/>
+ </xsl:if>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output `\' or `\ ' before some inline element if necessary -->
+ <xsl:template
+ name="u:bkslshEscPre">
+ <!-- Get the sibling node directly before the current element -->
+ <xsl:variable
+ name="before"
+ select="preceding-sibling::node()[1]"/>
+ <xsl:choose>
+ <!-- No sibling before this node -->
+ <xsl:when
+ test="not($before)"/>
+ <!-- Element directly before this - must be another inline element -->
+ <xsl:when
+ test="name($before)">
+ <!-- So separate it by a quoted space -->
+ <xsl:text>\ </xsl:text>
+ </xsl:when>
+ <!-- Node directly before this is text - check it -->
+ <xsl:when
+ test="not(contains(concat($apos, ' 
	
"([{<-/:'), substring($before, string-length($before), 1)))">
+ <!-- Does not end in one of the allowed characters so separate it -->
+ <xsl:text>\ </xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Output `\' after some inline element if necessary -->
+ <xsl:template
+ name="u:bkslshEscSuf">
+ <!-- Get the sibling node directly after the current element -->
+ <xsl:variable
+ name="after"
+ select="following-sibling::node()[1]"/>
+ <xsl:choose>
+ <!-- No sibling after this node -->
+ <xsl:when
+ test="not($after)"/>
+ <!-- Element directly after this - must be another inline element
+ handling itself -->
+ <xsl:when
+ test="name($after)"/>
+ <!-- Node directly after this is text - check it -->
+ <xsl:when
+ test="not(contains(concat($apos, ' 
	
")]}>-/:.,;!?\'), substring($after, 1, 1)))">
+ <!-- Does not start with one of the allowed characters so separate
+ it -->
+ <xsl:text>\</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <xsl:template
+ name="u:notSupported">
+ <xsl:call-template
+ name="u:BandI"/>
+ <xsl:text>######## NOT SUPPORTED: `</xsl:text>
+ <xsl:value-of
+ select="name(.)"/>
+ <xsl:text>' ########</xsl:text>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <xsl:template
+ name="u:overline">
+ <!-- Length of the rendered(!) text -->
+ <xsl:param
+ name="length"/>
+ <!-- Depth 1 and 2 are document title and subtitle while depths
+ greater than 2 are normal section titles -->
+ <xsl:param
+ name="depth"/>
+ <!-- Test whether a overline is wanted at all -->
+ <xsl:if
+ test="substring($adornment, 2 * ($depth - 1) + 1, 1) = 'o'">
+ <xsl:value-of
+ select="str:padding($length, substring($adornment, 2 * ($depth - 1) + 2, 1))"/>
+ &tEOL;
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template
+ name="u:underline">
+ <!-- Length of the rendered(!) text -->
+ <xsl:param
+ name="length"/>
+ <!-- Depth 1 and 2 are document title and subtitle while depths
+ greater than 2 are normal section titles -->
+ <xsl:param
+ name="depth"/>
+ <xsl:value-of
+ select="str:padding($length, substring($adornment, 2 * ($depth - 1) + 2, 1))"/>
+ &tEOL;
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output a non-standalone reference or target -->
+ <xsl:template
+ name="u:inlineReference">
+ <xsl:param
+ name="anonymous"
+ select="false()"/>
+ <xsl:param
+ name="embedded"
+ select="false()"/>
+ <!-- Is this a target instead of a reference? -->
+ <xsl:param
+ name="isTarget"
+ select="false()"/>
+ <xsl:param
+ name="text"
+ select="node()"/>
+ <xsl:call-template
+ name="u:bkslshEscPre"/>
+ <!-- Delimiter only if link contains other than alphanumerics -->
+ <xsl:variable
+ name="delimiter">
+ <xsl:if
+ test="* or translate($text, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', '') or $embedded">
+ <xsl:text>`</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:if
+ test="$isTarget">
+ <xsl:text>_</xsl:text>
+ </xsl:if>
+ <xsl:value-of
+ select="$delimiter"/>
+ <xsl:apply-templates
+ select="$text"/>
+ <xsl:if
+ test="$embedded">
+ <xsl:text> <</xsl:text>
+ <xsl:value-of
+ select=" <at> refuri"/>
+ <xsl:text>></xsl:text>
+ </xsl:if>
+ <xsl:value-of
+ select="$delimiter"/>
+ <xsl:if
+ test="not($isTarget)">
+ <xsl:text>_</xsl:text>
+ <xsl:if
+ test="$anonymous">
+ <xsl:text>_</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:call-template
+ name="u:bkslshEscSuf"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output a class directive for the directly following element. -->
+ <!-- TODO A class directive can also be used as a container putting the
+ respective attribute to its content; however, this is not
+ reflected in XML - you'd need to check a sequence of elements
+ whether they all have the same attribute; furthermore class
+ settings for block quotes needs to be treated special -->
+ <xsl:template
+ name="u:outputClass">
+ <!-- Blank line already output? -->
+ <xsl:param
+ name="alreadyBlanked"
+ select="false()"/>
+ <!-- Indentation already output? -->
+ <xsl:param
+ name="alreadyIndented"
+ select="false()"/>
+ <!-- Add a blank line after class directive? -->
+ <xsl:param
+ name="blankAfter"
+ select="false()"/>
+ <xsl:if
+ test=" <at> classes">
+ <xsl:if
+ test="not($alreadyBlanked)">
+ <xsl:call-template
+ name="u:blank"/>
+ </xsl:if>
+ <xsl:if
+ test="not($alreadyIndented)">
+ <xsl:call-template
+ name="u:indent"/>
+ </xsl:if>
+ <xsl:text>.. class:: </xsl:text>
+ <xsl:value-of
+ select=" <at> classes"/>
+ &tEOL;
+ <xsl:if
+ test="$blankAfter">
+ &tCR;
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output a names attribute at index considering quoted spaces. -->
+ <xsl:template
+ name="u:outputNames">
+ <!-- Blank line already output? -->
+ <xsl:param
+ name="names"
+ select=" <at> names"/>
+ <xsl:param
+ name="index"
+ select="0"/>
+ <xsl:value-of
+ select="str:replace(str:tokenize(normalize-space(str:replace($names, '\ ', '|')))[position() = $index + 1], '|', ' ')"/>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+
+ <!-- Output a names attribute for a refid. -->
+ <xsl:template
+ name="u:outputNamesRefid">
+ <xsl:param
+ name="refid"
+ select=" <at> refid"/>
+ <!-- Determine the elements which is referred -->
+ <xsl:variable
+ name="refElem"
+ select="//*[ <at> ids and math:max(dyn:map(str:tokenize(normalize-space( <at> ids)), 'number($refid = .)')) > 0]"/>
+ <xsl:call-template
+ name="u:outputNames">
+ <xsl:with-param
+ name="names"
+ select="$refElem/ <at> names"/>
+ <xsl:with-param
+ name="index"
+ select="math:max(dyn:map(str:tokenize(normalize-space($refElem/ <at> ids)), 'number($refid = .) * position() - 1'))"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************************************************** -->
+ <!-- ******************************************************************** -->
+
+ <!-- Report unknown tags -->
+ <xsl:template
+ match="*">
+ <xsl:message>
+ <xsl:text>`</xsl:text>
+ <xsl:value-of
+ select="name(.)"/>
+ <xsl:text>' encountered</xsl:text>
+ <xsl:if
+ test="parent::*">
+ <xsl:text> in `</xsl:text>
+ <xsl:value-of
+ select="name(parent::*)"/>
+ <xsl:text>'</xsl:text>
+ </xsl:if>
+ <xsl:text>, but no template matches.</xsl:text>
+ </xsl:message>
+ </xsl:template>
+
+</xsl:stylesheet>
+
+<!-- ********************************************************************** -->
+<!-- ********************************************************************** -->
+<!-- ********************************************************************** -->
+<!-- POD manual page
+
+=head1 NAME
+
+xml2rst.xsl - An XSLT script to convert Docutils XML to reStructuredText
+
+=head1 SYNOPSIS
+
+ xsltproc docutils.xml xml2rst.xsl
+
+=head1 DESCRIPTION
+
+B<xml2rst.xsl> is an XSLT script to convert Docutils XML to
+reStructuredText. You can use your favorite XSLT processor supporting
+EXSLT (e.g. xsltproc from the Gnome project) to generate
+reStructuredText from the Docutils intermediate XML representation.
+Its main use is to generate reStructuredText from some other format
+where a converter to Docutils XML already exists.
+
+=head2 Options
+
+The following options are supported. They are XSLT parameters for the
+whole script and must be given to the XSLT processor by the respective
+option (xsltproc: B<- -param> or B<- -stringparam>).
+
+=over 4
+
+=item adornment
+
+Configures title markup to use so different styles can be requested
+easily.
+
+The value of the parameter must be a string made up of a sequence of
+character pairs. The first character of a pair is C<o> (overline) or
+C<u> (underline) and the second character is the character to use for
+the markup.
+
+The first and the second character pair is used for document title and
+subtitle, the following pairs are used for section titles where the
+third pair is used for the top level section title.
+
+Defaults to C<o=o-u=u-u~u:u.u`>.
+
+=item fold
+
+Configures whether long text lines in paragraphs should be folded and
+to which length. This option is for input not coming from reST which
+may have no internal line feeds in plain text strings.
+
+If folding is enabled text strings not in a line feed preserving
+context are first white-space normalized and then broken according to
+the folding rules. Folding rules put out the first word and continue
+to do so with the following words unless the next word would cross
+the folding boundary. Words are delimited by white-space.
+
+Defaults to C<0>, i.e. no folding.
+
+=back
+
+=head2 Unsupported features
+
+It is generally not possible to create an exact reproduction of an
+original reStructuredText source from an intermediate XML file. The
+reason is that Docutils transports pretty much but not all information
+of the original source into the XML. Also the sequence is changed
+sometimes.
+
+However, the coverage of Docutils features of B<xml2rst.xsl> is pretty
+good. A few minor features are not supported:
+
+=over 4
+
+=item * Fully minimized style for literal blocks
+
+=item * Substitution references for C<replace::> substitutions
+
+=item * Counting roman numbers in enumerated lists
+
+=item * Special table types like C<list-table::> and C<csv-table::>
+
+=item * Custom role definitions
+
+=back
+
+=head1 INSTALLATION
+
+Installation is not necessary. Just use the file as downloaded with
+your favorite XSLT processor supporting EXSLT. For instance you can
+use B<xsltproc> from the Gnome project.
+
+=head1 AUTHOR
+
+Stefan Merten <smerten <at> oekonux.de> based on works by David Priest.
+
+=head1 LICENSE
+
+This program is licensed under the terms of the GPL. See
+
+ http://www.gnu.org/licenses/gpl.txt
+
+=head1 AVAILABILTY
+
+See
+
+ http://www.merten-home.de/FreeSoftware/xml2rst/
+
+=cut
+
+-->
Added: trunk/sandbox/xml2rst/setup.py
===================================================================
--- trunk/sandbox/xml2rst/setup.py (rev 0)
+++ trunk/sandbox/xml2rst/setup.py 2010-11-01 12:05:38 UTC (rev 6465)
<at> <at> -0,0 +1,18 <at> <at>
+#!/usr/bin/env python
+
+from distutils.core import setup
+
+from version import version
+
+setup(name='xml2rst',
+ version=version,
+ description='A reStructuredText writer based on Docutils XML',
+ author='Stefan Merten',
+ author_email='smerten <at> oekonux.de',
+ url='http://docutils.sourceforge.net/sandbox/xml2rst/',
+ license='GPL 2',
+ requires=[ 'docutils', 'lxml' ],
+ scripts=[ 'xml2rst.py' ],
+ packages=[ 'rst' ],
+ package_data={ 'rst': [ 'xml2rst.xsl', 'xml2rst-noexslt.xsl' ], },
+ )
Property changes on: trunk/sandbox/xml2rst/setup.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/sandbox/xml2rst/tag.log
===================================================================
--- trunk/sandbox/xml2rst/tag.log (rev 0)
+++ trunk/sandbox/xml2rst/tag.log 2010-11-01 12:05:38 UTC (rev 6465)
<at> <at> -0,0 +1 <at> <at>
+xml2rst_1_196
Added: trunk/sandbox/xml2rst/version.py
===================================================================
--- trunk/sandbox/xml2rst/version.py (rev 0)
+++ trunk/sandbox/xml2rst/version.py 2010-11-01 12:05:38 UTC (rev 6465)
<at> <at> -0,0 +1 <at> <at>
+version = '0.5.0'
Property changes on: trunk/sandbox/xml2rst/version.py
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/sandbox/xml2rst/xml2rst.py
===================================================================
--- trunk/sandbox/xml2rst/xml2rst.py 2010-11-01 11:55:05 UTC (rev 6464)
+++ trunk/sandbox/xml2rst/xml2rst.py 2010-11-01 12:05:38 UTC (rev 6465)
<at> <at> -60,32 +60,11 <at> <at>
import re
from optparse import OptionParser, OptionGroup, OptionValueError, Option
-from copy import copy
-try:
- from lxml import etree
-except ImportError:
- errorExit(2, ( "Python package 'lxml' is not available",
- "You may try to use 'xml2rst.xsl' with a standalone XSLT processor like 'xalan' or 'xsltproc'", ))
+from rst import rst_xslt
###############################################################################
###############################################################################
-# Constants
-
-"""
- <at> var MainXsltNm: Name of the main XSLT source file
- <at> type MainXsltNm: str
-"""
-MainXsltNm = "xml2rst.xsl"
-
-"""
- <at> var ScriptNm: Name of the script
- <at> type ScriptNm: str
-"""
-ScriptNm = sys.argv[0]
-
-###############################################################################
-###############################################################################
# Variables
"""
<at> <at> -416,61 +395,6 <at> <at>
###############################################################################
# Specialized functions
-def convert(inNm, outNm):
- """
- Do the conversion.
-
- <at> param inNm: Filename of input file.
- <at> type inNm: str
-
- <at> param outNm: Filename of output file or None.
- <at> type outNm: str | None
- """
- try:
- inF = open(inNm)
- except IOError:
- errorExit(1, ( "Can't open input file %r" % ( inNm, ), ))
-
- scriptP = os.path.dirname(os.path.realpath(ScriptNm))
- mainXsltNm = os.path.join(scriptP, MainXsltNm)
- try:
- mainXsltF = open(mainXsltNm)
- except IOError:
- errorExit(1, ( "Can't open main XSLT file %r" % ( mainXsltNm, ), ))
-
- xsltParser = etree.XMLParser()
- mainXsltDoc = etree.parse(mainXsltF, xsltParser)
- mainXsltF.close()
- mainXslt = etree.XSLT(mainXsltDoc)
-
- inParser = etree.XMLParser()
- try:
- inDoc = etree.parse(inF, inParser)
- except Exception, e:
- errorExit(1, ( "Error parsing input file %r: %s" % ( inNm, e, ), ))
- inF.close()
-
- xsltParams = { }
- if options.fold is not None:
- xsltParams['fold'] = str(options.fold)
- if options.adornment is not None:
- xsltParams['adornment'] = "'" + options.adornment + "'"
- try:
- result = mainXslt(inDoc, **xsltParams)
- except Exception, e:
- errorExit(1, ( "Error transforming input file %r: %s" % ( inNm, e, ), ))
- # Chop off trailing linefeed - added somehow
- outS = str(result)[:-1]
- if outNm:
- try:
- outF = open(outNm, "w")
- except IOError:
- errorExit(1, ( "Can't open output file %r" % ( outNm, ), ))
- outF.write(outS)
- outF.close()
- else:
- print(outS)
-
###############################################################################
###############################################################################
# Classes
<at> <at> -486,7 +410,10 <at> <at>
outF = arguments[1]
else:
outF = None
- convert(inF, outF)
+ try:
+ rst_xslt.convert(inF, outF, options)
+ except Exception, e:
+ errorExit(1, e)
##############################################################################
##############################################################################
<at> <at> -496,3 +423,5 <at> <at>
# TODO Move from XSLT to Python implementation step by step by replacing
# XSLT-code by Python code through extensions and other means
+
+# TODO The docutils XML reader must be used
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
RSS Feed