diff options
| author | paultremblay <paultremblay@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2011-09-26 19:27:15 +0000 |
|---|---|---|
| committer | paultremblay <paultremblay@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2011-09-26 19:27:15 +0000 |
| commit | 8c616ca52509e49abfbb2b4013587fe62db2fd17 (patch) | |
| tree | 748eedfe3384265e78f5b00a49838702f8f2e17b /sandbox/paultremblay/python_interface | |
| parent | 3929d5c5aa6463da2451c38fde34356318311dd6 (diff) | |
| download | docutils-8c616ca52509e49abfbb2b4013587fe62db2fd17.tar.gz | |
Creating a branch. The new branch will reflect the way to use the xsl
stylesheets with the pyton interface. I am now going to put a simpler
version of the XSL stylesheets in the trunk.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7131 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'sandbox/paultremblay/python_interface')
200 files changed, 58896 insertions, 0 deletions
diff --git a/sandbox/paultremblay/python_interface/MANIFEST.in b/sandbox/paultremblay/python_interface/MANIFEST.in new file mode 100644 index 000000000..153e630aa --- /dev/null +++ b/sandbox/paultremblay/python_interface/MANIFEST.in @@ -0,0 +1,8 @@ +include test_files/* +include test.py +include test_files/conf_files/* +include test_files/conf_files/* +include docs/rst/* +include docs/html/* + + diff --git a/sandbox/paultremblay/python_interface/README.txt b/sandbox/paultremblay/python_interface/README.txt new file mode 100644 index 000000000..8f1c3a0ac --- /dev/null +++ b/sandbox/paultremblay/python_interface/README.txt @@ -0,0 +1,100 @@ +========================= + README: Docutils2fo 0.6 +========================= + +:Author: Paul Tremblay +:Contact: paulhtremblay@gmail.com +:Date: $Date$ +:Copyright: This document has been placed in the public domain. + +.. contents:: + +Introduction +============ + +This directory contains stylesheets to convert docutils.xml to XSLFO. +Once the document is converted to XSLFO, you would convert it to PDF +in this way:: + + rst2xml.py my_file.rst > my_file.xml + docutils_to_fo.py my_file.xml > my_file.fo + fop my_file.fo my_file.pdf + +Or, to do all in one pass:: + + rst2xml.py my_file.rst | docutils_to_fo.py | fop -fo - -pdf my_file.pdf + + +Completion +========== + +* Ability to create custom pages of simple layout, of first page layout, + of odd-even layout, and first, odd-even layout. +* Sections +* Transitions +* Paragraphs +* Bullet Lists +* Enumerated Lists +* Definition Lists +* Field Lists +* Bibliographic Fields +* Option List +* Line Blocks +* Block Quotes +* Headers and Footers, with the ability to create custom headers and + footers for the first, odd, and even pages; and the ability to + create custom headers and footers for the Table of Contents secions + for the first, odd, and even pages; and the ability to suppress + headers and footers on the first page. +* Doctest Blocks +* Tables +* Footnotes +* Citations +* Hyperlinks +* Interpreted Text +* inline Literals +* Specific Admonitions +* Generic Admonition +* Image +* Figure +* Topic +* Sidebar +* Parsed Literal Block +* Rubric +* Epigraph +* Highlights +* Pull-Quote +* Compound Paragraph +* Container + +* documenttion of XSLT stylesheets +* Develop code to process XSlT stylesheet (using lxml) + +TODO +===== + + +Python Code +------------ + +- Develop code to read configuration file (in process of doing) + +- Develop code to check configuration file (in process of doing) + +- Develop code to output a customized XSLT stylesheet (in process) + + + +Documentaion +------------ + +- Write a quick overview + +- Write a detailed overview + +Limitations +------------ + +* Cannot do transitions as well as latex +* Cannot put borders around page +* Cannot do sidebars diff --git a/sandbox/paultremblay/python_interface/docs/make_xsl-documentation.sh b/sandbox/paultremblay/python_interface/docs/make_xsl-documentation.sh new file mode 100755 index 000000000..8055416ed --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/make_xsl-documentation.sh @@ -0,0 +1,21 @@ +# $Id$ +set -e +set -u # warns if a variable is not assigned. + +PWD=`pwd` +PWD=`basename $PWD` +if [ "$PWD" != 'docs' ];then + echo 'please run the script only in its own directory (docs)' + exit 1 +fi + +xsltproc xsl/document_parameters.xsl ../docutilsToFo/xsl_fo/parameters.xsl > doc.xml +xml2txt.py doc.xml > rst/parameters.rst +rst2html.py rst/parameters.rst > html/parameters.html +xsltproc xsl/document_stylesheet.xsl xsl/document_stylesheet.xsl > doc.xml +xml2txt.py doc.xml > rst/attribute_sets.rst +rst2html.py rst/attribute_sets.rst > html/attribute_sets.html + +rst2html.py rst/howto.rst > html/howto.html +# rm doc.xml + diff --git a/sandbox/paultremblay/python_interface/docs/rst/attribute_sets.rst b/sandbox/paultremblay/python_interface/docs/rst/attribute_sets.rst new file mode 100644 index 000000000..63c288233 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/rst/attribute_sets.rst @@ -0,0 +1,3698 @@ +#################### +XSL-FO Documentation +#################### + +^^^^^^^^^^^^^^ +Attribute Sets +^^^^^^^^^^^^^^ + +.. contents:: Table of Contents + +Root Attribute Sets +=================== + +Attribute sets root elements. Use these attribute sets to format +the defaults in a document, such as font, font-size, or +line-height. + +default-page-sequence +--------------------- + +:fo: fo:page-sequence + +:docutils: document + +:defaults: + +Formats the properties for the all of the document. + +front-page-sequence +------------------- + +:fo: fo:page-sequence + +:docutils: document + +:inherits: default-page-sequence + +:defaults: + + force-page-count: no-force + +Formats the properties for the complete run of pages, in this +case, the front matter. + +toc-page-sequence +----------------- + +:fo: fo:page-sequence + +:docutils: document + +:inherits: default-page-sequence + +:defaults: + + format: i + + initial-page-number: 1 + + force-page-count: no-force + +Formats the properties for the complete run of pages, in this +case, the toc and any pages associated with it. + +body-page-sequence +------------------ + +:fo: fo:page-sequence + +:docutils: document + +:inherits: default-page-sequence + +:defaults: + + format: 1 + + initial-page-number: 1 + +Formats the properties for the complete run of pages, in this +case, the body. + +default-flow +------------ + +:fo: fo:flow + +:docutils: document + +:defaults: + +Sets up the default attributes for the front-flow, toc-flow, and +body-flow + +front-flow +---------- + +:fo: fo:flow + +:docutils: document + +:inherits: default-flow + +:defaults: + +Formats the properties of the body in the front sequence of +pages. Since the front sequence has no headers and footers, that +means everything. + +toc-flow +-------- + +:fo: fo:flow + +:docutils: document + +:inherits: default-flow + +:defaults: + +Formats the properties of the body in the toc sequence of pages, +which means everything except headers and footers. + +body-flow +--------- + +:fo: fo:flow + +:docutils: document + +:inherits: default-flow + +:defaults: + +Formats the properties of the body in the body sequence of pages, +which means everything except headers and footers. + +footnote-separator-flow +----------------------- + +:fo: fo:flow + +:docutils: footnote + +:defaults: + +Formats the flow of the footnote. + +footnote-separator-block +------------------------ + +:fo: fo:block + +:docutils: footnote + +:defaults: + +Formats the block (with the leader) that separates the footnotes +from the rest of the page. + +Page Attribute Sets +=================== + +Attribute sets for page. These attributes control the formatting +of the actual pages: the paper size and margins. + +paper-size-simple-page-master +----------------------------- + +:fo: None + +:docutils: / + +:defaults: + + page-width: 8.5in + + page-height: 11in + +Sets up the defaults for the paper size, used in other attribute +sets. + +default-simple-page-master +-------------------------- + +:fo: None + +:docutils: / + +:defaults: + + margin-left: 1.0in + + margin-right: 1.0in + + margin-top: 1.0in + + margin-bottom: 1.0in + +Sets up the defaults for the margins of the fo:body-region for +all the pages. + +Simple Page Master Sets +----------------------- + +:fo: fo:simple-page-master + +:docutils: / + +:inherits: paper-size, default-page-setup + +The following attribute sets are identical: + +- simple-page-master + +- first-simple-page-master + +- body-simpe-page-master + +- odd-simple-page-master + +- even-simple-page-master + +- toc-simple-page-master + +- toc-first-simple-page-master + +- toc-body-simple-page-master + +- toc-odd-simple-page-master + +- toc-even-simple-page-master + +- front-simple-page-master + +- front-first-simple-page-master + +- front-body-simple-page-master + +- front-odd-simple-page-master + +- front-even-simple-page-master + +These attriute sets format the margins of the +fo:simple-page-master. By default, they inherit the +``'paper-size-simple-page-master'`` and +``'default-simple-page-master'`` attriute-sets, meaning each page +will have identical size and margins, a satisfactory setup for +many documents. However, the sizes and margins can be modified by +page type, if desired. + +header-region-before +-------------------- + +:fo: fo:region-before + +:docutils: decoration/header + +:defaults: + + extent: .75in + +The extent attribute specifies the header and footer height. + +footer-region-after +------------------- + +:fo: fo:region-after + +:docutils: decoration/footer + +:defaults: + + extent: .75in + +The extent attribute specifies the header and footer height. + +Bibliograhic Fields Attribute Sets +================================== + +Attribute sets for the bibliograhic fields. These attributes +control the formatting of bibliographic fields. + +bibliographic-fields-list-block +------------------------------- + +:fo: list-block + +:docutils: docinfo + +:defaults: + + start-indent: 0mm + + provisional-distance-between-starts: 30mm + + space-before: 12pt + + space-after: 12pt + +Formats the bibliographic fields as a list. Since this element +contains all the other list elements, it can be used to set +values such as the font, background color, line-height, etc, for +the entire list, as well as the space after and before. + +"The provisional-distance-between-starts property of the +list-block specifies the distance bewteen the start of the label +(the bullet, for example) and the actual start of the list +content" (Pawson, 100). In this case, that means the distance +between the label (such as "Version", and the labels' value (such +as "1.2"). + +bibliographic-fields-list-item +------------------------------ + +:fo: fo:list-item + +:docutils: + docinfo/author|docinfo/authors|docinfo/organization|etc. + +:defaults: + + space-before: 12pt + +For each item (author, authors, organization, contact, address, +version, date, copyright, custom field) in the bibliograhic +fields. Use the 'space-after' attribute to control the spacing +between each item. + +bibliographic-fields-first-list-item +------------------------------------ + +:fo: fo:list-item + +:docutils: + docinfo/author|docinfo/authors|docinfo/organization|etc. + +:inherits: bibliographic-fields-list-item + +:defaults: + + space-before: 0pt + +Same as above, but sets the space before to 0pt. + +bibliographic-fields-list-item-label +------------------------------------ + +:fo: fo:list-item-label + +:docutils: + docinfo/author|docinfo/authors|docinfo/organization|etc. + +:defaults: + + end-indent: label-end() + +The default attribute end-indent = "label-end()" ensures that the +label aligns properly. + +bibliographic-fields-item-body +------------------------------ + +:fo: fo:list-item-body + +:docutils: + docinfo/author|docinfo/authors|docinfo/organization|etc. + +:defaults: + + start-indent: body-start() + +The default of start-indent = "body-start()" ensures the correct +alignment of the labels. + +bibliographic-fields-item-label-block +------------------------------------- + +:fo: fo:block + +:docutils: + docinfo/author|docinfo/authors|docinfo/organization|etc. + +:defaults: + + font-weight: bold + +Formats the block that wraps the the name of the field (such as +Author, Version, etc). + +bibliographic-fields-block +-------------------------- + +:fo: fo:block + +:docutils: + docinfo/author|docinfo/authors|docinfo/organization|etc. + +:defaults: + +Formats the blocks (docutilis paragraphs) of the value of the +field. Use the 'space-after' attribute to control the spacing +between a multi-paragraph description. + +bibliographic-first-fields-block +-------------------------------- + +:fo: fo:block + +:docutils: + docinfo/author|docinfo/authors|docinfo/organization|etc. + +:inherits: bibliographic-fields-block + +:defaults: + +Same as above, but for the first such paragraph. + +address-value-block +------------------- + +:fo: fo:block + +:docutils: docinfo/address + +:inherits: bibliographic-fields-block + +:defaults: + + white-space: pre + +Formats the blocks (docutilis paragraphs) of the address field, +which has to preserve the white space, according to the docutils +specs. Since this inherits from the bibliographic-fields-bloc, it +doesn't make sense to change attributes here directly. + +author-block +------------ + +:fo: fo:block + +:docutils: docinfo/author + +:defaults: + + space-before: 12pt + +Formats the author element, when bibliograhic info is not +formatted as a list. + +authors-block +------------- + +:fo: fo:block + +:docutils: docinfo/authors + +:defaults: + + space-before: 12pt + +Formats the authors element, when bibliograhic info is not +formatted as a list. + +date-block +---------- + +:fo: fo:block + +:docutils: docinfo/date + +:defaults: + + space-before: 12pt + +Formats the date element, when bibliograhic info is not formatted +as a list. + +organization-block +------------------ + +:fo: fo:block + +:docutils: docinfo/organization + +:defaults: + + space-before: 12pt + +Formats the organization element, when bibliograhic info is not +formatted as a list. + +contact-block +------------- + +:fo: fo:block + +:docutils: docinfo/contact + +:defaults: + + space-before: 12pt + +Formats the contact element, when bibliograhic info is not +formatted as a list. + +status-block +------------ + +:fo: fo:block + +:docutils: docinfo/status + +:defaults: + + space-before: 12pt + +Formats the status element, when bibliograhic info is not +formatted as a list. + +copyright-block +--------------- + +:fo: fo:block + +:docutils: docinfo/copyright + +:defaults: + + space-before: 12pt + +Formats the copyright element, when bibliograhic info is not +formatted as a list. + +version-block +------------- + +:fo: fo:block + +:docutils: docinfo/version + +:defaults: + + space-before: 12pt + +Formats the version element, when bibliograhic info is not +formatted as a list. + +revision-block +-------------- + +:fo: fo:block + +:docutils: docinfo/revision + +:defaults: + + space-before: 12pt + +Formats the revision element, when bibliograhic info is not +formatted as a list. + +address-block +------------- + +:fo: fo:block + +:docutils: docinfo/address + +:defaults: + + white-space: pre + + space-before: 12pt + +Formats the address element, when bibliograhic info is not +formatted as a list. + +Custom bibliographic fields +--------------------------- + +:fo: fo:block + +:docutils: docinfo/field + +The following attribute sets are identical in nature: + +* custom-bib-info1 + +* custom-bib-info2 + +* custom-bib-info3 + +* custom-bib-info4 + +* custom-bib-info5 + +* custom-bib-info6 + +* custom-bib-info7 + +* custom-bib-info8 + +* custom-bib-info9 + +* custom-bib-info10 + +These attribute-sets format the custom bibliographic fields. +``'custom-bib-info1'`` refers to the first occurrence of such a +field, ``'custom-bib-info2'`` to the second, and so fourth. + +Front Matter Attribute Sets +=========================== + +Attribute sets for the dedication and abstract. + +dedication-block +---------------- + +:fo: fo:block + +:docutils: topic[@classes = "dedication"] + +:defaults: + +Formats the dedication text, including the title and subsequent +paragraphs, by wrapping them in a block. + +abstract-block +-------------- + +:fo: fo:block + +:docutils: topic[@classes = "abstract"] + +:defaults: + +Formats the abstract text, including the title and subsequent +paragraphs, by wrapping them in a block. + +dedication-title-block +---------------------- + +:fo: fo:block + +:docutils: topic[@classes = "dedication"]/title + +:defaults: + + text-align: center + + font-weight: bold + + space-after: 12pt + +Formats the title for the dedication. + +abstract-title-block +-------------------- + +:fo: fo:block + +:docutils: topic[@classes = "abstract"]/title + +:defaults: + + text-align: center + + font-weight: bold + +Formats the abstract title. + +dedication-paragraph-block +-------------------------- + +:fo: fo:block + +:docutils: topic[@classes = "dedication"]/paragraph + +:defaults: + + font-style: italic + + space-after: 12pt + +Formats the paragraphs of the dedication. + +dedication-first-paragraph-block +-------------------------------- + +:fo: fo:block + +:docutils: topic[@classes = "dedication"]/paragraph + +:inherits: dedication-paragraph-block + +:defaults: + + space-before: 0pt + +Formats the first paragraph of the dedication. + +abstract-paragraph-block +------------------------ + +:fo: fo:block + +:docutils: topic[@classes = "abstract"]/paragraph + +:defaults: + + space-before: 12pt + +Formats the paragraphs of the abstract. + +abstract-first-paragraph-block +------------------------------ + +:fo: fo:block + +:docutils: topic[@classes = "abstract"]/paragraph + +:inherits: abstract-paragraph-block + +:defaults: + + space-before: 0pt + +Formats the first paragraph of the abstract. + +Header and Footer Attribute Sets +================================ + +Attribute sets for the headers and footers. Since headers and +footers often need very special formatting, the stylesheets allow +for the formatting of up to three paragraphs for each header and +footer. The first refers to the first that occurrs in the +document, the second to the second, and the third to the third. + +header-block +------------ + +:fo: fo:block + +:docutils: decoration/header + +:defaults: + + font-size: 12pt + + text-align: center + + space-before.conditionality: retain + +Formats the properties for the header. Use to set the space +between the header and the body text, using ``'space-before = +x'`` and setting ``'space-before.conditionality'`` to +``'retain'``. + +first-header-block +------------------ + +:fo: fo:block + +:docutils: container[@classes='first-header'] + +:defaults: + +Formats the properties for the header for the first page. + +odd-header-block +---------------- + +:fo: fo:block + +:docutils: container[@classes='odd-header'] + +:defaults: + +Formats the properties for the for the header of odd pages, when +using a layout of ``'first-odd-even'``, or ``'odd-even'``. + +even-header-block +----------------- + +:fo: fo:block + +:docutils: container[@classes='even-header'] + +:defaults: + +Formats the properties for the for the header of even pages, when +using a layout of ``'first-odd-even'``, or ``'odd-even'``. + +body-header-block +----------------- + +:fo: fo:block + +:docutils: container[@classes='body-header'] + +:defaults: + +Formats the properties for the for the header of the body, when +using a layout of ``'first'``. + +footer-block +------------ + +:fo: fo:block + +:docutils: decoration/footer + +:defaults: + + font-size: 12pt + + text-align: center + + space-before.conditionality: retain + +Formats the properties for the footer. Use to set the space +between the header and the body text, using ``'space-before = +x'`` and setting ``'space-before.conditionality'`` to +``'retain'``. + +first-footer-block +------------------ + +:fo: fo:block + +:docutils: container[@classes='first-footer'] + +:defaults: + +Formats the properties for the footer for the first page. + +odd-footer-block +---------------- + +:fo: fo:block + +:docutils: container[@classes='odd-footer'] + +:defaults: + +Formats the properties for the for the footer of odd pages, when +using a layout of ``'first-odd-even'``, or ``'odd-even'``. + +even-footer-block +----------------- + +:fo: fo:block + +:docutils: container[@classes='even-footer'] + +:defaults: + +Formats the properties for the for the footer of even pages, when +using a layout of ``'first-odd-even'``, or ``'odd-even'``. + +body-footer-block +----------------- + +:fo: fo:block + +:docutils: container[@classes='body-footer'] + +:defaults: + +Formats the properties for the for the footer of the body, when +using a layout of ``'first'``. + +toc-first-header-block +---------------------- + +:fo: fo:block + +:docutils: container[@classes='toc-first-header'] + +:defaults: + +Formats the properties for the header for the first page of the +TOC. + +toc-odd-header-block +-------------------- + +:fo: fo:block + +:docutils: container[@classes='toc-odd-header'] + +:defaults: + +Formats the properties for the for the header of odd pages of the +TOC, when using a layout of ``'first-odd-even'``, or +``'odd-even'``. + +toc-even-header-block +--------------------- + +:fo: fo:block + +:docutils: container[@classes='toc-even-header'] + +:defaults: + +Formats the properties for the for the header of even pages of +the TOC, when using a layout of ``'first-odd-even'``, or +``'odd-even'``. + +toc-body-header-block +--------------------- + +:fo: fo:block + +:docutils: container[@classes='toc-body-header'] + +:defaults: + +Formats the properties for the for the header of the body of the +TOC, when using a layout of ``'first'``. + +toc-first-footer-block +---------------------- + +:fo: fo:block + +:docutils: container[@classes='toc-first-footer'] + +:defaults: + +Formats the properties for the footer for the first page of the +TOC. + +toc-odd-footer-block +-------------------- + +:fo: fo:block + +:docutils: container[@classes='toc-odd-footer'] + +:defaults: + +Formats the properties for the for the footer of odd pages of the +TOC, when using a layout of ``'first-odd-even'``, or +``'odd-even'``. + +toc-even-footer-block +--------------------- + +:fo: fo:block + +:docutils: container[@classes='toc-even-footer'] + +:defaults: + +Formats the properties for the for the footer of even pages of +the TOC, when using a layout of ``'first-odd-even'``, or +``'odd-even'``. + +toc-body-footer-block +--------------------- + +:fo: fo:block + +:docutils: container[@classes='toc-body-footer'] + +:defaults: + + font-size: 12pt + + text-align: center + + space-before.conditionality: retain + +Formats the properties for the for the footer of the body of the +TOC, when using a layout of ``'first'``. + +paragraph-header-block +---------------------- + +:fo: fo:block + +:docutils: decoration/footer/paragraph + +:defaults: + + font-size: 12pt + + text-align: center + +Formats the properties for the paragraphs in the header. Use to +set the space between the footer and the body text, using +``'space-before = x'`` and setting +``'space-before.conditionality'`` to ``'retain'``. + +paragraph-footer-block +---------------------- + +:fo: fo:block + +:docutils: decoration/footer/paragraph + +:defaults: + + font-size: 12pt + + text-align: center + +Formats the properties for the footer. Use to set the space +between the footer and the body text, using ``'space-before = +x'`` and setting ``'space-before.conditionality'`` to +``'retain'``. + +TOC Matter Attribute Sets +========================= + +Attribute sets for the TOC. + +toc-block +--------- + +:fo: fo:block + +:docutils: topic[@classes = "contents"] + +:defaults: + +Formats the block that wraps the TOC. + +toc-title-block +--------------- + +:fo: fo:block + +:docutils: topic[@classes = "contents"]/title + +:defaults: + + text-align: center + + font-weight: bold + + font-size: 14pt + +Formats the block for the title for the TOC. + +toc-entry-defaults-block +------------------------ + +:fo: None + +:docutils: None + +:defaults: + + space-after: 3pt + + text-align-last: justify + +Sets up the defaults for the TOC entries. + +toc-level1-block +---------------- + +:fo: fo:block + +:docutils: topic[@classes = + "contents"]/bullet_list/list_item/paragraph/ + +:inherits: toc-entry-defaults-block + +:defaults: + +Formats the block for the level 1 table of contents entry. If a +number exists, it is formatted according to the parameter +'number-section1'. + +toc-level2-block +---------------- + +:fo: fo:block + +:docutils: topic[@classes = + "contents"]/bullet_list/list_item/bullet_list/list_item/paragraph/ + +:inherits: toc-entry-defaults-block + +:defaults: + + start-indent: 10mm + +Formats the block for the level 2 table of contents entry. If a +number exists, it is formatted according to the parameter +'number-section2'. + +toc-level3-block +---------------- + +:fo: fo:block + +:docutils: topic[@classes = + "contents"]/bullet_list/list_item/bullet_list/list_item/paragraph/etc. + +:inherits: toc-entry-defaults-block + +:defaults: + + start-indent: 20mm + +Formats the block for the level 3 table of contents entry. If a +number exists, it is formatted according to the parameter +'number-section3'. + +toc-level4-block +---------------- + +:fo: fo:block + +:docutils: topic[@classes = + "contents"]/bullet_list/list_item/bullet_list/list_item/paragraph/etc. + +:inherits: toc-entry-defaults-block + +:defaults: + + start-indent: 30mm + +Formats the block for the level 4 table of contents entry. If a +number exists, it is formatted according to the parameter +'number-section4'. + +toc-level5-block +---------------- + +:fo: + +:docutils: topic[@classes = + "contents"]/bullet_list/list_item/bullet_list/list_item/paragraph/etc. + +:inherits: toc-entry-defaults-block + +:defaults: + + start-indent: 40mm + +Formats the block for the level 5 table of contents entry. If a +number exists, it is formatted according to the parameter +'number-section5'. + +Section Attribute Sets +====================== + +Attribute sets for the section titles. + +default-section-title-block +--------------------------- + +:fo: None + +:docutils: None + +:defaults: + + space-before: 12pt + + space-after: 12pt + + keep-with-next: always + +Sets up the defaults for the section titles. The title should +always have some text beneath it to avoid widows and orphans; +hence the keep-with-always property. + +title-level-block +----------------- + +:fo: fo:block + +:docutils: section/title|section/section/title|etc. + +:inherits: default-section-title-block + +The following attribute sets are identical in nature: + +- title-level1-block + +- title-level2-block + +- title-level3-block + +- title-level4-block + +- title-level5-block + +- title-level6-block + +- title-level7-block + +- title-level8-block + +- title-level9-block + +These attribute-sets format the titles of all sections. + +title-number-inline +------------------- + +:fo: fo:inline + +:docutils: section/title/generated[@classes="sectnum]" + +:defaults: + + space-end: 12pt + +Formats the title number generated by docutils. + +Body Elements +============= + +Attribute sets for body elements, including the document title +and subtitle; the default paragraph; the transition element; and +the literal block. + +paragraph-block +--------------- + +:fo: fo:block + +:docutils: document/paragrah|section/paragraph" + +:defaults: + + space-after: 12pt + +Formats the default paragraph. + +first-paragraph-block +--------------------- + +:fo: fo:block + +:docutils: document/paragrah|section/paragraph" + +:inherits: paragraph-block + +:defaults: + +Formats the first default paragraph. + +literal-block +------------- + +:fo: fo:block + +:docutils: document/literal_block|section/literal_block" + +:defaults: + + font-family: monospace + + font-size: 8 + + white-space: pre + + space-after: 12pt + + space-before: 12pt + +Formats the literal text. + +transition-block +---------------- + +:fo: fo:block + +:docutils: document/transition|section/transition" + +:defaults: + + space-before: 12pt + + space-after: 12pt + + text-align: center + +Formats the transition block. The actutal text for this block is +set by the 'transition-text' parameter. + +document-title-block +-------------------- + +:fo: fo:block + +:docutils: document/title" + +:defaults: + + space-after: 12pt + + font-size: 24pt + + text-align: center + + font-weight: bold + +Formats the title for the document. + +document-title-page-block +------------------------- + +:fo: fo:block + +:docutils: document/title|document/subtitle" + +:defaults: + +The block that wraps both the title and subtitle. This block only +gets written if the title and subtitle occur in the front +section, or TOC section. + +document-subtitle-block +----------------------- + +:fo: fo:block + +:docutils: document/subtitle" + +:defaults: + + space-before: 12pt + + space-after: 12pt + + font-size: 18pt + + text-align: center + + font-weight: bold + +Formats the subtitle of the document. + +block-quote-outer-block +----------------------- + +:fo: fo:block + +:docutils: block_quote + +:defaults: + + start-indent: 20mm + + end-indent: 20mm + + space-after: 12pt + + space-before: 12pt + +The attribute set that formats the block that wraps the other +blocks in a block quote. Use the attribute set to format space +after or space before, etc. + +block-quote-paragraph-block +--------------------------- + +:fo: fo:block + +:docutils: block_quote/paragraph + +:defaults: + + space-before: 12pt + +The attribute set that formats the paragraphs in the block quote. +A different set of attributes controls the first paragraph (see +below). Use this attribute set to set the space between +paragraphs with the 'space-before' attribute. + +block-quote-first-paragraph-block +--------------------------------- + +:fo: fo:block + +:docutils: block_quote/paragraph[1] + +:inherits: block-quote-paragraph-block + +:defaults: + + space-before: 0pt + +The attribute set that formats the first paragraph in the block +quote. It inherits all the attributes from +'block-quote-first-paragraph-block' and then sets the +'space-before' to 0. It does not make sense to modify attributes +in this attribute set directly. + +block-quote-attribution-block +----------------------------- + +:fo: fo:block + +:docutils: block_quote/paragraph[1] + +:inherits: block-quote-paragraph-block + +:defaults: + + text-align: right + +This attribute set the attribution in a block quote. + +bullet list +=========== + +Attribute sets for the bullet list. + +bullet-list-block +----------------- + +:fo: list-block + +:docutils: bullet_list + +:defaults: + + start-indent: 5mm + + provisional-distance-between-starts: 5mm + + space-before: 12pt + + space-after: 12pt + +For the bullet list. Since this element contains all the other +list elements, it can be used to set values such as the font, +background color, line-height, etc, for the entire list, as well +as the space after and before. + +"The provisional-distance-between-starts property of the +list-block specifies the distance bewteen the start of the label +(the bullet, for example) and the actual start of the list +content" (Pawson, 100) + +bullet-list-item +---------------- + +:fo: fo:list-item + +:docutils: bullet_list/list_item + +:defaults: + + space-before: 12pt + +For the item in the bullet list. The attributes can control the +spacing between each item. A different set of attributes controls +the spacing of the first item (see below). + +bullet-first-list-item +---------------------- + +:fo: fo:list-item + +:docutils: bullet_list/list_item[1] + +:inherits: bullet-list-item + +:defaults: + + space-before: 0pt + +For the first item in the bullet list. This attribute set +inherits all the properties form 'bullet-list-item', and then +re-defines the space-before to 0pt. In order to get space between +the first item and the text before it, use the space-after +attribute in the bullet-list attribute set. + +bullet-level2-list-item +----------------------- + +:fo: fo:list-item + +:docutils: bullet_list/bullet_list/list_item + +:defaults: + + space-before: 12pt + +Same as above, except for a nested bullet list. + +bullet-level2-first-list-item +----------------------------- + +:fo: fo:list-item + +:docutils: bullet_list/list_item[1] + +:inherits: bullet-level2-list-item + +:defaults: + + space-before: 0pt + +For the first item in a nested bullet list. This attribute set +inherits all the properties form 'bullet-list-item', and then +re-defines the space-before to 0pt. In order to get space between +the first item and the text before it, use the space-after +attribute in the bullet-list attribute set. + +bullet-list-item-label +---------------------- + +:fo: fo:list-item-label + +:docutils: bullet_list/list_item + +:defaults: + + end-indent: label-end() + +The default attribute end-indent = "label-end()" ensures that the +label aligns properly. + +bullet-list-item-label-block +---------------------------- + +:fo: fo:block + +:docutils: bullet_list/list_item + +:defaults: + +These attributes format the block that wraps the bullet. (FO +requires such a block, even for a small label like this.) + +bullet-list-item-body +--------------------- + +:fo: fo:list-item-body + +:docutils: bullet_list/list_item + +:defaults: + + start-indent: body-start() + +The default of start-indent = "body-start()" ensures the correct +alignment of the labels. + +bullet-list-item-body-block +--------------------------- + +:fo: fo:block + +:docutils: bullet_list/list_item/paragraph + +:defaults: + + space-after: 12pt + +Formats the blocks (docutilis paragraphs) of the body of each +item. + +bullet-level2-list-block +------------------------ + +:fo: list-block + +:docutils: bullet_list/bullet_list + +:defaults: + + start-indent: 15mm + + provisional-distance-between-starts: 5mm + + space-before: 12pt + +Same as for the bullet-list-block attribute. The default sets the +start-indent property to a greater value to indent this nested +list. + +enumerated list +=============== + +Attribute sets for the enumerated list. + +enumerated-list-block +--------------------- + +:fo: list-block + +:docutils: enumerated_list + +:defaults: + + start-indent: 5mm + + provisional-distance-between-starts: 10mm + + space-before: 12pt + + space-after: 12pt + +For the enumerated list. Since this element contains all the +other list elements, it can be used to set values such as the +font, background color, line-height, etc, for the entire list, as +well as the space after and before. + +"The provisional-distance-between-starts property of the +list-block specifies the distance bewteen the start of the label +(the bullet, for example) and the actual start of the list +content" (Pawson, 100) + +enumerated-level2-list-block +---------------------------- + +:fo: list-block + +:docutils: enumerated_list/enumerated_list + +:defaults: + + start-indent: 15mm + + provisional-distance-between-starts: 10mm + + space-before: 12pt + + space-before: 12pt + +Same as for the enumerated-list-block attribute. The default sets +the start-indent property to a greater value to indent this +nested list. + +enumerated-list-item +-------------------- + +:fo: fo:list-item + +:docutils: enumerated_list/list_item + +:defaults: + + space-before: 12pt + +For the item in the enumerated list. The attributes can control +the spacing between each item. A different set of attributes +controls the spacing of the first item (see below). + +enumerated-first-list-item +-------------------------- + +:fo: fo:list-item + +:docutils: enumerated_list/list_item[1] + +:inherits: enumerated-list-item + +:defaults: + + space-before: 0pt + +For the first item in the enumerated list. This attribute set +inherits all the properties form 'enumerated-list-item', and then +re-defines the space-before to 0pt. In order to get space +between the first item and the text before it, use the +space-after attribute in the enumerated-list attribute set. + +enumerated-level2-list-item +--------------------------- + +:fo: fo:list-item + +:docutils: enumerated_list/list_item/enumerated_list/list-item + +:defaults: + + space-before: 12pt + +Same as above, but formats item of nested list. + +enumerated-level2-first-list-item +--------------------------------- + +:fo: fo:list-item + +:docutils: enumerated_list/item/enumerated_list/list_item[1] + +:inherits: enumerated-level2-list-item + +:defaults: + + space-before: 0pt + +For the first item in the nested enumerated list. + +enumerated-list-item-label +-------------------------- + +:fo: fo:list-item-label + +:docutils: enumerated_list/list_item + +:defaults: + + end-indent: label-end() + +The default attribute end-indent = "label-end()" ensures that the +label aligns properly. + +enumerated-list-item-body +------------------------- + +:fo: fo:list-item-body + +:docutils: enumerated_list/list_item + +:defaults: + + start-indent: body-start() + +The default of start-indent = "body-start()" ensures the correct +alignment of the labels. + +enumerated-list-item-body-block +------------------------------- + +:fo: fo:block + +:docutils: enumerated_list/list_item/paragraph + +:defaults: + + space-after: 12pt + +Formats the blocks (docutilis paragraphs) of the body of each +item. + +definition list +=============== + +Attribute sets for the definition list. + +definition-list-block +--------------------- + +:fo: block + +:docutils: definition_list + +:defaults: + + space-after: 12pt + + space-before: 12pt + +For the definition list. Since this element contains all the +other blocks in the list, it can be used to set values such as +the font, background color, line-height, etc, for the entire +list, as well as the space after and before. + +definition-list-item-block +-------------------------- + +:fo: fo:block + +:docutils: definition_list/definition_list_item + +:defaults: + + space-before: 12pt + +For the items in the definition list. The attributes can control +the spacing between each item. A different set of attributes +controls the spacing of the first item (see below). + +definition-list-item-first-block +-------------------------------- + +:fo: fo:block + +:docutils: definition_list/definition_list_item + +:inherits: definition-list-item-block + +:defaults: + + space-before: 0pt + +For the first item in the definition list. This attribute set +inherits all the properties form 'definition-list-item', and then +re-defines the space-before to 0pt. In order to get space +between the first item and the text before it, use the +space-after attribute in the option-list attribute set. + +It does not makes sense to change this set direclty. + +definition-term-block +--------------------- + +:fo: fo:block + +:docutils: definition_list/definition_list_item/term + +:defaults: + + font-weight: bold + +Formats the bock of the the term. Can be used to control spacing +between term and definition, but don't use with space before, or +you won't be able to control spacing before list + +definition-block +---------------- + +:fo: fo:block + +:docutils: definition_list/definition_list_item/definition + +:defaults: + +Formats the bock of the of the defintion, that wraps the +paragraph blocks. + +classifier-inline +----------------- + +:fo: fo:inline + +:docutils: definition_list/definition_list_item/classifier + +:defaults: + + font-style: italic + +For the inine properties of the classifier item. + +definition-paragraph-block +-------------------------- + +:fo: fo:block + +:docutils: + definition_list/definition_list_item/definition/paragraph + +:defaults: + + space-before: 12pt + + start-indent: 30pt + +Formats the blocks (paragraphs in the defintion. Can be lsed to +control the space between paragraphs by setting the space-bfore +attribute. Don't use the space-after attribute, or you won't be +able to contorl the spacing between items + +definition-first-paragraph-block +-------------------------------- + +:fo: fo:block + +:docutils: + definition_list/definition_list_item/definition/paragraph[1] + +:inherits: definition-first-paragraph-block + +:defaults: + + space-before: 0pt + +For the first paragraph in the definition list. This attribute +set inherits all the properties frorm +'definition-first-paragraph-block', and then re-defines the +space-before to 0pt. + +It does not makes sense to change this set direclty. + +field list +========== + +Attribute sets for the field list. + +field-list-block +---------------- + +:fo: list-block + +:docutils: field_list + +:defaults: + + start-indent: 0mm + + provisional-distance-between-starts: 30mm + + space-before: 12pt + + space-after: 12pt + +Formats the field list. Since this element contains all the other +list elements, it can be used to set values such as the font, +background color, line-height, etc, for the entire list, as well +as the space after and before. + +"The provisional-distance-between-starts property of the +list-block specifies the distance bewteen the start of the label +(the bullet, for example) and the actual start of the list +content" (Pawson, 100). + +field-list-item +--------------- + +:fo: fo:list-item + +:docutils: field_list/field + +:defaults: + + space-before: 12pt + +For the items, or 'fields' in the field list. The attributes can +control the spacing between each item. A different set of +attributes controls the spacing of the first item (see below). + +field-first-list-item +--------------------- + +:fo: fo:list-item + +:docutils: field_list/field[1] + +:inherits: field-list-item + +:defaults: + + space-before: 0pt + +For the first item in the field list. This attribute set inherits +all the properties form 'field-list-item', and then re-defines +the space-before to 0pt. In order to get space between the first +item and the text before it, use the space-after attribute in the +field-list-block attribute set. + +It does not make sense to change this attriubte set directly. + +field-list-item-label +--------------------- + +:fo: fo:list-item-label + +:docutils: field_list/field/field_name + +:defaults: + + end-indent: label-end() + +The default attribute end-indent = "label-end()" ensures that the +label aligns properly. + +field-list-item-body +-------------------- + +:fo: fo:list-item-body + +:docutils: field_list/field/field_body + +:defaults: + + start-indent: body-start() + +The default of start-indent = "body-start()" ensures the correct +alignment of the labels. + +field-body-block +---------------- + +:fo: fo:block + +:docutils: field_list/field/field_body/paragraph + +:defaults: + + space-after: 12pt + +Formats the blocks (docutilis paragraphs) of the field. + +field-list-item-label-block +--------------------------- + +:fo: fo:block + +:docutils: field_list/field/field_name + +:defaults: + + font-weight: bold + +Formats the block that wraps the field name. + +option list as list +=================== + +Since an option list can be rendered as either a traditonal list, +or a definition list, there are two sets of attribute sets. +These attribute sets are used for the options list when it is +rendered as a list. + +option-list-block +----------------- + +:fo: list-block + +:docutils: option_list + +:defaults: + + start-indent: 0mm + + provisional-distance-between-starts: 50mm + + space-before: 12pt + + space-after: 12pt + +For the option list. Since this element contains all the other +list elements, it can be used to set values such as the font, +background color, line-height, etc, for the entire list, as well +as the space after and before. + +"The provisional-distance-between-starts property of the +list-block specifies the distance bewteen the start of the label +(the bullet, for example) and the actual start of the list +content" (Pawson, 100) + +option-list-item +---------------- + +:fo: fo:list-item + +:docutils: option_list/option_list_item + +:defaults: + + space-before: 12pt + +For the items in the option list. The attributes can control the +spacing between each item. A different set of attributes controls +the spacing of the first item (see below). + +option-first-list-item +---------------------- + +:fo: fo:list-item + +:docutils: option_list/option_list_item[1] + +:inherits: option-list-item + +:defaults: + + space-before: 0pt + +For the first item in the option list. This attribute set +inherits all the properties form 'option-list-item', and then +re-defines the space-before to 0pt. In order to get space between +the first item and the text before it, use the space-after +attribute in the option-list attribute set. + +It does not make sense to change this attriubte set directly. + +option-list-item-label +---------------------- + +:fo: fo:list-item-label + +:docutils: option_list/option_list_item/option_group + +:defaults: + + end-indent: label-end() + +The default attribute end-indent = "label-end()" ensures that the +label aligns properly. + +option-list-item-label-block +---------------------------- + +:fo: fo:block + +:docutils: + option_list/option_list_item/option_group/option_string|option_argument + +:defaults: + +These attributes format the block that wraps the option_string +and option_argument. + +option-list-item-body +--------------------- + +:fo: fo:list-item-body + +:docutils: option_list/option_list_item/description + +:defaults: + + start-indent: body-start() + +The default of start-indent = "body-start()" ensures the correct +alignment of the labels. + +option-list-item-body-block +--------------------------- + +:fo: fo:block + +:docutils: option_list/option_list_item/description/paragraph + +:defaults: + +Formats the blocks (docutilis paragraphs) that describe the +options. If there was more than one paragraph, you could use +attributes such as space after. + +option-inline +------------- + +:fo: fo:inline + +:docutils: + option_list/option_list_item/option_group/option/option_string + +:defaults: + + font-family: monospace + +Used to format any inline properties of the option_string. + +option-argument-inline +---------------------- + +:fo: fo:inline + +:docutils: + option_list/option_list_item/option_group/option/option_argument + +:defaults: + + font-family: monospace + + font-style: italic + +Used to format any inline properties of the option_string. + +option list as definition list +============================== + +These attribute sets are used for the options list when it is +rendered as a definition list. (See the docutils reference guide +for an example of a definition list, or see the defintion list in +the test files.) + +option-list-definition-block +---------------------------- + +:fo: fo:block + +:docutils: option_list + +:defaults: + + space-before: 12pt + + space-after: 12pt + +Formats the block that wraps the other blocks. Use to control +space after and before, or to set any block items on the entire +list. + +This block wraps around another block, which in turn wraps around +a third block. + +option-list-item-block +---------------------- + +:fo: fo:block + +:docutils: option_list/option_list_item + +:defaults: + + space-before: 8pt + +Formats the block that wraps the options and descriptions, which +are also blocks. + +option-list-first-item-block +---------------------------- + +:fo: fo:block + +:docutils: option_list/option_list_item + +:defaults: + + space-before: 0pt + +Same as for option-list-item-block, but sets the space-before to +0pt + +Does not make sense to change the attributes here directly. + +option-group-block +------------------ + +:fo: fo:block + +:docutils: option_list_item/option_list_item/option_group + +:defaults: + + keep-with-next: always + +Formats the block that contains the inline elements of the +options and arguments. For a defintion list, this block serves as +the term, and sits on top, and to the left of the description. + +option-list-description-block +----------------------------- + +:fo: fo:block + +:docutils: option_list/option_list_item/description + +:defaults: + + start-indent: 16pt + + space-before: 8pt + +Formats the blocks wrappring the paragraphs describing the +options or arguments. This groups of blocks sits below the blocks +formatting the options and arguments, and in a defintion list +are usually indented right. + +option-list-paragraph-block +--------------------------- + +:fo: fo:block + +:docutils: option_list/option_list_item/description/paragraph + +:defaults: + + space-before: 0pt + +Formats the paragraphs in the description for an options list +formatted as a definition list. + +option-list-first-paragraph-block +--------------------------------- + +:fo: fo:block + +:docutils: option_list/option_list_item/description/paragraph + +:inherits: option-list-paragraph-block + +:defaults: + + space-before: 0pt + +Formats the first paragraph in the description for an options +list formatted as a definition list. + +Line Block +========== + +Attribute sets for the line block. + +outer-line-block +---------------- + +:fo: fo:block + +:docutils: line_block + +:defaults: + + space-before: 12pt + + space-after: 12pt + +The outer block containing the blocks of lines. Use the outer +block to set space before or after the verse. + +level1-line-block +----------------- + +:fo: fo:block + +:docutils: line_block/line + +:defaults: + + start-indent: 10mm + +Attribute sets for the first level of lines. + +level2-line-block +----------------- + +:fo: fo:block + +:docutils: line_block/line_block/line + +:defaults: + + start-indent: 20mm + +Attribute sets for the second level of lines. + +level3-line-block +----------------- + +:fo: fo:block + +:docutils: line_block/line_block/line_block/line + +:defaults: + + start-indent: 30mm + +Attribute sets for the third level of lines. + +level4-line-block +----------------- + +:fo: fo:block + +:docutils: line_block/line_block/line_block/line_block/line + +:defaults: + + start-indent: 40mm + +Attribute sets for the fourth level of lines. + +level5-line-block +----------------- + +:fo: fo:block + +:docutils: + line_block/line_block/line_block/line_block/line_block/line + +:defaults: + + start-indent: 50mm + +Attribute sets for the fifth level of lines. + +stanza-title-block +------------------ + +:fo: fo:block + +:docutils: line_block/title_reference + +:defaults: + + text-align: center + + space-before: 12 + + font-weight: bold + +Formats the title of a stanza. + +Table +===== + +Attribute sets for the Table. + +table-block-container +--------------------- + +:fo: fo:block-container + +:docutils: table + +:defaults: + + space-before: 12pt + + space-after: 12pt + +Formats the block container that wraps bothe the table and a the +table title (captin) if one exists. Use to control space before +and after the table. + +table +----- + +:fo: fo:table + +:docutils: table + +:defaults: + + table-layout: fixed + + inline-progression-dimension: 100% + +Formats the table. + +table-header +------------ + +:fo: fo:table-header + +:docutils: tgroup/thead + +:defaults: + + font-weight: bold + +Formats the header of the table. + +default-cell +------------ + +:fo: fo:cell + +:docutils: None + +:defaults: + + border: solid black 1px + + padding: 1em + + border-collapse: collapse + +Sets the defaults for all cells. + +table-header-cell +----------------- + +:fo: fo:cell + +:docutils: thead/row/entry + +:inherits: default-cell + +:defaults: + + border-bottom: solid black 2px + +Formats the cells in the table header. + +table-header-block +------------------ + +:fo: fo:block + +:docutils: thead/row/entry/paragraph + +:defaults: + +Attributes for the paragraphs in the header cell. + +table-body +---------- + +:fo: fo:table-body + +:docutils: tbody + +:defaults: + +Attributes for the table body. + +table-row +--------- + +:fo: fo:table-row + +:docutils: tbody/row + +:defaults: + + keep-together.within-page: always + +Attributes for the table row. + +table-cell +---------- + +:fo: fo:table-cell + +:docutils: tbody/row/entry + +:inherits: default-cell + +:defaults: + +Attributes for the table cell. + +cell-block +---------- + +:fo: fo:block + +:docutils: tbody/row/entry/paragraph + +:defaults: + +Attributes for the paragraphs in the cell. + +caption-block +------------- + +:fo: fo:block + +:docutils: table/title + +:defaults: + + text-align: center + + space-before: 6pt + + space-after: 6pt + +Attributes for the table title, or caption. The parameter +'table-title-placement', controls whether this block is placed +before or after the table. If it is placed on top of the table, +it has a 'keep-with-next="always"' value that cannot be changed. +If this block is placed on the bottom it has a +'keep-with-previous="always"' value that cannot be changed. + +Table Extended +============== + +Attribute sets for the Extended Tables. + +Custom Tables +------------- + +:fo: See below + +:docutils: See below + +The table_extend.xsl contains templates to match 30 custom +tables, and and attribute sets for each of these tables. Each +attribute set has has the same function as its corresponding +attribute set in the regular table, as documented above. + +* table1-block-container => table-block-contanter + +* table1 => table + +* table1-header => table-header + +* table1-header-cell => table-header-cell + +* table1-header-block => table-header-block + +* table1-body => table-body + +* table1-header-row => table-header-row + +* table1-row => table-row + +* table1-cell => table-cell + +* cell1-block => cell-block + +* table2-block-container => table-block-contanter + +* table2 => table + +* ... + +* table2-row => table-row + +* table2-cell => table-cell + +* cell2-block => cell-block + +* ... + +* table30-block-container => table-block-contanter + +* table30 => table + +* table30-header => table-header + +* table30-header-cell => table-header-cell + +* table30-header-block => table-header-block + +* table30-body => table-body + +* table30-header-row => table-header-row + +* table30-row => table-row + +* table30-cell => table-cell + +* cell30-block => cell-block + +Table Extended 2 (Borderless) +============================= + +Attribute sets for the Extended 2 (Borderless) Tables. + +Custom Tables +------------- + +:fo: See below + +:docutils: See below + +The table_extend2.xsl contains templates for the borderless +table. Each attribute set has has the same function as its +corresponding attribute set in the regular table, as documented +above. + +* borderless-table-block-container => table-block-contanter + +* borderless-table => table + +* borderless-table-header => table-header + +* borderless-table-header-cell => table-header-cell + +* borderless-table-header-block => table-header-block + +* borderless-table-body => table-body + +* borderless-table-header-row => table-header-row + +* borderless-table-row => table-row + +* borderless-table-cell => table-cell + +* borderless-cell-block => cell-block + +Table Long +========== + +Attribute sets for the Long Tables. + +Long Tables +----------- + +:fo: See below + +:docutils: See below + +The table_long.xsl contains templates for a long table. Each +attribute set has has the same function as its corresponding +attribute set in the regular table, as documented above. There is +no block-container attriute set, because there is no +block-container element; the caption is rendered as part of the +header or footer. + +* long-table => table + +* long-table-header => table-header + +* long-table-header-row => table-header-row + +* long-thead-cell => thead-cell + +* long-table-header-block => table-header-block + +* long-table-body => table-body + +* long-table-header-row => table-header-row + +* long-table-row => table-row + +* long-table-cell => table-cell + +* long-cell-block => cell-block + +* long-caption-block => caption-block + +Footnote +======== + +Attribute sets for footnotes, endnotes, and the endnotes title. + +footnote +-------- + +:fo: fo:footnote + +:docutils: footnote + +:defaults: + + font-weight: normal + + font-style: normal + +Formats the footnote. By default, it sets properties to neutral, +so that it does not inherit any unwanted properties, such as from +a definition term. + +default-footnote-label-inline +----------------------------- + +:fo: fo:inline + +:docutils: None + +:defaults: + + baseline-shift: super + + font-size: 8pt + +Sets of the defaults for the label (1, \*, etc), of each label. + +footnote-label-inline +--------------------- + +:fo: fo:inline + +:docutils: footnote/paragraph[1] + +:inherits: default-footnote-label-inline + +:defaults: + +Formats the label for *traditional* footnotes and endnotes at the +bottomm of the page or with the endnotes. This attribute set +does not affect the label for footnotes and endnotes formatted as +a list. + +footnote-body-label-inline +-------------------------- + +:fo: fo:inline + +:docutils: footnote/paragraph[1] + +:inherits: default-footnote-label-inline + +:defaults: + +Formats the label for *traditional* footnotes and endnotes in the +body of the text. This attribute set does not affect the label +for footnotes and endnotes formatted as a list. + +footnote-list-block +------------------- + +:fo: fo:list-block + +:docutils: footnote + +:defaults: + + provisional-label-separation: 0pt + + provisional-distance-between-starts: 18pt + +Formats the list that contains the footnote. The +'provisional-distance-between-starts' controls how far away the +footnote label is from the text. + +footnote-item-label +------------------- + +:fo: fo:list-item-label + +:docutils: footnote + +:defaults: + + end-indent: label-end() + +Formats the item-label when the footnote or endnote is formatted +as a list. + +footnote-label-block +-------------------- + +:fo: fo:block + +:docutils: footnote_reference + +:defaults: + +Formats the block in item-label when the footnote or endnote is +formatted as a list. By default, the label has no superscript (as +opposed to when formatting a "traditional" footnote. + +footnote-item-body +------------------ + +:fo: fo:list-item-body + +:docutils: footnote + +:defaults: + + start-indent: body-start() + +Formats the item-body when the footnote or endnote is formatted +as a list. + +footnote-body +------------- + +:fo: fo:footnote-body + +:docutils: footnote + +:defaults: + +Formats the body of the footnote. Space-after and space-before +seem to have no affect, at least with fop. + +footnote-paragraph-block +------------------------ + +:fo: fo:block + +:docutils: footnote/paragraph + +:defaults: + + space-before: 5pt + +Formats the paragraphs in the body of a footnote or endnote. Use +the 'space-before' to set the space between each paragraphs, for +footnotes or endnotes with multiple paragraphs. In addition, for +traditional footnotes, use the 'text-indent="18pt" to create a +traditional footnote. (The deault does not do this, in order to +accommodate the footnote-as-a-list.) + +footnote-first-paragraph-block +------------------------------ + +:fo: fo:block + +:docutils: footnote/paragraph[1] + +:inherits: footnote-paragraph-block + +:defaults: + + space-before: 0pt + +Formats the first paragraphs in the body of a footnote or +endnote. It inherits all the attributes from the +'footnote-paragraphs-block' and sets the space-before to 0. It +does not make sense to change attributes on this block directly. + +endnotes-block +-------------- + +:fo: fo:block + +:docutils: footnote + +:defaults: + + break-before: page + +The block that wraps all the other blocks of the endnotes. Use to +create a page break before, or to create space before and after +the endnotes. + +endnote-block +------------- + +:fo: fo:block + +:docutils: footnote + +:defaults: + + space-before: 5pt + +The block that wraps each individual endnote ('footnote' in +docutils). Use to control the spacing between each endnote. + +endnote-first-block +------------------- + +:fo: fo:block + +:docutils: footnote + +:inherits: endnote-block + +:defaults: + + space-before: 0pt + +The block that wraps each the first endnote ('footnote' in +docutils). It does not make sense to change attributes on this +set directly. + +endnotes-title-block +-------------------- + +:fo: fo:block + +:docutils: rubric[@classes='endnotes'] + +:defaults: + + space-after: 18pt + + font-weight: bold + + font-size: 18pt + + text-align: center + +Formats the title for the endnotes, when one is present. + +Admonitions +=========== + +Attribute sets for Admonitions. By default, the admontioins have +a border around them. Each admonition gets its title from the +parameter of that name. For example, the danger admonitions title +gets its title from the 'danger-title' parameter, the caution +from the `caution-title` paramter, and so fourth. + +Although each admonition and each admonition title has its own +attribute-set, by default they all inherit these values from two +default attribute sets. (See below.) Each of these areas can thus +be customized. In contrast, all the paragrahs in each admonition +are identical. + +default-admonition-outer-block +------------------------------ + +:fo: block + +:docutils: None + +:defaults: + + border-style: solid + + border-width: 1px + + padding: 6pt + + keep-together.within-page: always + +Sets up the defaults for the outer blocks of all the admonitions. +The attributes of this block control the borders and prohibit +the admonition from breaking across a page. + +default-admonition-title-block +------------------------------ + +:fo: block + +:docutils: None + +:defaults: + + space-after: 10pt + + font-size: larger + + color: red + +Sets up the defaults for the title blocks of all the admonitions. +The attributes of this block control the color (red) and font +size. For certain blocs, the color is set to black (see below). + +admonitions outer block +----------------------- + +:fo: fo:block + +:docutils: attention | caution | danger | error | hint | + important | note | tip | warning | + admonitons[@classes='custorm'] + +:inherits: default-admonition-outer-block + +The following attribute sets are identical in nature: + +* attention-block + +* caution-block + +* danger-block + +* error-block + +* hint-block + +* important-block + +* note-block + +* tip-block + +* warning-block + +* admonition-custom-block + +These attribute-sets format the outer block of all the +admonitions. By default it puts an border around the text. Use +this attribute set to set the space before or after, the +background color, etc. + +admonitions title block +----------------------- + +:fo: fo:block + +:docutils: attention | caution | danger | error | hint | + important | note | tip | warning | + admonitons[@classes='custorm'] + +:inherits: default-admonition-title-block + +The following attribute sets are identical in nature: + +* attention-title-block + +* caution-title-block + +* danger-title-block + +* error-title-block + +* hint-title-block + +* important-title-block + +* note-title-block + +* tip-title-block + +* warning-title-block + +* admonition-custom-title-block + +These attribute-sets format the title block of all the +admonitions. It sets the color to red. + +The attribute-sets ``error-title-block``, ``hint-title-block``, +``important-title-block``, ``note-title-block``, +``tip-title-block``, and ``admonition-custom-title-block`` resets +the color back to black. + +admonition-paragraph-block +-------------------------- + +:fo: fo:block + +:docutils: attention/paragraph|caution/paragraph|etc. + +:defaults: + + space-before: 12pt + +Formats the paragraphs in the admonitions. A different +attribute-set formats the first paragraph (see below). + +admonition-first-paragraph-block +-------------------------------- + +:fo: fo:block + +:docutils: attention/paragraph[1]|caution/paragraph[1]|etc. + +:defaults: + +Formats the first paragraphs in the admonitions. It inherits its +attributes from the ``admonition-paragraph-block`` and resets the +``space-before`` property to ``0pt``. It does not make sense to +modify the attributes in this set directly. + +Image and Figure +================ + +Attribute sets for Images and Figures. The image property of +``alt`` and ``target`` are ignored by the stylesheets, since they +have no use in PDF. In addtion, if the ``align`` is set to +``top`` or ``bottom``, both properties that have no meaning for +PDF, the stylesheets will report an error, and if ``strict`` is +set to ``true``, quit. + +Likwise, the figure ``figwidth`` property will be ignored, since +there is not way to implement this property directy in FO. + +In order to control the scaling, alignment, and width of images +and figures, it is better to use the attribute sets than to try +to set these properties in RST. The regions of 'image', 'figure', +'caption', and 'legend' are all wrapped in blocks. Use the +attribute sets for these blocks to control the properties. + +figure-block +------------ + +:fo: fo:block + +:docutils: figure + +:defaults: + +Formats the block that wraps the figure. Use this attribute set +to set properties on the image, caption, and legend, as well as +to set the space before and after the figure. + +image-block +----------- + +:fo: fo:block + +:docutils: image + +:defaults: + +Formats the block that wraps the image, both for an image by +itself, and for an image included in a figure. Use this attribute +set to control the space before and after the image, as well as +to align the image itself. + +figure-caption-block +-------------------- + +:fo: fo:block + +:docutils: figure/caption + +:defaults: + + space-before: 12pt + + space-after: 12pt + + font-weight: bold + + font-size: smaller + + text-align: center + +Formats the block that wraps the caption. + +figure-legend-block +------------------- + +:fo: fo:block + +:docutils: figure/legend + +:defaults: + + space-before: 12pt + + space-after: 12pt + +Formats the block that wraps the legend. The paragrahs in the +legend have their own blocks. + +legend-paragraph-block +---------------------- + +:fo: fo:block + +:docutils: figure/legend/paragaph + +:defaults: + + space-before: 12pt + +Formats the block that wraps the paragraphs in the legend. + +legend-first-paragraph-block +---------------------------- + +:fo: fo:block + +:docutils: figure/legend/paragaph[1] + +:inherits: legend-paragraph-block + +:defaults: + + space-before: 0pt + +Formats the first block that wraps the paragraphs in the legend. + +Body Elements Directives +======================== + +Attribute sets for Body Elements Directives. + +topic-block +----------- + +:fo: fo:block + +:docutils: topic + +:defaults: + + space-after: 12pt + + space-before: 12pt + +Formats the outermost block of the topic element, which contains +blocks. + +topic-title-block +----------------- + +:fo: fo:block + +:docutils: topic/title + +:defaults: + + font-weight: bold + + space-after: 12pt + +Formats the title of the topic. + +topic-paragraph-block +--------------------- + +:fo: fo:block + +:docutils: topic/paragraph + +:defaults: + + space-before: 12pt + + space-after: 0pt + +Formats the paragraphs of the topic. A different set of +attributes formats the first paragraph. + +topic-first-paragraph-block +--------------------------- + +:fo: fo:block + +:docutils: topic/paragraph[1] + +:inherits: topic-paragraph-block + +:defaults: + +Formats the first paragraphs of the topic. + +sidebar-block +------------- + +:fo: fo:block + +:docutils: sidebar + +:defaults: + + space-after: 12pt + + space-before: 12pt + + background-color: #FFFFF0 + + padding: 6pt + + start-indent: 10mm + + end-indent: 40mm + +Formats the outermost block of the sidebar element, which +contains blocks. Note that fop does not handle floats, so this +element is formatted just like a topic block. + +sidebar-title-block +------------------- + +:fo: fo:block + +:docutils: sidebar/title + +:defaults: + + font-weight: bold + + space-after: 12pt + +Formats the title of the topic. + +sidebar-subtitle-block +---------------------- + +:fo: fo:block + +:docutils: sidebar/subtitle + +:defaults: + + font-weight: bold + + space-after: 12pt + +Formats the subtitle of the topic. + +sidebar-paragraph-block +----------------------- + +:fo: fo:block + +:docutils: sidebar/paragraph + +:defaults: + + space-before: 12pt + +Formats the paragraphs of the sidebar. A different set of +attributes formats the first paragraph. + +sidebar-first-paragraph-block +----------------------------- + +:fo: fo:block + +:docutils: sidebar/paragraph[1] + +:inherits: sidebar-paragraph-block + +:defaults: + + space-after: 0pt + +Formats the first paragraphs of the sidebar. + +rubric-block +------------ + +:fo: fo:block + +:docutils: rubric + +:defaults: + + text-align: center + + font-size: larger + + color: red + +Formats the rubric. + +epigraph-outer-block +-------------------- + +:fo: fo:block + +:docutils: epigraph + +:defaults: + + start-indent: 20mm + + end-indent: 20mm + + space-after: 12pt + + space-before: 12pt + + text-align: right + + font-style: italic + +Formats the outermost block of the epigraph element, which +contains blocks. + +epigraph-paragraph-block +------------------------ + +:fo: fo:block + +:docutils: epigraph/paragraph + +:defaults: + + start-indent: inherit + + end-indent: inherit + + space-before: 12pt + +Formats the paragraphs of the epigraph. A different set of +attributes formats the first paragraph. + +epigraph-first-paragraph-block +------------------------------ + +:fo: fo:block + +:docutils: epigraph/paragraph[1] + +:inherits: epigraph-paragraph-block + +:defaults: + + space-before: 0pt + +Formats the first paragraphs of the epigraph. + +epigraph-attribution-block +-------------------------- + +:fo: fo:block + +:docutils: epigraph/attribution + +:defaults: + + text-align: right + +Formats the attribution of the epigraph. The parameter +``text-before-epigraph-attribution`` determines the text to put +before the attribtion. The default is '—' (an em-dash). To put no +text before, set this parameter to an empty string. + +highlights-outer-block +---------------------- + +:fo: fo:block + +:docutils: highlights + +:defaults: + + start-indent: 20mm + + end-indent: 20mm + + space-after: 12pt + + space-before: 12pt + +Formats the outermost block of the epigraph element, which +contains blocks. + +highlights-paragraph-block +-------------------------- + +:fo: fo:block + +:docutils: highlights/paragraph + +:defaults: + + start-indent: inherit + + end-indent: inherit + + space-before: 12pt + +Formats the paragraphs of the highlights. A different set of +attributes formats the first paragraph. + +highlights-first-paragraph-block +-------------------------------- + +:fo: fo:block + +:docutils: highlights/paragraph[1] + +:inherits: highlights-paragraph-block + +:defaults: + + space-before: 0pt + +Formats the first paragraphs of the highlights. + +pull-quote-outer-block +---------------------- + +:fo: fo:block + +:docutils: pull-quote + +:defaults: + + start-indent: 20mm + + end-indent: 20mm + + space-after: 12pt + + space-before: 12pt + +Formats the outermost block of the pull-quote element, which +contains blocks. + +pull-quote-paragraph-block +-------------------------- + +:fo: fo:block + +:docutils: pull-quote/paragraph + +:defaults: + + start-indent: inherit + + end-indent: inherit + + space-before: 12pt + +Formats the paragraphs of the pull-quote. A different set of +attributes formats the first paragraph. + +pull-quote-first-paragraph-block +-------------------------------- + +:fo: fo:block + +:docutils: pull-quote/paragraph[1] + +:inherits: pull-quote-paragraph-block + +:defaults: + + space-before: 0pt + +Formats the first paragraphs of the pull-quote. + +pull-quote-attribution-block +---------------------------- + +:fo: fo:block + +:docutils: pull-quote/attribution + +:defaults: + + text-align: right + +Formats the attribution of the pull-quote. The parameter +``text-before-pull-quote-attribution`` determines the text to put +before the attribtion. The default is '—' (an em-dash). To put +no text before, set this parameter to an empty string. + +container-outer-block +--------------------- + +:fo: fo:block + +:docutils: container + +:defaults: + + space-after: 12pt + + space-before: 12pt + +Formats the outermost block of the container element, which +contains blocks. + +container-paragraph-block +------------------------- + +:fo: fo:block + +:docutils: container/paragraph + +:defaults: + + space-before: 12pt + +Formats the paragraphs of the container. A different set of +attributes formats the first paragraph. + +container-first-paragraph-block +------------------------------- + +:fo: fo:block + +:docutils: container/paragraph[1] + +:inherits: container-paragraph-block + +:defaults: + + space-before: 0pt + +Formats the first paragraphs of the container. + +Inline +====== + +Attribute sets for all the inline elements. The parameter +'footnote-style' controls the style of the footnote. The +paramater 'footnote-placement' determines whether the footnotes +that are numbered will be placed as footnotes or endnotes. + +The parameter 'space-between-foototes' controls the space between +footnotes. (Becuase of a flaw(?) in FOP, an attribute set could +not be used.) This parameter has no effect on the space between +endnotes. + +emphasis-inline +--------------- + +:fo: fo:inline + +:docutils: emphasis + +:defaults: + + font-style: italic + +Formats the emphasis element. + +strong-inline +------------- + +:fo: fo:inline + +:docutils: strong + +:defaults: + + font-weight: bold + +Formats the strong element. + +basic-link-inline +----------------- + +:fo: fo:inline + +:docutils: basic_link + +:defaults: + + text-decoration: underline + + color: blue + +Formats the basic_link element. + +literal-inline +-------------- + +:fo: fo:inline + +:docutils: literal + +:defaults: + + font-family: monospace + + font-size: 8 + + white-space: pre + +Formats the literal element. + +title-reference-inline +---------------------- + +:fo: fo:inline + +:docutils: title-reference + +:defaults: + + font-style: italic + +Formats the title_reference element. + diff --git a/sandbox/paultremblay/python_interface/docs/rst/howto.rst b/sandbox/paultremblay/python_interface/docs/rst/howto.rst new file mode 100644 index 000000000..e7fa31e5f --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/rst/howto.rst @@ -0,0 +1,2220 @@ +^^^^^^^^^^^^^^^^^^^^^^^^ +HOWTO: Docutils2fo 0.6 +^^^^^^^^^^^^^^^^^^^^^^^^ + +.. $Id$ + +.. contents:: + +================ +Convert to XML +================ + +Use the rst2xml.py script, and pass the the ``'--strip-comments'`` and +``'--trim-footnote-reference-space'`` options:: + + rst2xml.py --strip-comments --trim-footnote-reference-space my_file.rst > my_file.xml + +================ +Convert to FO +================ + +Use the docutils_to_fo.py script:: + + docutils_to_fo.py my_file.xml > my_file.fo + +Use the ``'--help'`` option to get options. + +Alternatively, you can convert from RST to FO in one step:: + + rst2xml.py --strip-comments --trim-footnote-reference-space my_file.rst | docutils_to_fo.py > my_file.fo + +================ +Convert to PDF +================ + +Use the fop processor, an open source Java application at http://xmlgraphics.apache.org/fop/. +In order to run in from a unix system:: + + fop my_file.fo my_file.pdf + +To convert from RST to PDF with one command:: + + rst2xml.py --strip-comments --trim-footnote-reference-space my_file.rst\ + | docutils_to_fo.py | fop -fo - my_file.pdf + +=================== +Format a Document +=================== + +1. Create a config file that with a section and instructions (as explained + below):: + + [FO] + + paragraph.space-before = 12pt + + +2. Enable the ``'docutils_to_fo'`` script to read the config file. Either pass + the ``'--config'`` option:: + + docutils_to_fo.py --config my_config_file my_file.xml > my_file.fo + + or put this file where the script automatically reads it, either in + ``./docutils.conf``, or ``~/home/.docutils``. + +Unless otherwise noted, the rest of this document refers to creating the +config file. + +================== +Create a Command +================== + +Commands consist of instructions without a period in them. The following +sets ``'strict'`` = ``'True'``, making the processing quit when an error is +encountered:: + + strict = True + + + +================================ +Create a Formatting Instruction +================================ + +Formatting instructions consist of 3 parts: the region to be formatted, +followed by a period; the formatting property, followed by an equal sign; and +the value of the property. The following command sets the space before plain +paragrahs to 12pt:: + + paragraph.space-before = 12pt + +.. tip:: + + You can use the config file to pass commonly-used options of the + rst2xml.py command. Put these commands in the *general* section:: + + [general] + + strip_comments = true + trim-footnote-reference-space = true + + [FO] + paragraph.space-before = 12pt + + +============================== +General Formatting for Blocks +============================== + +Most of the regions in a docutils document consists of blocks. This is true of +the title, subtitle, section titles, paragrahs, block quotes, etc. All of thes +blocks can take the following properties: + +* space-before +* space-after +* first-line-indent +* font (the same as font-family) +* font-size +* font-style +* color (for the color of the text) +* backgroud-color +* left-indent +* right-indent +* border (for the boders around the block) +* line-spacing (for double space, for exampe) +* alignment +* keep-with-next (to keep the block from ending a page) +* keep-with-previous (to keep the block from starting a new page) +* keep-on-same-page (to prevent a block form splitting across a page) +* page-break-before (to create page breaks) +* page-break-after (to create page breaks) + +These properties are the most commonly used and have an easy-to-remember, +short name. In addition, one can use any of the valid FO properties, which can +be found, among other places, at http://www.w3schools.com/xslfo/obj_block.asp. +For example, ``'paragraph.border-before-color = red'`` specifies the color of the +border on the before-edge for plain paragraphs. + +============ +Page Layout +============ + +Paper Size +----------- + +:: + + paper-size.height = 11in + paper-size.width = 8.5in + +Margins +--------- +:: + + page.top-margin = .75in + page.bottom-margin = .75in + page.right-margin = .75in + page.left-margin = .75in + +Different Margins for Odd and Even Pages (if desired) +------------------------------------------------------ +:: + + odd-page.top-margin = 1in + odd-page.bottom-margin = 1in + odd-page.right-margin = 1in + odd-page.left-margin = 2in + + even-page.top-margin = 1in + even-page.bottom-margin = 1in + even-page.right-margin = 2in + even-page.left-margin = 1in + +Different Margins for the First Page (if desired) +--------------------------------------------------- +:: + + first-page.top-margin = 3in + first-page.bottom-margin = 1in + first-page.right-margin = .8in + first-page.left-margin = 2in + + +==================== +Headers and Footers +==================== + +Create a header +--------------- + +In the *document* (not the config file), use the following:: + + .. header:: + + A Christmas Carol + +The header will appear on every page, including any pages in the table +of contents section. + +Create a footer +--------------- + +In the *document* (not the config file), use the following:: + + .. footer:: + + Charles Dickens + +The footer will appear on every page, including any pages in the table +of contents section. + +Create a page number in a header or footer +-------------------------------------------- + +In the *document* (not the config file), use the following:: + + .. role:: page-num + + .. footer:: + + Charles Dickens. + + :page-num:`1` + +Page numbers will be generated automatically. + +Create space for a header or footer +------------------------------------ + +The defaults should create enough space for headers or footers. If you want to +change the defaults, use:: + + header.height = 1in + footer.height = 1in + + +Create space between header and body text +------------------------------------------ + +:: + + header.space-before = .2in + +Create space between footer and body text +------------------------------------------ + +:: + + footer.space-before = -.1in + +Format header and footer text +------------------------------ + +If your header or footer contains just one paragraphs, use the header or +footer region plus any block property:: + + header.color = blue + header.background-color = black + + +Create custom headers and footers for odd, even, etc. +-------------------------------------------------------- + +You can create different headers and footers for the following +regions: + +* first page of the body +* odd page of the body +* even page of the body +* first page of the table of contents section +* odd page of the table of contents section +* even page of the table of contents section + +These headers and footers can be formatted all at once, using the ``'header'`` +and ``'footer'`` identifiers. By default, these headers and footers are all +centered. However, each inidividua header and footer can be customized, as +shown below. + +Create a different header for the first and subsequent pages +------------------------------------------------------------- + +In the *document* set up the headers and footers:: + + + .. container:: first-header + + first header text + + .. container:: first-footer + + first footer text + + .. container:: body-header + + body header + + .. container:: body-footer + + body footer + +Use ``'first-header'``, ``'first-footer'``, ``'body-header'`` and +``'body-footer'`` to format these headers and footers:: + + body-header.color = red + body-footer.color = red + first-header.background-color = red + first-footer.background-color = red + +Create a different header for odd and even pages +------------------------------------------------- + +In the *document* set up the headers and footers:: + + + .. container:: odd-header + + odd header + + .. container:: odd-footer + + odd footer + + .. container:: even-header + + even header + + .. container:: even-footer + + even footer + +Use ``'odd-header'``, ``'odd-footer'``, ``'even-header'`` and +``'even-footer'`` to format these headers and footers:: + + odd-header.color = red + odd-footer.color = red + even-header.background-color = red + even-footer.background-color = red + +Create a different header for first, odd and even pages +-------------------------------------------------------- + +In the *document* set up the headers and footers:: + + .. container:: first-header + + first header text + + .. container:: first-footer + + first footer text + + .. container:: odd-header + + odd header + + .. container:: odd-footer + + odd footer + + .. container:: even-header + + even header + + .. container:: even-footer + + even footer + +Use ``'first-header'`` ``'first-footer'``, ``'odd-header'``, +``'odd-footer'``, ``'even-header'`` and ``'even-footer'`` to format +these headers and footers:: + + first-header.font-style = italic + first-footer.font-style = italic + odd-header.color = red + odd-footer.color = red + even-header.background-color = red + even-footer.background-color = red + +Suppress first page header or footer +-------------------------------------- + +For simple pages ++++++++++++++++++ + +Use the following method if you want the same headers and footers on +all pages except the first. In the *document* create headers and +footers for the body, but not for the first page:: + + .. container:: body-header + + body header + + .. container:: body-footer + + body footer + +For odd and even pages if using standard page margins ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Use the following method if (1) you wish to have different headers and +footers on odd and even pages, but no headers and footers on the first +page; and (2) you have the same margins for odd and even pages. + +1. First, tell the formatter you desire a first-odd-even layout. + (Without specifying this explicitly, the formatter will simply + think you want an odd-even layout.):: + + document.page-layout = first-odd-even + +2. Create odd and even headers, without creating any first headers + and footers:: + + .. container:: odd-header + + odd header + + .. container:: odd-footer + + odd footer + + .. container:: even-header + + even header + + .. container:: even-footer + + even footer + +For odd and even pages if using custom page margins ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Use the following method if (1) you wish to have different headers and +footers on odd and even pages, but no headers and footers on the first +page; and (2) you have different margins for odd and even pages. + +1. First, set the margins for the first page to that of the odd page. + (This step tells the formatter that set the page layout to + first-odd-even, the layout desired; and it makes sure the first, + odd page, is identical to the other odd pages.) + +:: + + first-page.top-margin = .75in + # etc. + +2. Create odd and even headers, without creating any first headers + and footers:: + + .. container:: odd-header + + odd header + + .. container:: odd-footer + + odd footer + + .. container:: even-header + + even header + + .. container:: even-footer + + even footer + + +Create a different header for the first and subsequent pages for the TOC +------------------------------------------------------------------------- + +In the *document* set up the headers and footers:: + + + .. container:: toc-first-header + + First header + + .. container:: toc-first-footer + + First footer + + .. container:: toc-body-header + + Body header + + .. container:: toc-body-footer + + Body footer + + +Use ``'toc-first-header'``, ``'toc-first-footer'``, ``'toc-body-header'`` and +``'toc-body-footer'`` to format these headers and footers:: + + toc-body-header.color = red + toc-body-footer.color = red + toc-first-header.background-color = red + toc-first-footer.background-color = red + +Create a different header for odd and even pages for the TOC +-------------------------------------------------------------- + +In the *document* set up the headers and footers:: + + + .. container:: toc-odd-header + + odd header + + .. container:: toc-odd-footer + + odd footer + + .. container:: toc-even-header + + even header + + .. container:: toc-even-footer + + even footer + +Use ``'toc-odd-header'``, ``'toc-odd-footer'``, ``'toc-even-header'`` and +``'toc-even-footer'`` to format these headers and footers:: + + toc-odd-header.color = red + toc-odd-footer.color = red + toc-even-header.background-color = red + toc-even-footer.background-color = red + +Create a different header for first, odd and even pages for the TOC +-------------------------------------------------------------------- + +In the *document* set up the headers and footers:: + + .. container:: toc-first-header + + first header text + + .. container:: toc-first-footer + + first footer text + + .. container:: toc-odd-header + + odd header + + .. container:: toc-odd-footer + + odd footer + + .. container:: toc-even-header + + even header + + .. container:: toc-even-footer + + even footer + +Use ``'toc-first-header'`` ``'toc-first-footer'``, ``'toc-odd-header'``, +``'toc-odd-footer'``, ``'toc-even-header'`` and ``'toc-even-footer'`` to format +these headers and footers:: + + toc-first-header.font-style = italic + toc-first-footer.font-style = italic + toc-odd-header.color = red + toc-odd-footer.color = red + toc-even-header.background-color = red + toc-even-footer.background-color = red + +Suppress first page header or footer for the TOC +------------------------------------------------- + +Follow the same procedures as for the body. To supress the header and +footer when the headers and footers are otherwise the same for all +pages, create body headers and footers for the toc, but not for the +first page:: + + .. container:: toc-body-header + + Body header + +To suppress when using different headers and footers for odd and even +pages, set up the odd and even headers/footers, and then signal to the +formatter that you wish for a first-odd-even layout, either through +the ``'document.page-layout'`` property, or by setting margins for the +first page. + + +Formatting the paragraphs in headers and footers +-------------------------------------------------- + +Use the header-paragraph and footer-paragraph to format paragraphs:: + + header-paragraph.font-style = bold + footer-paragraph.font-style = italic + + +================ +Non Body Matter +================ + +Non Body matter refers to the document title and subtitle; the +bibliographic fields; the dedication; the abstract; and the table of +contents. + +Each such matter can be put in the front part, the toc (table of +contents) part, or the body part. + +The front part of a document occurrs first and has not headers or +footers. The toc part occurrs next, generally starts with page 1 +(thought this can be changed), and page numberas are formamtted with +Roman numberals (though this can be changed.) + +The body part is part of any document. It generally starts with page 1 +(though this can be changed) and page numbers are formatted with +Arabic numbers (though this can be changed). + +Placing the title/subtitle +--------------------------- + +With the front part (default) ++++++++++++++++++++++++++++++++ + +:: + + title-subtitle.placement = with-front + +With the toc part +++++++++++++++++++ + +:: + + title-subtitle.placement = with-toc + +With the body part ++++++++++++++++++++ + +:: + + title-subtitle.placement = with-body + +Placing the bibliograph fields +------------------------------- + +With the front part +++++++++++++++++++++ + +:: + + bibliographic-fields.placement = with-front + +With the toc part (default) +++++++++++++++++++++++++++++ + +:: + + bibliographic-fields.placement = with-toc + +With the body part ++++++++++++++++++++ + +:: + + bibliographic-fields.placement = with-body + +Placing the dedication +----------------------- + +With the front part +++++++++++++++++++++ + +:: + + dedication.placement = with-front + +With the toc part (default) +++++++++++++++++++++++++++++ + +:: + + dedication.placement = with-toc + +With the body part ++++++++++++++++++++ + +:: + + dedication.placement = with-body + +Placing the abstract +----------------------- + +With the front part (default) +++++++++++++++++++++++++++++++ + +:: + + abstract.placement = with-front + +With the toc part +++++++++++++++++++ + +:: + + abstract.placement = with-toc + +With the body part ++++++++++++++++++++ + +:: + + abstract.placement = with-body + +Placing the toc +---------------- + +With the front part +++++++++++++++++++++ + +:: + + toc.placement = with-front + +With the toc part +++++++++++++++++++ + +:: + + toc.placement = with-toc + +With the body part ++++++++++++++++++++ + +:: + + toc.placement = with-body + +Changing the order of non-body matter +--------------------------------------- + +By default, docutils to fo places the non-body matter in the order it +occurrs in the docutils XML document (which may be different than the +RST document). This order is title/subtitle, bibliographic, +dedication, and table of contents. To change this order, use the +``'front.order'`` property. Its value is a list of the non-body order +areas in the order you wish it to occurr, speparated by commas:: + + # changes the order of the abstract and the bibliographic fields + front.order = title, abstract, dedication, toc, bibliographic + +Changing the starting page number +---------------------------------- + +In order to change the starting page number of a toc section or body +section, use the ``'toc-section.start-page'`` or +``'body-section.start-page'`` properties:: + + # toc now start on page 3 + toc-section.start-page = 3 + # body starts on page 15 + body-section.start-page = 15 + +Changing the format of the page number +---------------------------------------- + +In order to change the formatting of the page numbers, use the +``'toc-section.page-format'`` and ``'body-section.page-format'``:: + + # upper case Roman numberals + toc-section.page-format = I + # upper case letters + body-section.page-format = A + +Formatting the title/subtitle +------------------------------ + +Use the property ``'title-subtitle'`` to format both the title and +subtitle. Use the property ``'title'`` to format just the title. Use the +property ``'subtitle'`` to format just the subtitle. All of these +properites are block properties, and can take any of the +properites of a block (see paragraph):: + + # center the title an subtitle + title-subtitle.alignment = center + # format the title + title.font-size = 24pt + # format the subtitle + subtitle.font-size = 18pt + +To create space before a title/subtitle, and to put the title/subtitle +on their own page:: + + title-subtitle.page-break-before= true + title-subtitle.space-before=3in + +=================================== +Formatting the bibliograhic fields +=================================== + +Formatting as a list +--------------------- + +By defaullt, bibliographic fields are formatted as a list. Use the +``'bibliograhic-fields'`` property to format the space after and before, the +left and right indent, and any other property you want to set on the list, +such as font for font-size:: + + bibliographic-fields.space-after = 20pt + bibliographic-fields.space-before = 20pt + bibliographic-fields.left-indent = 20pt + bibliographic-fields.right-indent = 20pt + bibliographic-fields.background-color = grey + +Putting the bibliographic fields on its own page +++++++++++++++++++++++++++++++++++++++++++++++++++ + +:: + + bibliographic-fields.page-break-before = true + # or, depending on your layout + bibliographic-fields.page-break-after = true + + +To format space between items +++++++++++++++++++++++++++++++ + +Use the ``'space-between-items'`` property. + +:: + + + bibliographic-fields.space-between-items = 30pt + +To format space between field and text ++++++++++++++++++++++++++++++++++++++++ + +The ``'space-from-fields'`` works exactly as the ``'space-from-bullet''``: both +properties control the spacing from the list label and the text. + +:: + + bibliographic-fields.space-from-field = 3in + +Formatting the field +++++++++++++++++++++++ + +Use the ``'bibliographic-field'`` property, and apply any block properties. +Note the slight, one letter difference between ``'bibliographic-fields``, which +formats the entire list, and ``'bibliographic-field'`` which formats just the +field:: + + # change default font to normal + bibliographic-field.font-style = normal + +Changing the default text of the fields ++++++++++++++++++++++++++++++++++++++++++ + +By default, the docutils to FO converter gives expected names to each of the +bibliographic fields. If you wish to change the name, use the +``'bibliographic-fields.<fieldname-text>`` property:: + + # change all the fields from the default to lower case + bibliographic-fields.author-text = author + bibliographic-fields.authors-text = authors + bibliographic-fields.organization-text = organization + # change 'contact' to 'email' + bibliographic-fields.contact-text = email + bibliographic-fields.status-text = status + bibliographic-fields.copyright-text = copyright + bibliographic-fields.address-text = address + bibliographic-fields.revision-text = revision + bibliographic-fields.date-text = date + +Formatting the text of the field ++++++++++++++++++++++++++++++++++++ + +Use the ``'bibliographic-fields-text'`` identifier:: + + bibliographic-fields-text.font-weight=bold + +Formatting the text for individual paragraphs ++++++++++++++++++++++++++++++++++++++++++++++ + +For fields that have more than one paragraph, use the ``'bibliographic-fields-paragraph'`` +identifier. This identifier can take any block property:: + + bibliographic-fields-paragraph.space-before = 12pt + +Note that using the ``'space-before'`` property has the same effect as +controlling the space between each paragraph, without putting unwated space +before the first paragraph. + +Formatting as blocks of text +----------------------------- + +Use ``'the bibliographic-fields.format'`` to change the value of the default +format:: + + bibliographic-fields.format = normal + +Formatting the author field, etc. +---------------------------------- + +Each bibliographic field is a block, and its identifier is the name of the +field . + +:address: formats the address field +:author: formats the author field +:authors: formats the authors field +:contact: formats the contact field +:copyright: formats the copyright field +:date: formats the date field +:organization: formats the organization field +:revision: formats the revision field +:status: formats the status field +:version: formats the version field + +:: + + address.space-before=24pt + author.font-style = bold + authors.alignment = center + contact.font-style = italic + copyright.color = red + date.background-color = blue + organization.font-size = 24pt + revision.alignment = center + status.alignment = right + version.font-style = bold-italic + + +Formatting custom bibliographic fields +---------------------------------------- + +Use the ``'bibliographic-fields-custom1'``, +``'bibliographic-fields-custom2'``, etc, to format each custom field, where +``'-custom1'`` refers to the first occurrence of a custom field, +''`-custom2'`` refers to the second such occurrence, and so on:: + + bibliographic-field-custom1.color = green + bibliographic-field-custom2.color = red + +Changing the default text of the fields ++++++++++++++++++++++++++++++++++++++++++ + +As when the bibliiographic fields are formatted as a list, the text of the +fields can likewise be changed in the same manner when formatting the +bibliographic fields as blocks. It often makes sense to makes these fields +empty, especially when creating title page:: + + bibliographic-fields.author-text = by + bibliographic-fields.date-text = + +Including text for custom fields ++++++++++++++++++++++++++++++++++ + +Use the ``'bibliographic-field-custom#.text'`` property:: + + bibliographic-field-custom1.text = Country + bibliographic-field-custom2.text = Uses of software: + +Making a Title Page +-------------------- + +Here is the actual RST document:: + + ====== + Title + ====== + + Subtitle + ========= + + + :by: by + :Author: Paul Tremblay + :Address: Paul Tremblay + 100 Market St. + Boston, MA, 01800 + + :Country: USA + :Organization: Open Source Software + :useline: Uses + :Uses: text processing + + documentation + :Date: $Date$ + :Copyright: This document is in the public domain + + Text after. + +Here is the configuration file:: + + [general] + trim-footnote-reference-space = true + [FO] + bibliographic-fields.format = normal + + # the by line by itself + bibliographic-field-custom1.space-after = 12pt + bibliographic-field-custom1.alignment = center + + # the line with 'usline' + bibliographic-field-custom3.space-after = 0pt + bibliographic-field-custom3.font-style = bold + + # the Uses field + bibliographic-field-custom4.space-before = 0pt + + # center align author + author.alignment = center + author.font-size = 16pt + # put a border after the title + author.border-bottom = 2px solid + author.padding = 6pt + + # put a borer after copyright + copyright.border-bottom = 2px solid + copyright.padding = 6pt + + + + # set the default text to nothing + bibliographic-fields.author-text = + bibliographic-fields.authors-text = + bibliographic-fields.organization-text = + bibliographic-fields.copyright-text = + bibliographic-fields.address-text = + bibliographic-fields.date-text = + + # commands + strict = True + + +Formatting the dedication +-------------------------- + +Creating a dedication ++++++++++++++++++++++++ + +:: + + :Dedication: I dedicate this thesis to my good friend John, who + stood by me for many years while I struggled ... + +Putting dedication on its own page +++++++++++++++++++++++++++++++++++++++++++++++++++ + +:: + + dedication.page-break-before = true + # or, depending on your layout + dedication.page-break-after = true + +Formatting the title ++++++++++++++++++++++++ + +Use the ``'dedication-title'`` identifier, which can take any block property:: + + dedication-title.alignment = center + dedication-title.font-size = 24pt + +Formatting the paragraphs +++++++++++++++++++++++++++ + +Use the ``'dedication-paragraph'`` identifier, which can take any block property:: + + dedication-paragraph.font-size = 10pt + dedication-paragraph.alignment = right + dedication-paragraph.font-style = italic + + +Formatting the abstract +-------------------------- + +Creating a abstract ++++++++++++++++++++++++ + +:: + + + :Abstract: Just an example of bibliograhic fields. + This continues on. + +Putting abstract on its own page +++++++++++++++++++++++++++++++++++++++++++++++++++ + +:: + + abstract.page-break-before = true + # or, depending on your layout + abstract.page-break-after = true + +Formatting the title ++++++++++++++++++++++++ + +Use the ``'abstract-title'`` identifier, which can take any block property:: + + abstract-title.alignment = center + abstract-title.font-size = 24pt + +Formatting the paragraphs +++++++++++++++++++++++++++ + +Use the ``'abstract-paragraph'`` identifier, which can take any block property:: + + abstract-paragraph.font-size = 10pt + abstract-paragraph.alignment = right + abstract-paragraph.font-style = italic + + +Formatting the toc +-------------------------- + +Creating a toc ++++++++++++++++++++++++ + +:: + + .. contents:: Table of Contents + +Putting toc on its own page +++++++++++++++++++++++++++++++++++++++++++++++++++ + +:: + + toc.page-break-before = true + # or, depending on your layout + toc.page-break-after = true + +Formatting the title ++++++++++++++++++++++++ + +Use the ``'toc-title'`` identifier, which can take any block property:: + + toc-title.alignment = center + toc-title.font-size = 24pt + +Setting the defaults on each entry +++++++++++++++++++++++++++++++++++++ + +Use the ``'toc-default'`` to set properties for all of the toc entries +at once:: + + + # sets space between entries to 12pt + toc-default.space-after = 12pt + + +Formatting the entries +++++++++++++++++++++++++++ + +Use the identifierst ``'toc-entry1'``, ``'toc-entry2'``, etc. +which can take any block property:: + + # increase indents by 10mm + toc-entry1.left-indent = 10mm + toc-entry2.left-indent = 20mm + toc-entry3.left-indent = 30mm + toc-entry4.left-indent = 40mm + toc-entry5.left-indent = 50mm + + +Format the toc numbers ++++++++++++++++++++++++ + +The format of the numbers for toc entry takes the same format as the +section numbers. See section numbers. + +========= +Sections +========= + +Creating sections +------------------ + +Sections are identified through their titles, which are marked up with +adornment: "underlines" below the title text, or underlines and matching +"overlines" above the title. + + +Here are some examples:: + + =============== + Heading1 Title + =============== + + --------------- + Heading2 Title + --------------- + + Heading3 Title + ============= + + Heading4 Title + ------------- + + Heading5 Title + ````````````` + + Heading6 Title + ''''''''''''' + + Heading7 Title + ............. + +Any combination of valid adornments can be used. The rst2xml.py utility +recognizes the first such example as the main section, the next such example +as the sub section, and so on. + +See the http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#sections. + + +Formatting titles +------------------- + +Use the identifiers ``'heading1'``, ``'heading2'``, ``'heading3'``, etc, to +format the titles for each section. Docutils to fo allows sections to go 7 +levels deep. Headings are blocks and can take any property of a block (see +paragrahs). + +:: + + heading1.font-size = 30pt + heading1.font-style = bold + heading2.font-size = 24pt + # etc. + heading7.font-size = normal + heading7.font-style = bold + +Creating section numbers +------------------------- + +At the start of the document, put:: + + .. sectnum:: + +Formatting section numbers +--------------------------- + +Use the ``'heading#'`` identifier plus the ``'number-format'`` to format the +section numbers. The value for formatting can take a combination of +punctuation and numbers, letters, or Roman numberals + +:: + + # (I.), (II.), (III.), etc + heading1.number-format = (I.) + + # i.), ii.), etc + heading2.number-format = i.) + + # .1., .2., .3., etc + heading3.number-format = .1. + + # a, b, c, etc + heading4.number-format = a + + # A, B, C., etc + heading5.number-format = A + +.. Don't inherit section numbers +.. ------------------------------ +.. +.. By default, the numbers of each section inherit the numbers of the parent +.. section. to disable this formatting:: +.. +.. headings.inherit-sections-number = False + +============ +Transitions +============ + +Creating transitions +--------------------- + +To create a transition, in the *document* (not the config file), use +horizontal line of 4 or more repeated punctuation characters. + +:: + + + Para. + + ---------- + + Para. + +Changing the text of the transtion. +------------------------------------- + +The default transition text is a single paragraph of three asteristics. To +change the default, use the ``'transition.text'`` property:: + + # change to three hypens + transition.text = --- + # change to nothing + transition.text = + +Formatting the transition paragraph +------------------------------------ + +Use the ``'transition'`` identifier to format the paragraph of the transition +text. This identifier can take any block property. + +:: + + transition.space-before = 24pt + transition.space-after = 24pt + # change the default alignment from center + transition.alignment = left + + +=========== +Paragraphs +=========== + +Space before or after paragraphs +--------------------------------- + +:: + + paragraph.space-before = 12pt + paragraph.space-after = 12pt + +Indent first line +------------------- + +:: + + paragraph.first-line-indent = 12pt + +Font Family +------------- + +:: + + paragraph.font = monospace + +Font Size +---------- + +:: + + paragraph.font-size = 12pt + +Font Style +----------- + +Set ``'font-style'`` to ``'bold'``, ``'italic'``, ``'bold-italic'``, +or ``'normal'``:: + + paragraph.font-style = bold-italic + +Color (font color) +------------------- + +:: + + paragraph.color = red + +Background color +------------------ + +:: + + paragraph.backgroud-color = red + +Left and right indent +---------------------- + +:: + + paragraph.left-indent = 12pt + paragraph.right-indent = 12pt + +Borders +--------- + +:: + + paragraph.border = solid black 1px + +Use ``'border-top'``, ``'border-bottom'``, ``'border-left'``, and +``'border-right'`` to set properties on specific borders:: + + # creates a bottom border + paragraph.border-bottom = solid black 1px + +Line spacing +-------------- + +:: + + # double spaces paragraphs + paragraph.line-spacing = 2 + +Alignment +----------- + +Use ``'alignment'`` to align text. Valid values are ``'left'``, +``'right'``, ``'center'``, and ``'justify'``. + +:: + + # center aligns text + paragraph.alignment = center + +Keep with previous text +------------------------- + +:: + + # paragrah won't start a new page + keep-with-previous = true + +Keep with next text +---------------------- + +:: + + # paragrah won't end the page + keep-with-next = true + +Keep from breaking across pages +--------------------------------- +:: + + keep-on-same-page = true + + +Page break before or after +---------------------------- + +:: + + paragraph.page-break-before = yes + paragraph.page-break-after = yes + + +No page break before or after +------------------------------- + +:: + + paragraph.page-break-after = no + paragraph.page-break-before = no + +Formatting for first paragrahs +-------------------------------- + +Docutils to FO allows first paragraphs to be formatted differently +from all others. First paragraphs refers to the first paragraphs after +a section of document, or the first paragaph after a list, code block, +admonition block, or table. British style dictates that such +paragraphs do not have their first line indented. + +:: + + #indents all but first paragraph 12pt + paragraph.first-line-indent = 12pt + first-paragraph.first-line-indent = 0pt + +============ +Bullet List +============ + + +Formatting the bullet list +---------------------------- + +Use the ``'bullet-list'`` property to format the space after and +before, the left and right indent, and any other property you want to +set on the list, such as font for font-size:: + + bullet-list.space-after = 20pt + bullet-list.space-before = 20pt + bullet-list.left-indent = 20pt + bullet-list.right-indent = 20pt + bullet-list.background-color = grey + + +To format space between items +------------------------------- + +Use the ``'space-between-items'`` property. + +:: + + + bullet-list.space-between-items = 30pt + +To format space between bullets and text +------------------------------------------- + +Use the ``'space-from-bullet'`` identifier:: + + + bullet-list.space-from-bullet = 1in + +Choosing the text for the bullet +----------------------------------- + +Use the ``'bullet-list.text'`` property to change the default bullet:: + + # change to hyphen + bullet-list.text = - + +If the ``'bullet-list.text'`` property is left empty, the converter +uses the text in the actual document:: + + # use the text in the document + bullet-list.text = + + +Formatting the paragraphs +---------------------------- + +Use the ``'bullet-list-paragraph'`` identifier to format the text of +the bullet list. This identifier can take any block property:: + + bullet-list-paragraph.space-before = 12pt + bullet-list-paragraph.font-style = italic + +Note that using the ``'space-before'`` property has the same effect as +controlling the space between each paragraph, without putting unwated space +before the first paragraph. + +Formatting nested bullet lists +------------------------------- + +Use the ``'bullet-list-level2'`` to format nested lists:: + + bullet-list-level2.space-before = 20pt + bullet-list-level2.left-indent = 40pt + bullet-list-level2.background-color = blue + bullet-list-level2.space-from-bullet = 1.5in + bullet-list-level2.text = † + bullet-list-level2.space-between-items = 50pt + + +================= +Enumerated List +================= + +Formatting the enumerated list +------------------------------- + +Use the ``'enumerated-list'`` property to format the space after and +before, the left and right indent, and any other property you want to +set on the list, such as font for font-size:: + + enumerated-list.space-after = 20pt + enumerated-list.space-before = 20pt + enumerated-list.left-indent = 20pt + enumerated-list.right-indent = 20pt + enumerated-list.background-color = grey + + +To format space between items +------------------------------- + +Use the ``'space-between-items'`` property. + +:: + + + enumerated-list.space-between-items = 30pt + +To format space between enumerateds and text +--------------------------------------------- + +Use the ``'space-from-number'`` identifier:: + + + enumerated-list.space-from-number = 1in + + +Formatting the paragraphs +--------------------------- + +Use the ``'enumerated-list-paragraph'`` identifier to format the text of +the enumerated list. This identifier can take any block property:: + + enumerated-list-paragraph.space-before = 12pt + enumerated-list-paragraph.font-style = italic + +Note that using the ``'space-before'`` property has the same effect as +controlling the space between each paragraph, without putting unwated space +before the first paragraph. + +Formatting nested enumerated lists +----------------------------------- + +Use the ``'enumerated-list-level2'`` to format nested lists:: + + enumerated-list-level2.space-before = 20pt + enumerated-list-level2.left-indent = 40pt + enumerated-list-level2.background-color = blue + enumerated-list-level2.space-from-number = 1.5in + enumerated-list-level2.space-between-items = 50pt + + +================= +Definition List +================= + +Formatting the definition list +------------------------------- + +Use the ``'definition-list'`` property to format the space after and +before, the left and right indent, and any other property you want to +set on the list, such as font for font-size:: + + definition-list.space-after = 20pt + definition-list.space-before = 20pt + definition-list.left-indent = 20pt + definition-list.right-indent = 20pt + definition-list.background-color = grey + +Formatting space between items +------------------------------- + +An item consists of both the term and definition. + +:: + + definition-list.space-between-items = 0pt + +To format space below term +--------------------------- + +Use the ``'space-below-term'`` property. + +:: + + definition-list.space-below-term = 30pt + +Formatting the term +--------------------- + +Use the ``'definition-term'`` identifier, which can take any block property:: + + definition-term.right-indent = 10pt + definition-term.color = red + +Formatting the definition +-------------------------- + +Use the ``'definition-list-definition'`` identifier, which can take any block property:: + + definition-list-definition.color = blue + +Formatting the classifier +------------------------- + +Use the ``'definition-list-classifier'`` identifier, which can take any inline property:: + +:: + + definition-list-classifier.color = green + +Formatting the paragraphs +--------------------------- + +The ``'definition-list-definition'`` formats all the paragraphs in the +definiton. If you wish to change a property on the paragraphs instead, use the +``'definition-list-paragraph'`` identifier:: + + # the space before dtermines the space between each paragraph + definition-list-paragraph.space-before = 12pt + +============ +Field List +============ + + +Formatting the field list +---------------------------- + +Use the ``'field-list'`` property to format the space after and +before, the left and right indent, and any other property you want to +set on the list, such as font for font-size:: + + field-list.space-after = 20pt + field-list.space-before = 20pt + field-list.left-indent = 20pt + field-list.right-indent = 20pt + field-list.background-color = grey + + +To format space between items +------------------------------- + +Use the ``'space-between-items'`` property. + +:: + + + field-list.space-between-items = 30pt + +To format space between field and text +------------------------------------------- + +Use the ``'space-from-name'`` identifier:: + + + field-list.space-from-name = 1in + +Formatting the field names +--------------------------- + +Use the ``'field-name'`` identifier, which can take any inline +properties:: + + + field-name.color = blue + + +Formatting the paragraphs +---------------------------- + +Use the ``'field-list-paragraph'`` identifier to format the text of +the bullet list. This identifier can take any block property:: + + field-list-paragraph.space-before = 12pt + field-list-paragraph.font-style = italic + +Note that using the ``'space-before'`` property has the same effect as +controlling the space between each paragraph, without putting unwated space +before the first paragraph. + + +============ +Option List +============ + +Choosing the layout +------------------- + +:: + + option-list.format = definition + +Choosing the options separator +------------------------------- + +By default, the docutils to FO convertor uses a comma to separate +options. To change the default, use the ``'options-list.separate'`` +property:: + + options-list.separator = : + +Formatting the option list format +----------------------------------- + +The option list can either be formatted as a list, with the options as +labels to the left of the description; or as a definition list, with +the options serving as the terms, and the descriptions in a paragraph +right below. For an option list with lenghty options, a definition +list may work better. + +Use the ``'option-list.format'`` to determine the style, choosing +either ``'list'`` or ``'definition'``:: + + # change default layout to a definitio list + option-list.format = definition + +Formatting the option list +---------------------------- + +Use the ``'option-list'`` property to format the space after and +before, the left and right indent, and any other property you want to +set on the list, such as font for font-size:: + + option-list.space-after = 20pt + option-list.space-before = 20pt + option-list.left-indent = 20pt + option-list.right-indent = 20pt + option-list.background-color = grey + + +To format space between items +------------------------------- + +Use the ``'space-between-items'`` property. + +:: + + + option-list.space-between-items = 30pt + + +To format space between option and text +------------------------------------------- + +Use the ``'space-from-option'`` identifier:: + + + option-list.space-from-option = 1in + +Note: this option is only valid for option lists formatted as lists, +not for optons lists formatted as definition lists. + +To format space below option and text +------------------------------------------- + +Use the ``'space-below-option'`` identifier:: + + + option-list.space-below-option = 1in + +Note: this option is only valid for option lists formatted as +definition lists, not for optons lists formatted as lists. + + +Formatting the options +--------------------------- + +Use the ``'options'`` identifier to format the option with the +arguments of the options. This identifier can take any inline +properties:: + + + options.font-size = xx-small + +Formatting the options without the argument +---------------------------------------------- + +Use the ``'option'`` identifier to format only the option without the +arguments of the options. This identifier can take any inline +properties:: + + + option.color = green + +.. option-group-block + +Formatting the arguments of the options +---------------------------------------------- + +Use the ``'option-argument'`` identifier to format just the option of +the arugment. This identifier can take any inline properties:: + + + option-argument.color = green + + +Formatting the description +---------------------------- + +Use the ``'option-list-body'`` identifier to format the text of +the option list:: + + option-list-body.font-style = italic + +.. option-list-description-block + +Formatting the paragraphs +---------------------------- + +Use the ``'option-list-paragraph'`` identifier to format the text of +the bullet list. This identifier can take any block property:: + + option-list-paragraph.space-before = 12pt + option-list-paragraph.font-style = italic + +Note that using the ``'space-before'`` property has the same effect as +controlling the space between each paragraph, without putting unwated space +before the first paragraph. + +=============== +Literal Blocks +=============== + +To format a literal block, use the ``'literal-block'`` identifier. The +literal block takes any block properties:: + + literal-block.background-color = red + +=========== +Line Blocks +=========== + +Formatting the entire line block +--------------------------------- + +Use the ``'line-block'`` indentifier to format the entire line block. +This identifier can take any block property:: + + line-block.space-before = 24pt + # set font properties, etc + line-block.font-size = 10pt + line-block.line-spacing = 1 + +Formatting the lines +---------------------- + +The lines have the identifier ``'line-level1'``, ``'line-level2'`` and +so fourth. Each level indicates how many levels the line is nested. +Lines may be nesed up to 5 levels deep. It makes sense to set overall +properties with the ``'line-block'`` identifier, and to use the +``'line-level#'`` to set the indents of for each level:: + + line-level1.left-indent = 15mm + line-level2.left-indent = 25mm + line-level3.left-indent = 35mm + line-level4.left-indent = 45mm + line-level5.left-indent = 55mm + +Create a stanza title +---------------------- + +In order to create a title for a stanza, in the *document* (not the +configuration file) include the line in a title_reference:: + + | `stanza title 1` + | A one, two, a one two three four + | + | `stanza title 2` + | Half a bee, philosophically, + | must, *ipso facto*, half not be. + | But half the bee has got to be, + | *vis a vis* its entity. D'you see? + | + | `stanza title 3` + | But can a bee be said to be + | or not to be an entire bee, + | when half the bee is not a bee, + | due to some ancient injury? + | + | Singing... + +Formatting the stanza title +----------------------------- + +Use the ``'stanza-title'`` to format the stanza title:: + + stanza-title.font-style = bold + +You cannot do any formatting with a title reference (the text between +the \`\`). If you need to do inline markup on part of a stanza title, +only put the \`\` around the part that does not need the markup:: + + + | *stanza title* `3` + | But can a bee be said to be + +If you need to format the entire stanza title, use the following work +around:: + + + .. role:: title + + | *stanza title 3* :title:`x` + | But can a bee be said to be + | or not to be an entire bee, + | when half the bee is not a bee, + | due to some ancient injury? + +Number lines +------------ + +Use the ``'line-block.number'`` property, and choose a number for the +value. If a value of 5 is choosen, every 5th line will be numbered. If +10 is choosen, every 10th line will be nummbered, and so on. + +:: + + line-block.number = 5 + +Make numers closer to line +---------------------------- + +By default, docutils to fo puts the number to the very right of the +margin. There is not way to change this default. However, by +increasing the margin on the line-block, the numbers will render +closer:: + + line-block.right-indent = 20mm + +Keeping the lines on the same page +----------------------------------- + +If the line block is relatively short, use the ``'keep-on-same-page'`` +property. + +:: + + line-block.keep-on-same-page = true + +If the line block is long, using this property could lead to +huge space on a page. + +.. note a work around is to create a completely new stanza, and use +.. keep-on-same-page property. + +Creating space between stanzas +------------------------------- + +Use a blank line to control the space between stanzas. There is no +othe way to control space. The rst2xml.py utility marks a new set of +line blocks when it detects a new indentation. In contrast, real verse +is marked by the space between stanzas. + +============== +Block Quotes +============== + +Creating block quotes +---------------------- + +Indent text to creat a block quote. Use two dashes before a single +paragraph to create an attribution for the block quote:: + + This is an ordinary paragraph, introducing a block quote. + + "It is my business to know things. That is my trade." + + -- Sherlock Holmes + +Formatting block quotes +------------------------ + +Use the ``'block-quote'`` identifier to format block quotes. This +identifier can take any block properties:: + + block-quote.space-before = 24pt + block-quote.left-indent = 30mm + block-quote.right-indent = 30mm + +Formatting the paragraphs in block quotes +------------------------------------------ + +Use the ``'block-quote-paragraph'`` identifier to format the +individual paragraphs. Setting the ``'space-before'`` property changes +the space between each paragraph:: + + block-quote-paragraph.space-before = 0pt + block-quote-paragraph.first-line-indent = 12pt + +Formatting the attribution +---------------------------- + +Use the ``'block-quote-attribution'`` identifier to format the +attribution:: + + block-quote-attribution.space-before = 12pt + block-quote-attribution.font-style = italic + + +Changing the default text for the attribution +----------------------------------------------- + +By default, the |script_name| puts and em-dash before the attribution +text. To change this text, use the +``'block-quote.attriubution-text'``. Set this to an empty string to +set no text before the attribution:: + + # have no text before the attribution + block-quote.attriubution-text = + +====== +Tables +====== + +Creating Tables +---------------- + +Either:: + + ===== ===== + col 1 col 2 + ===== ===== + 1 Second column of row 1. + 2 Second column of row 2. + Second line of paragraph. + 3 - Second column of row 3. + + - Second item in bullet + list (row 3, column 2). + \ Row 4; column 1 will be empty. + ===== ===== + +Or:: + + +------------------------+------------+----------+----------+ + | Header row, column 1 | Header 2 | Header 3 | Header 4 | + | (header rows optional) | | | | + +========================+============+==========+==========+ + | body row 1, column 1 | column 2 | column 3 | column 4 | + +------------------------+------------+----------+----------+ + | body row 2 | Cells may span columns. | + +------------------------+------------+---------------------+ + | body row 3 | Cells may | - Table cells | + +------------------------+ span rows. | - contain | + | body row 4 | | - body elements. | + +------------------------+------------+---------------------+ + +Or:: + + .. csv-table:: Frozen Delights! + :header: "Treat", "Quantity", "Description" + :widths: 15, 10, 30 + + "Albatross", 2.99, "On a stick!" + "Crunchy Frog", 1.49, "If we took the bones out, it wouldn't be + crunchy, now would it?" + "Gannet Ripple", 1.99, "On a stick!" + +Formatting tables +------------------- + +Use the ``'table'`` identifier to format properties on the entire +table:: + + table.space-before = 24pt + table.space-after = 24pt + +Use the ``'width'`` property to change the width of the table:: + + table.width = 4in + +Changing the widths of the columns +------------------------------------ + +The formatter uses the columns values generated by the rst2xml.py +script to determine the width of the columns. In order to change this +default, use the ``'table.column-widths'`` property, followed by a +series of numbers separated by commas:: + + # column 2 will be 4 times as wide as column 1 + table.column-widths = 10, 40 + +Formatting tables and captions +------------------------------- + +Use the identifier ``'table-and-caption'`` if (1) you have a CVS table +with a title (caption) and; (2) you wish to treat both table and +caption as one block of text to control spacing:: + + table-and-caption.keep-on-same-page = true + table-and-caption.space-before = 12pt + +Formatting the table header +---------------------------- + +Use ``'table-header'`` identifier to format the head of a table. Use +this identfier to set font styles, background colors, font color, +alingnment, etc. + +:: + + table-header.font-style = bold + table-header.color = white + table-header.background-color = blue + table-header.alignment = center + +Formatting the table header cells +----------------------------------- + +Use the ``'table-header-cell'`` identifier to format cells. + +Formatting borders ++++++++++++++++++++ + +The defaults of cells are: + +* 1px black solid for all borders except the top +* 2px black solid for the bottom border +* border-collapse = collapse (merget adjacent borders) +* padding = 1em + +To change, use the ``'border-bottom'``, ``'border-top'``, +``'border-left'`` and ``'border-right'``. + +:: + + # set the bottom border of the cell to a more solid line + table-header.border-bottom = 3 px black solid + +Changing the vertical alignment +++++++++++++++++++++++++++++++++ + +:: + + # set the vertical alingment to bottom + # get rid of padding on bottom + table-header-cell.padding-bottom = 0em + # vertically align text with bottom + table-header-cell.vertical-alignment = bottom + +Formatting the table body +-------------------------- + +Use ``'table-body'`` identifier to format the body of a table. Use +this identfier to set font styles, background colors, font color, +alingnment, etc. + +:: + + table-body.font-style = normal + table-body.color = green + table-body.background-color = red + table-body.alignment = left + +Formatting the table body cells +----------------------------------- + +Use the ``'table-cell'`` identifier to format cells. + +:: + + # set the vertical alingment to bottom + # get rid of padding on bottom + table-cell.padding-bottom = 0em + # vertically align text with bottom + table-cell.vertical-alignment = bottom + table-cell.border = .5px solid green + +.. |script_name| replace:: docutils to Of + + diff --git a/sandbox/paultremblay/python_interface/docs/rst/parameters.rst b/sandbox/paultremblay/python_interface/docs/rst/parameters.rst new file mode 100644 index 000000000..71041c399 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/rst/parameters.rst @@ -0,0 +1,521 @@ +#################### +XSL-FO Documentation +#################### + +^^^^^^^^^^ +Parameters +^^^^^^^^^^ + +.. contents:: Table of Contents + +strict +====== + +**Possible Values**: ``True``, ``False``, ``''`` + +**Default:** + +If set to True, stylesheet processing quits when an error is +found. + +page-layout +=========== + +**Possible Values**: ``simple``, ``first``, ``odd-even``, +``first-odd-even`` + +**Default:** + +This parameter determines the page layout for the document. A +value of ``simple`` will create a document with the same page +layout for all pages. A value of ``first`` creates a document +with a dfferent page layout for the first page and for the rest +of the pages. A value of ``odd-even`` creates a different layout +for for odd and even pages. A value of ``first-odd-even`` creates +a different layout for the first page, for odd pages, and for +even pages. + +Because restructured text only allows one footer and header, the +footer and header will be the same for bth odd and even pages. +However, if the ``first`` or ``first-odd-even`` values is chosen, +you can suppress the first footer and header (see below). + +Using a value other than ``simple`` allows for different margins +for different page sequences, depending on the value. + +custom-spacing-header-footer +============================ + +**Possible Values**: ``boolean`` + +**Default:** + +Tells the stylesheets to use attributes of body and region-before +that will determine the spacing for the header. Normally, the +stylesheets sets the area to .75in, if a relevant header or +footer is found. When ``'custom-spacing-header-footer'`` is set +to true, the stylesheets won't try to generate any spacing, but +will require these attributes to be set in the relevant attribute +sets. + +pagination for front matter +=========================== + +**Possible Values**: ``with-front``, ``with-toc``, ``with-body`` + +**Defaults:** See below + +The function is the same for the following parameters: + +* title-pagination + +* bibliographic-pagination + +* dedication-pagination + +* abstract-pagination + +* toc-pagination + +Each determines what region to place the textual matter. There +are three regions, the front matter, the toc matter, and the body +matter. The front matter has no footers and headers. The toc +matter starts a new page run, in which the numbers start with 1 +(or any other value), and can take any formatting. The body +matter again starts a new run of pages with its own page +numbering and formatting of these numbers. + +In practice, the abstract and title page often occurr before the +other front matter material, and they appear on pages with no +footers and headers. The dedication and Table of Contents appear +next, with the first numbering of the document, the numbers being +formatted as lower-case Roman numberals. The bibliographic +information could appear in either the front matter or toc +matter. In order to achieve this standard layout, the defaults +choose a ``with-front`` for the ``title-pagination``, +``abstract-pagination.``, and ``bibliographic-pagination; and a +``with-toc`` for the ``toc-pagination`` and +``dedication-pagination``. + +In order to change these defaults, choose a different value. For +example, to place the dedication in the front matter, set +``dedication-pagination`` to ``with-front``. For a simple +document, in which there is only one set of page runs, simply set +each of these parameters to ``with-body``. + +front-order +=========== + +**Possible Values**: ``title``, ``bibliographic``, +``dedication``, ``abstract``, ``toc`` + +**Default:** title,bibliographic,dedication,abstract,toc + +The param ``front-order`` is a string of each region, separated +by a comma, that determines the order of the title, the +bibliographic information, the dedication, the abstract, and the +Table of Contents. The default puts them in order that docutils +puts them in when the document is converted to XML. In order to +change this, change the order in the string. For example, to +place the abstract before the dedication, use +``'title,bibliographic,dedication,abstract,toc'`` as a value. + +If you have a region in your parameter value that does not +actually exist in your document, no error will occurr. For +example, if you set your value to +``title,bibliographic,dedication,abstract,toc``, but have no +``title`` in your document, the XSL stylesheet will still place +the abstract before the dedication without raising any error. + +However, if you lack a region in your value that exists in the +document, the stylesheets will recognize this as an error, +notifiy you, and quit. For eaxmple, if your value is +``,bibliographic,dedication,abstract,toc``, and your document +contains a title, the processing will quit. + +bibliographic-format +==================== + +**Possible Values**: ``list``, ``normal``, ``''`` + +**Default:** list + +Determines the formatting of the bibliographic info. When set to +``'list'`` (the default), the bibliograhic fields will be +formatted as a list. When set to ``'normal'`` or ``''``, the each +bibliographic field will be formatted as a block. + +Custom Table Columns +==================== + +**Possible Values**: ``numbers separated by commas`` + +**Defaults:** '' + +The function is the same for the following parameters: + +* table-cols + +* table-borderless-cols + +* table-long-cols + +* table1-cols + +* table2-cols + +* ... + +* table30-cols + +Each parameter sets the columns for the table. ``'table-cols'`` +sets the columns for the default table; +``'table-borderless-cols'`` sets the columns for the borderless +table, and ``'table-long-cols'`` sets the columns for the long +table. There are also 30 custom tables, and the parameter for the +columns is ``'table1-cols'``, ``'table2-cols'`` ... +``'table30-cols'``. + +Use these parameters to override the defualts created by +rst2xml.py + +Use a value of numbers separated by commas. For example, a value +of ``'10,20,10'`` sets the first column to 10, the second to 20, +and the third to 10. That means the first and third columns will +have the same width, and the second will be twice as large as +those. + +long-rows-first-page +==================== + +**Possible Values**: ``numbers separated by commas`` + +**Default:** + +Use this property to set the number of rows you want on the first +page for a table with a class of ``'long'``. Only use if you +desire a different caption from that which appears on the first +page. + +FO by itself cannot create different table headings or footings +from on subsequent pages. The stylesheets get around this +limitation by creating two tables, one which takes the first +heading (or footing), and one which takes the second. The user +must tell the stylesheets when to start the new table; the +stylesheets have no way of calcuating this on their own. + +Use numbers separated by commas for this parameter, where the +first number inidcatetes the first long table, the second the +second table, and so on. For example, a value of ``'8,10'`` tells +the stylesheet to break the first *long* table at 8 rows, and +the second at 10 rows. + +Leave this parameter empty, or set it to 0 in order to have the +same caption on all pages. + +Bibliographic Field Names +========================= + +**Possible Values**: Any Text + +**Defaults:** See below + +The function is the same for the following parameters: + +* author-text (default: Author: ) + +* authors-text (default: Authors: ) + +* organization-text (default: Organization: ) + +* contact-text (default: Contact: ) + +* status-text (default: Status: ) + +* copyright-text (default: Copyright: ) + +* address-text (default: Address: ) + +* version-text (default: Version: ) + +* revision-text (default: Revison: ) + +* date-text (default: Date: ) + +Each parameter sets the text in the list for that particular +bibliographic item. For example if you wanted to change the +default for ``contact`` from 'contact' to email, you would simply +set this value to 'email'. + +Custom bibliographic field names +================================ + +**Possible Values**: Any Text + +**Defaults:** '' + +The function is the same for the following parameters: + +* custom-bib-info1-name + +* custom-bib-info2-name + +* custom-bib-info3-name + +* custom-bib-info4-name + +* custom-bib-info5-name + +* custom-bib-info6-name + +* custom-bib-info7-name + +* custom-bib-info8-name + +* custom-bib-info9-name + +* custom-bib-info10-name + +Each parameter sets the value of the corresponding text for cutom +bibliographic fields. + +Admonition Title Names +====================== + +**Possible Values**: Any Text + +**Defaults:** See below + +The function is the same for the following parameters: + +* attention-title (default: Attention!) + +* caution-title (default: Caution!) + +* danger-title (default: !Danger!) + +* error-title (default: Error) + +* hint-title (default: Hint) + +* important-title (default: Important) + +* note-title (default: Note) + +* tip-title (default: Tip) + +* warning-title (default: Warning!) + +Each parameter sets the text for the title for that particular +Admonition. For example if you wanted to change the default for +``attention-title`` from 'Important' to 'Pay Attention!', you +would simply set this value to 'Pay Attnetion!'. + +transition-text +=============== + +**Possible Values**: Any Text + +**Defaults:** \*\*\* + +The text to use for a transtion element. Use any text (including +an empty string) to change that value. + +Formatting of Section Numbering +=============================== + +**Possible Values**: Valid Number Formatting String + +**Defaults:** See below + +The function is the same for the following parameters: + +* number-section1 (default: 1) + +* number-section2 (default: .1) + +* number-section3 (default: .1) + +* number-section4 (default: .1) + +* number-section5 (default: .1) + +* number-section6 (default: .1) + +* number-section7 (default: .1) + +* number-section8 (default: .1) + +* number-section9 (default: .1) + +Each parameter sets the formatting (not the actual number) for +that particular level. The stylesheets allow for a great deal of +flexibility here. For example, in order to set a level 3 number +format to '(II)3.b', you would set ``number-section1`` to '(I)', +``number-section2`` to '.1' (the default, in this case, meaning +you woud not need to make a change), and ``number-section3`` to +'.a'. + +inherit-section-num +=================== + +**Possible Values**: ``True``, ``False`` + +**Default:** True + +If set to 'True', each section inherits the section numbering +from the sections above it. For example, section '1.1.2' will +appear as '1.1.2'. If set to 'False', the section number will +appear as '2'. + +bullet-text +=========== + +**Possible Values**: Any Text + +**Default:** • + +Use to set the value for the bullets in a bullet list. If this +string is left blank, then the stylesheets will use the value in +the XML. + +bullet-text-level2 +================== + +**Possible Values**: Any Text + +**Default:** ° + +Use to set the value for the bullets in a nested bullet list. If +this string is left blank, then the stylesheets will use the +value in the XML. + +option-list-format +================== + +**Possible Values**: ``list``, ``definition`` + +**Default:** list + +Use to determine the formatting of an options list. If ``list`` +is choosen, then the options list is formatted as a traditional +list, with the options to the left and the description to the +right. If ``definition`` is choosen, the options list is +formatted as a defintion list, with the options above the +description, which is indented. Lists with long options are +probably better formatted using ``definition.`` + +options-separator +================= + +**Possible Values**: Any Text + +**Default:** , + +Use to set the value for the text that separates the options in +an option list. For example, if your RST file has ``-f -file`` as +the options, and you choose ';' as the ``options-separator``, +the output becomes ``-f; -file``. + +number-verse +============ + +**Possible Values:** any positive integer, or ``''`` + +**Default:** 5 + +When set, this parameter numbers a line block ("verse") every +``value`` lines. The value of ``'5'`` numbers every 5th line. If +``number-verse`` is left empty, the line block will not be +numbered. + +Text Before Attributions +======================== + +**Possible Values**: Any Text + +**Defaults:** — + +The function is the same for the following parameters: + +* text-before-block-quote-attribution + +* text-before-epigraph-attribution + +* text-before-pull-quote-attribution + +Each parameter determines the text before the attribution. When +the parameter is left empty, no text will appear before an +attribution. + +table-title-placement +===================== + +**Possible Values**: ``top``, ``bottom`` + +**Default:** bottom + +Where to place the table title, or caption. + +footnote-placement +================== + +**Possible Values**: ``footnote``, ``endnote`` + +**Default:** footnote + +This parameter determines whether footnotes will function as +footnotes, or endnotes. When ``footnote`` is choosen, footnotes +appear at the bottom of the page. When ``endnote`` is choosen, +the *numbered* footnotes appear as endnotes, in the same position +where they are in the RST document. If ``endnote`` is choosen, +symbolic footnotes still appear as footnotes, thus giving a user +the ability to use both footnotes and endnotes. + +footnote-style +============== + +**Possible Values**: ``list``, ``traditional`` + +**Default:** list + +This parameter determines the style of the footnote or endnote +text. When ``'list'``, is choosen, the text is formatted as a +list, with the number as the item. When ``'traditional'`` is +choosen, the footnote appears in the more traditional manner, as +a paragraph with the first line indented. + +space-between-footnotes +======================= + +**Possible Values**: Any Measure + +**Default:** 5pt + +Use to set the space between footnotes. (I have not determined +how to set this property in the normal way, which is why this +property appears as a parameter, rather than in an attribute set, +like the other similar properties.) + +internal-link-type +================== + +**Possible Values**: ``link``, ``page``, ``page-link`` + +**Default:** link + +When set to ``'page'``, the page number of the target appears. +When set to ``'link'``, the text of the link appears, and +clicking on that link takes you to the target. When set to +``'page-link'``, the page of the target appears, and clicking on +that page number takes you to the target. + +test +==== + +**Possible Values**: ``True``, ``False``, ``''`` + +**Default:** + +For testing purposes only. + diff --git a/sandbox/paultremblay/python_interface/docs/rst/user_guide.rst b/sandbox/paultremblay/python_interface/docs/rst/user_guide.rst new file mode 100644 index 000000000..011bf468a --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/rst/user_guide.rst @@ -0,0 +1,154 @@ +Page Layout +============= + +Paper Size +------------ + +The following determmine the size of the paper: + +Height ++++++++ + +* default-simple-page-master.page-height = 11in + +The short version is: + +* paper-size.height = 11in + +Width +++++++ + +* default-simple-page-master.page-width = 8.5in + +The short version is: + +* paper-size.width = 8.5in + +Page Margins +--------------- + +For a Simple Document ++++++++++++++++++++++++ + +Each set of properties has the same effect. + +* simple-page-master.top-margin = 1in +* simple-page-master.bottom-margin = 1in +* simple-page-master.right-margin = 1in +* simple-page-master.left-margin = 2in + +The short versions are: + +* page.top-margin = .75in +* page.bottom-margin = .75in +* page.right-margin = .75in +* page.left-margin = .75in + +The properties can be reversed: + +* page.margin-top = .75in +* page.margin-bottom = .75in +* page.margin-right = .75in +* page.margin-left = .75in + + +For Documents with First, Odd, and Even Pages +++++++++++++++++++++++++++++++++++++++++++++++ + +Here is how to set margins for the first, even, and odd pages. Note that these +will work only if you choose ``page-layout``=``odd-even``, or ``page-layout`` += ``first-odd-even,`` or ``page-layout`` = ``first``. + +The long version: + +* odd-simple-page-master.top-margin = 1in +* odd-simple-page-master.bottom-margin = 1in +* odd-simple-page-master.right-margin = 1in +* odd-simple-page-master.left-margin = 2in +* +* even-simple-page-master.top-margin = 1in +* even-simple-page-master.bottom-margin = 1in +* even-simple-page-master.right-margin = 2in +* even-simple-page-master.left-margin = 1in + +* first-simple-page-master.top-margin = 1in +* first-simple-page-master.bottom-margin = 1in +* first-simple-page-master.right-margin = 2in +* first-simple-page-master.left-margin = 1in + +The short versions: + +* odd-page.top-margin = 1in +* odd-page.bottom-margin = 1in +* odd-page.right-margin = 1in +* odd-page.left-margin = 2in +* +* even-page.top-margin = 1in +* even-page.bottom-margin = 1in +* even-page.right-margin = 2in +* even-page.left-margin = 1in + +* first-page.top-margin = 3in +* first-page.bottom-margin = 1in +* first-page.right-margin = .8in +* first-page.left-margin = 2in + +Headers and Footers +--------------------- + +Setting the space, or height. +++++++++++++++++++++++++++++++ + +Long version: + +* header-region-before.extent = 1in +* footer-region-after.extent = 1in + +Short version: + +* header.height = 1in +* footer.height = 1in + +To make the header closer to the page, use the ``space-before`` property:: + + header.space-before = .2in + +Use the ``'space-before'`` property for the footer, as well, to move it +closer to the text:: + + footer.space-before = -.1in + +Documnet +============= + +The following properties can be set for the entire document: + +* font-size +* font-family or font + +The short version of ``'font-family'`` is ``'font'``; they are synonymous. + +Possible font-families are serif, sans-seif, monospace; Times, Helvitica +Coureir, ZapfDingbats, and Symbol. Since these font families are buiit in, +they are guarenteed to work, regardless of the availability of fonts on +an operating system. + +Body +===== + +The following properties can be set for the body of the document. The body +is defined as everything except headers and footers. + +* font-size +* font +* line-height or line-spacing + +The property ``'line-spacing'`` is the short version of ``'line-height'``; +They are synomous. + +Set ``line-spacing`` to a number to determine the spacing relative to +the font size. For example, a value of ``'2'`` sets the line spacing to +double. + +Set ``'line-spacing'`` to a measure, such as ``'24pt'`` to set an absolute +value to the line spacing. diff --git a/sandbox/paultremblay/python_interface/docs/xsl/admonitions.xsl b/sandbox/paultremblay/python_interface/docs/xsl/admonitions.xsl new file mode 100644 index 000000000..9977895cb --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/admonitions.xsl @@ -0,0 +1,169 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='default-admonition-outer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">block</xsl:with-param> + <xsl:with-param name="docutils">None</xsl:with-param> + </xsl:call-template> + <block> + Sets up the defaults for the outer blocks of all the admonitions. The + attributes of this block control the borders and prohibit the admonition + from breaking across a page. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='default-admonition-title-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">block</xsl:with-param> + <xsl:with-param name="docutils">None</xsl:with-param> + </xsl:call-template> + <block> + Sets up the defaults for the title blocks of all the admonitions. The + attributes of this block control the color (red) and font size. For certain + blocs, the color is set to black (see below). + </block> + </xsl:template> + + + + <xsl:template match= "xsl:attribute-set[@name='attention-block']" priority="3"> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">5</xsl:with-param> + <xsl:with-param name="text">admonitions outer block</xsl:with-param> + </xsl:call-template> + <block> + <xsl:text>:fo: fo:block</xsl:text> + </block> + <block first-line-indent="-9"> + <xsl:text>:docutils: attention | caution | danger | error | hint | important | note | tip | warning | admonitons[@classes='custorm']</xsl:text> + </block> + + + <block first-line-indent="-9"> + <xsl:text>:inherits: default-admonition-outer-block</xsl:text> + </block> + <block> + The following attribute sets are identical in nature: + </block> + <block>* attention-block</block> + <block>* caution-block</block> + <block>* danger-block</block> + <block>* error-block</block> + <block>* hint-block</block> + <block>* important-block</block> + <block>* note-block</block> + <block>* tip-block</block> + <block>* warning-block</block> + <block>* admonition-custom-block</block> + <block> + These attribute-sets format the outer block of all the admonitions. By default it puts + an border around the text. Use this attribute set to set the space before or after, the background + color, etc. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='caution-block']| + xsl:attribute-set[@name='danger-block']| + xsl:attribute-set[@name='error-block']| + xsl:attribute-set[@name='hint-block']| + xsl:attribute-set[@name='important-block']| + xsl:attribute-set[@name='note-block']| + xsl:attribute-set[@name='tip-block']| + xsl:attribute-set[@name='warning-block']| + xsl:attribute-set[@name='admonition-custom-block'] + " + priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='attention-title-block']" priority="3"> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">5</xsl:with-param> + <xsl:with-param name="text">admonitions title block</xsl:with-param> + </xsl:call-template> + <block> + <xsl:text>:fo: fo:block</xsl:text> + </block> + <block first-line-indent="-9"> + <xsl:text>:docutils: attention | caution | danger | error | hint | important | note | tip | warning | admonitons[@classes='custorm']</xsl:text> + </block> + + + <block first-line-indent="-9"> + <xsl:text>:inherits: default-admonition-title-block</xsl:text> + </block> + <block> + The following attribute sets are identical in nature: + </block> + <block>* attention-title-block</block> + <block>* caution-title-block</block> + <block>* danger-title-block</block> + <block>* error-title-block</block> + <block>* hint-title-block</block> + <block>* important-title-block</block> + <block>* note-title-block</block> + <block>* tip-title-block</block> + <block>* warning-title-block</block> + <block>* admonition-custom-title-block</block> + <block> + These attribute-sets format the title block of all the admonitions. It sets the + color to red. + </block> + <block> + The attribute-sets ``error-title-block``, ``hint-title-block``, ``important-title-block``, + ``note-title-block``, ``tip-title-block``, and ``admonition-custom-title-block`` resets + the color back to black. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='caution-title-block']| + xsl:attribute-set[@name='danger-title-block']| + xsl:attribute-set[@name='error-title-block']| + xsl:attribute-set[@name='hint-title-block']| + xsl:attribute-set[@name='important-title-block']| + xsl:attribute-set[@name='note-title-block']| + xsl:attribute-set[@name='tip-title-block']| + xsl:attribute-set[@name='warning-title-block']| + xsl:attribute-set[@name='admonition-custorm-title-block'] + " + priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='admonition-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">attention/paragraph|caution/paragraph|etc.</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs in the admonitions. A different attribute-set formats the first + paragraph (see below). + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='admonition-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">attention/paragraph|caution/paragraph|etc.</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs in the admonitions. A different attribute-set formats the first + paragraph (see below). + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='admonition-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">attention/paragraph[1]|caution/paragraph[1]|etc.</xsl:with-param> + </xsl:call-template> + <block> + Formats the first paragraphs in the admonitions. It inherits its attributes from the + ``admonition-paragraph-block`` and resets the ``space-before`` property to ``0pt``. It does not + make sense to modify the attributes in this set directly. + </block> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/bibliographic_fields.xsl b/sandbox/paultremblay/python_interface/docs/xsl/bibliographic_fields.xsl new file mode 100644 index 000000000..98bac2dcf --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/bibliographic_fields.xsl @@ -0,0 +1,266 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='bibliographic-fields-list-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">list-block</xsl:with-param> + <xsl:with-param name="docutils">docinfo</xsl:with-param> + </xsl:call-template> + <block> + Formats the bibliographic fields as a list. Since this element contains all the other list + elements, it can be used to set values such as the font, background color, + line-height, etc, for the entire list, as well as the space after and + before. + </block> + <block> + "The provisional-distance-between-starts property of the list-block + specifies the distance bewteen the start of the label (the bullet, for + example) and the actual start of the list content" (Pawson, 100). In + this case, that means the distance between the label (such as "Version", + and the labels' value (such as "1.2"). + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='bibliographic-fields-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">docinfo/author|docinfo/authors|docinfo/organization|etc.</xsl:with-param> + </xsl:call-template> + <block> + For each item (author, authors, organization, contact, address, version, date, copyright, + custom field) in the bibliograhic fields. Use the 'space-after' attribute to control + the spacing between each item. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='bibliographic-fields-first-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">docinfo/author|docinfo/authors|docinfo/organization|etc.</xsl:with-param> + <xsl:with-param name="inherits">bibliographic-fields-list-item</xsl:with-param> + </xsl:call-template> + <block> + Same as above, but sets the space before to 0pt. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='bibliographic-fields-list-item-label']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-label</xsl:with-param> + <xsl:with-param name="docutils">docinfo/author|docinfo/authors|docinfo/organization|etc.</xsl:with-param> + </xsl:call-template> + <block> + The default attribute end-indent = "label-end()" ensures that the label aligns properly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='bibliographic-fields-item-label-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/author|docinfo/authors|docinfo/organization|etc.</xsl:with-param> + </xsl:call-template> + <block> + Formats the block that wraps the the name of the field (such as Author, Version, etc). + </block> + </xsl:template> + + + + <xsl:template match= "xsl:attribute-set[@name='bibliographic-fields-item-body']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-body</xsl:with-param> + <xsl:with-param name="docutils">docinfo/author|docinfo/authors|docinfo/organization|etc.</xsl:with-param> + </xsl:call-template> + <block> + The default of start-indent = "body-start()" ensures the correct + alignment of the labels. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='bibliographic-fields-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/author|docinfo/authors|docinfo/organization|etc.</xsl:with-param> + </xsl:call-template> + <block> + Formats the blocks (docutilis paragraphs) of the value of the field. Use the + 'space-after' attribute to control the spacing between a multi-paragraph + description. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='bibliographic-first-fields-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/author|docinfo/authors|docinfo/organization|etc.</xsl:with-param> + <xsl:with-param name="inherits">bibliographic-fields-block</xsl:with-param> + </xsl:call-template> + <block> + Same as above, but for the first such paragraph. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='address-value-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/address</xsl:with-param> + <xsl:with-param name="inherits">bibliographic-fields-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the blocks (docutilis paragraphs) of the address field, which has to preserve + the white space, according to the docutils specs. Since this inherits from the + bibliographic-fields-bloc, it doesn't make sense to change attributes here directly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='author-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/author</xsl:with-param> + </xsl:call-template> + <block> + Formats the author element, when bibliograhic info is not formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='authors-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/authors</xsl:with-param> + </xsl:call-template> + <block> + Formats the authors element, when bibliograhic info is not formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='date-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/date</xsl:with-param> + </xsl:call-template> + <block> + Formats the date element, when bibliograhic info is not formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='organization-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/organization</xsl:with-param> + </xsl:call-template> + <block> + Formats the organization element, when bibliograhic info is not formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='contact-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/contact</xsl:with-param> + </xsl:call-template> + <block> + Formats the contact element, when bibliograhic info is not formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='status-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/status</xsl:with-param> + </xsl:call-template> + <block> + Formats the status element, when bibliograhic info is not formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='copyright-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/copyright</xsl:with-param> + </xsl:call-template> + <block> + Formats the copyright element, when bibliograhic info is not formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='version-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/version</xsl:with-param> + </xsl:call-template> + <block> + Formats the version element, when bibliograhic info is not formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='revision-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/revision</xsl:with-param> + </xsl:call-template> + <block> + Formats the revision element, when bibliograhic info is not formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='address-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">docinfo/address</xsl:with-param> + </xsl:call-template> + <block> + Formats the address element, when bibliograhic info is not formatted as a list. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='custom-bib-info1']" priority="3"> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">5</xsl:with-param> + <xsl:with-param name="text">Custom bibliographic fields</xsl:with-param> + </xsl:call-template> + <block> + <xsl:text>:fo: fo:block</xsl:text> + </block> + <block first-line-indent="-9"> + <xsl:text>:docutils: docinfo/field</xsl:text> + </block> + <block> + The following attribute sets are identical in nature: + </block> + <block>* custom-bib-info1</block> + <block>* custom-bib-info2</block> + <block>* custom-bib-info3</block> + <block>* custom-bib-info4</block> + <block>* custom-bib-info5</block> + <block>* custom-bib-info6</block> + <block>* custom-bib-info7</block> + <block>* custom-bib-info8</block> + <block>* custom-bib-info9</block> + <block>* custom-bib-info10</block> + <block> + These attribute-sets format the custom bibliographic fields. ``'custom-bib-info1'`` refers to the first + occurrence of such a field, ``'custom-bib-info2'`` to the second, and so fourth. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='custom-bib-info2']| + xsl:attribute-set[@name='custom-bib-info3']| + xsl:attribute-set[@name='custom-bib-info4']| + xsl:attribute-set[@name='custom-bib-info5']| + xsl:attribute-set[@name='custom-bib-info6']| + xsl:attribute-set[@name='custom-bib-info7']| + xsl:attribute-set[@name='custom-bib-info8']| + xsl:attribute-set[@name='custom-bib-info9']| + xsl:attribute-set[@name='custom-bib-info10'] " priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='Some-custom-field']" priority = "3"/> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/body_directives.xsl b/sandbox/paultremblay/python_interface/docs/xsl/body_directives.xsl new file mode 100644 index 000000000..e39f0e5f0 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/body_directives.xsl @@ -0,0 +1,280 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <!--topic--> + <xsl:template match= "xsl:attribute-set[@name='topic-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic</xsl:with-param> + </xsl:call-template> + <block> + Formats the outermost block of the topic element, which contains blocks. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='topic-title-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic/title</xsl:with-param> + </xsl:call-template> + <block> + Formats the title of the topic. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='topic-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs of the topic. A different set of attributes + formats the first paragraph. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='topic-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">topic-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first paragraphs of the topic. + </block> + </xsl:template> + + <!--sidebar--> + + <xsl:template match= "xsl:attribute-set[@name='sidebar-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">sidebar</xsl:with-param> + </xsl:call-template> + <block> + Formats the outermost block of the sidebar element, which contains blocks. + Note that fop does not handle floats, so this element is formatted + just like a topic block. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='sidebar-title-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">sidebar/title</xsl:with-param> + </xsl:call-template> + <block> + Formats the title of the topic. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='sidebar-subtitle-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">sidebar/subtitle</xsl:with-param> + </xsl:call-template> + <block> + Formats the subtitle of the topic. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='sidebar-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">sidebar/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs of the sidebar. A different set of attributes + formats the first paragraph. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='sidebar-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">sidebar/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">sidebar-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first paragraphs of the sidebar. + </block> + </xsl:template> + + + <!--rubric--> + <xsl:template match= "xsl:attribute-set[@name='rubric-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">rubric</xsl:with-param> + </xsl:call-template> + <block> + Formats the rubric. + </block> + </xsl:template> + + <!--epigraph--> + + <xsl:template match= "xsl:attribute-set[@name='epigraph-outer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">epigraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the outermost block of the epigraph element, which contains blocks. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='epigraph-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">epigraph/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs of the epigraph. A different set of attributes + formats the first paragraph. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='epigraph-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">epigraph/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">epigraph-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first paragraphs of the epigraph. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='epigraph-attribution-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">epigraph/attribution</xsl:with-param> + </xsl:call-template> + <block> + Formats the attribution of the epigraph. The parameter + ``text-before-epigraph-attribution`` determines the text to + put before the attribtion. The default is '—' (an em-dash). To + put no text before, set this parameter to an empty string. + </block> + </xsl:template> + + <!--highlights--> + <xsl:template match= "xsl:attribute-set[@name='highlights-outer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">highlights</xsl:with-param> + </xsl:call-template> + <block> + Formats the outermost block of the epigraph element, which contains blocks. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='highlights-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">highlights/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs of the highlights. A different set of attributes + formats the first paragraph. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='highlights-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">highlights/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">highlights-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first paragraphs of the highlights. + </block> + </xsl:template> + + <!--pull-quote--> + + <xsl:template match= "xsl:attribute-set[@name='pull-quote-outer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">pull-quote</xsl:with-param> + </xsl:call-template> + <block> + Formats the outermost block of the pull-quote element, which contains blocks. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='pull-quote-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">pull-quote/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs of the pull-quote. A different set of attributes + formats the first paragraph. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='pull-quote-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">pull-quote/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">pull-quote-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first paragraphs of the pull-quote. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='pull-quote-attribution-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">pull-quote/attribution</xsl:with-param> + </xsl:call-template> + <block> + Formats the attribution of the pull-quote. The parameter + ``text-before-pull-quote-attribution`` determines the text to + put before the attribtion. The default is '—' (an em-dash). To + put no text before, set this parameter to an empty string. + </block> + </xsl:template> + + <!--container--> + <xsl:template match= "xsl:attribute-set[@name='container-outer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container</xsl:with-param> + </xsl:call-template> + <block> + Formats the outermost block of the container element, which contains blocks. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='container-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs of the container. A different set of attributes + formats the first paragraph. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='container-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">container-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first paragraphs of the container. + </block> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/body_elements.xsl b/sandbox/paultremblay/python_interface/docs/xsl/body_elements.xsl new file mode 100644 index 000000000..a636c9608 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/body_elements.xsl @@ -0,0 +1,132 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">document/paragrah|section/paragraph"</xsl:with-param> + </xsl:call-template> + <block> + Formats the default paragraph. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">document/paragrah|section/paragraph"</xsl:with-param> + <xsl:with-param name="inherits">paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first default paragraph. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='literal-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">document/literal_block|section/literal_block"</xsl:with-param> + </xsl:call-template> + <block> + Formats the literal text. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='transition-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">document/transition|section/transition"</xsl:with-param> + </xsl:call-template> + <block> + Formats the transition block. The actutal text for this block is set by the 'transition-text' + parameter. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='document-title-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">document/title"</xsl:with-param> + </xsl:call-template> + <block> + Formats the title for the document. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='document-subtitle-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">document/subtitle"</xsl:with-param> + </xsl:call-template> + <block> + Formats the subtitle of the document. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='document-title-page-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">document/title|document/subtitle"</xsl:with-param> + </xsl:call-template> + <block> + The block that wraps both the title and subtitle. This block only gets written + if the title and subtitle occur in the front section, or TOC section. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='block-quote-outer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">block_quote</xsl:with-param> + </xsl:call-template> + <block> + The attribute set that formats the block that wraps the other blocks in a block quote. Use the attribute + set to format space after or space before, etc. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='block-quote-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">block_quote/paragraph</xsl:with-param> + </xsl:call-template> + <block> + The attribute set that formats the paragraphs in the block quote. A different set of attributes + controls the first paragraph (see below). Use this attribute set to set the space + between paragraphs with the 'space-before' attribute. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='block-quote-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">block_quote/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">block-quote-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + The attribute set that formats the first paragraph in the block quote. + It inherits all the attributes from 'block-quote-first-paragraph-block' and + then sets the 'space-before' to 0. It does not make sense to modify + attributes in this attribute set directly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='block-quote-attribution-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">block_quote/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">block-quote-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + This attribute set the attribution in a block quote. + </block> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/bullet_list.xsl b/sandbox/paultremblay/python_interface/docs/xsl/bullet_list.xsl new file mode 100644 index 000000000..724ae113e --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/bullet_list.xsl @@ -0,0 +1,138 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + + + <xsl:template match= "xsl:attribute-set[@name='bullet-list-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">list-block</xsl:with-param> + <xsl:with-param name="docutils">bullet_list</xsl:with-param> + </xsl:call-template> + <block> + For the bullet list. Since this element contains all the other list + elements, it can be used to set values such as the font, background color, + line-height, etc, for the entire list, as well as the space after and + before. + </block> + <block> + "The provisional-distance-between-starts property of the list-block + specifies the distance bewteen the start of the label (the bullet, for + example) and the actual start of the list content" (Pawson, 100) + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='bullet-level2-list-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">list-block</xsl:with-param> + <xsl:with-param name="docutils">bullet_list/bullet_list</xsl:with-param> + </xsl:call-template> + <block> + Same as for the bullet-list-block attribute. The default sets the + start-indent property to a greater value to indent this nested + list. + </block> + + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='bullet-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">bullet_list/list_item</xsl:with-param> + </xsl:call-template> + <block> + For the item in the bullet list. The attributes can control the + spacing between each item. A different set of attributes controls the spacing + of the first item (see below). + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='bullet-level2-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">bullet_list/bullet_list/list_item</xsl:with-param> + </xsl:call-template> + <block> + Same as above, except for a nested bullet list. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='bullet-first-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">bullet_list/list_item[1]</xsl:with-param> + <xsl:with-param name="inherits">bullet-list-item</xsl:with-param> + </xsl:call-template> + <block> + For the first item in the bullet list. This attribute set inherits + all the properties form 'bullet-list-item', and then re-defines the + space-before to 0pt. In order to get space between the first item and the + text before it, use the space-after attribute in the bullet-list attribute + set. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='bullet-level2-first-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">bullet_list/list_item[1]</xsl:with-param> + <xsl:with-param name="inherits">bullet-level2-list-item</xsl:with-param> + </xsl:call-template> + <block> + For the first item in a nested bullet list. This attribute set inherits + all the properties form 'bullet-list-item', and then re-defines the + space-before to 0pt. In order to get space between the first item and the + text before it, use the space-after attribute in the bullet-list attribute + set. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='bullet-list-item-label']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-label</xsl:with-param> + <xsl:with-param name="docutils">bullet_list/list_item</xsl:with-param> + </xsl:call-template> + <block> + The default attribute end-indent = "label-end()" ensures + that the label aligns properly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='bullet-list-item-label-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">bullet_list/list_item</xsl:with-param> + </xsl:call-template> + <block> + These attributes format the block that wraps the bullet. (FO requires such + a block, even for a small label like this.) + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='bullet-list-item-body']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-body</xsl:with-param> + <xsl:with-param name="docutils">bullet_list/list_item</xsl:with-param> + </xsl:call-template> + <block> + The default of start-indent = "body-start()" ensures the correct + alignment of the labels. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='bullet-list-item-body-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">bullet_list/list_item/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the blocks (docutilis paragraphs) of the body of each item. + </block> + </xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/comment.xsl b/sandbox/paultremblay/python_interface/docs/xsl/comment.xsl new file mode 100644 index 000000000..7b69df65f --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/comment.xsl @@ -0,0 +1,39 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <!-- + <xsl:template match="comment()"> + <xsl:if test="contains(., '$Id: root.xsl')"> + <xsl:text>Root
</xsl:text> + <xsl:text>=====
</xsl:text> + <xsl:text>
</xsl:text> + <xsl:text>The attribue sets for the root elements, inlcuding document. These 
</xsl:text> + <xsl:text>attributes control the page sequences.
</xsl:text> + <xsl:text>
</xsl:text> + </xsl:if> + + <xsl:if test="contains(., '$Id: option_list.xsl')"> + +<xsl:text> +option list as list +====================== + +Since an option list can be rendered as either a traditonal list, or a +definition list, there are two sets of attribute sets. These attribute sets +are used for the options list when it is rendered as a list. + +</xsl:text> + + </xsl:if> + </xsl:template> + --> + + + + +</xsl:stylesheet> + diff --git a/sandbox/paultremblay/python_interface/docs/xsl/definition_list.xsl b/sandbox/paultremblay/python_interface/docs/xsl/definition_list.xsl new file mode 100644 index 000000000..7514bcb39 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/definition_list.xsl @@ -0,0 +1,129 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + + + <xsl:template match= "xsl:attribute-set[@name='definition-list-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">block</xsl:with-param> + <xsl:with-param name="docutils">definition_list</xsl:with-param> + </xsl:call-template> + <block> + For the definition list. Since this element contains all the other + blocks in the list, it can be used to set values such as + the font, background color, line-height, etc, for the entire list, + as well as the space after and before. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='definition-list-item-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">definition_list/definition_list_item</xsl:with-param> + </xsl:call-template> + <block> + For the items in the definition list. The attributes can control the + spacing between each item. A different set of attributes controls the spacing + of the first item (see below). + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='definition-list-item-first-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">definition_list/definition_list_item</xsl:with-param> + <xsl:with-param name="inherits">definition-list-item-block</xsl:with-param> + </xsl:call-template> + <block> + For the first item in the definition list. This attribute set inherits + all the properties form 'definition-list-item', and then re-defines the + space-before to 0pt. In order to get space between the first item and the + text before it, use the space-after attribute in the option-list attribute + set. + </block> + <block> + It does not makes sense to change this set direclty. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='definition-term-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">definition_list/definition_list_item/term</xsl:with-param> + </xsl:call-template> + <block> + Formats the bock of the the term. Can be used to control spacing + between term and definition, but don't use with space before, or you + won't be able to control spacing before list + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='definition-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">definition_list/definition_list_item/definition</xsl:with-param> + </xsl:call-template> + <block> + Formats the bock of the of the defintion, that wraps the paragraph blocks. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='definition-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">definition_list/definition_list_item/definition/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the blocks (paragraphs in the defintion. Can be lsed to control + the space between paragraphs by setting the space-bfore attribute. Don't + use the space-after attribute, or you won't be able to contorl the spacing + between items + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='definition-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">definition_list/definition_list_item/definition/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">definition-first-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + For the first paragraph in the definition list. This attribute set inherits + all the properties frorm 'definition-first-paragraph-block', and then re-defines the + space-before to 0pt. + </block> + <block> + It does not makes sense to change this set direclty. + </block> + </xsl:template> + + <!-- + <xsl:template match= "xsl:attribute-set[@name='definition-term-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">definition_list/definition_list_item/term</xsl:with-param> + </xsl:call-template> + <block> + For the inine properties of the term item. + </block> + </xsl:template> + --> + + <xsl:template match= "xsl:attribute-set[@name='classifier-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">definition_list/definition_list_item/classifier</xsl:with-param> + </xsl:call-template> + <block> + For the inine properties of the classifier item. + </block> + </xsl:template> + + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/document_parameters.xsl b/sandbox/paultremblay/python_interface/docs/xsl/document_parameters.xsl new file mode 100644 index 000000000..83533d01b --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/document_parameters.xsl @@ -0,0 +1,681 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:include href="comment.xsl"/> + <xsl:include href="utils.xsl"/> + + <xsl:output method="xml"/> + + <xsl:template match="xsl:stylesheet"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="/"> + <doc> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">1</xsl:with-param> + <xsl:with-param name="text">XSL-FO Documentation</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">2</xsl:with-param> + <xsl:with-param name="text">Parameters</xsl:with-param> + </xsl:call-template> + <block>.. contents:: Table of Contents</block> + <xsl:apply-templates/> + </doc> + </xsl:template> + + <xsl:template match="xsl:param[@name='page-layout']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>simple, first, odd-even, first-odd-even</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + This parameter determines the page layout for the document. A value of + ``simple`` will create a document with the same page layout for all + pages. A value of ``first`` creates a document with a dfferent page + layout for the first page and for the rest of the pages. A value of + ``odd-even`` creates a different layout for for odd and even pages. A value + of ``first-odd-even`` creates a different layout for the first page, for + odd pages, and for even pages. + </block> + <block> + Because restructured text only allows one footer and header, the footer and header + will be the same for bth odd and even pages. However, if the ``first`` or + ``first-odd-even`` values is chosen, you can suppress the first footer and + header (see below). + </block> + <block> + Using a value other than ``simple`` allows for different margins for different + page sequences, depending on the value. + </block> + </xsl:template> + + <!--not used anymore--> + <xsl:template match="xsl:param[@name='suppress-first-page-header']" priority = "3"/> + <xsl:template match="xsl:param[@name='suppress-first-page-header_old']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>True, False, ''</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + If set to True, and the ``page-layout`` is set to``first``, or ``page-layout`` + is set to ``first-odd-even``, no header will appear on the first page. If a value + of ``simple`` or ``odd-even`` is chosen for the ``page-layout``, this parameter will + have no effect, and the header will appear on all pages. + </block> + </xsl:template> + + <!--not used anymore--> + <xsl:template match="xsl:param[@name='suppress-first-page-footer']" priority = "3"/> + <xsl:template match="xsl:param[@name='suppress-first-page-footer_old']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>True, False, ''</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + If set to True, and the ``page-layout`` is set to ``first``, or ``page-layout`` + is set to ``first-odd-even``, no footer will appear on the first page. If a value + of ``simple`` or ``odd-even`` is chosen for the ``page-layout``, this parameter will + have no effect, and the footer will appear on all pages. + </block> + </xsl:template> + + + <!--not used anymore--> + <xsl:template match="xsl:param[@name='spacing-header']" priority = "3"/> + <xsl:template match="xsl:param[@name='spacing-header_old']" priority = "3"> + <xsl:call-template name="make-name"> + <xsl:with-param name="name">spacing-header and spacing-footer</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="possible-values"> + <xsl:with-param name="text" select="'Any Measure'"/> + </xsl:call-template> + <xsl:call-template name="p-defaults"/> + <block> + The parameters ``spacing-header`` and ``spacing-footer`` create the space for the + header and footer. Although the default is set to an empty string, the XSL + styelsheets will create a satisfactory space if a header or footer is found. Use + either of these parameters to change that default. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='spacing-footer']" priority = "3"/> + + <xsl:template match="xsl:param[@name='title-pagination']" priority = "3"> + <xsl:call-template name="make-name"> + <xsl:with-param name="name">pagination for front matter</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="possible-values"> + <xsl:with-param name="text" select="'with-front, with-toc, with-body'"/> + </xsl:call-template> + <block>**Defaults:** See below</block> + <block> + The function is the same for the following parameters: + </block> + <block>* title-pagination</block> + <block>* bibliographic-pagination</block> + <block>* dedication-pagination</block> + <block>* abstract-pagination</block> + <block>* toc-pagination</block> + <block> + Each determines what region to place the textual matter. There are + three regions, the front matter, the toc matter, and the body matter. The front + matter has no footers and headers. The toc matter starts a new page run, in which + the numbers start with 1 (or any other value), and can take any formatting. The + body matter again starts a new run of pages with its own page numbering and formatting + of these numbers. + </block> + <block> + In practice, the abstract and title page often occurr before the other front matter + material, and they appear on pages with no footers and headers. The dedication and Table + of Contents appear next, with the first numbering of the document, the numbers being + formatted as lower-case Roman numberals. The bibliographic information could appear + in either the front matter or toc matter. In order to achieve this standard layout, + the defaults choose a ``with-front`` for the ``title-pagination``, + ``abstract-pagination.``, and ``bibliographic-pagination; and a + ``with-toc`` for the ``toc-pagination`` and ``dedication-pagination``. + </block> + <block> + In order to change these defaults, choose a different value. For example, + to place the dedication in the front matter, set ``dedication-pagination`` to + ``with-front``. For a simple document, in which there is only one set of page runs, + simply set each of these parameters to ``with-body``. + + </block> + </xsl:template> + + + <xsl:template match="xsl:param[@name='bibliographic-pagination']| + xsl:param[@name='dedication-pagination']| xsl:param[@name='abstract-pagination']| + xsl:param[@name='toc-pagination'] " priority = "3"/> + + <xsl:template match="xsl:param[@name='front-order']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>title,bibliographic,dedication,abstract,toc</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + The param ``front-order`` is a string of each region, separated by a comma, + that determines the order of the title, the bibliographic + information, the dedication, the abstract, and the Table of Contents. The + default puts them in order that docutils puts them in when the document is + converted to XML. In order to change this, change the order in the string. + For example, to place the abstract before the dedication, use + ``'title,bibliographic,dedication,abstract,toc'`` as a value. + </block> + <block> + If you have a region in your parameter value that does not actually exist + in your document, no error will occurr. For example, if you set your value + to ``title,bibliographic,dedication,abstract,toc``, but have no ``title`` in + your document, the XSL stylesheet will still place the abstract before the dedication + without raising any error. + </block> + <block> + However, if you lack a region in your value that exists in the document, the + stylesheets will recognize this as an error, notifiy you, and quit. For eaxmple, + if your value is ``,bibliographic,dedication,abstract,toc``, and your document + contains a title, the processing will quit. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='author-text']" priority = "3"> + <xsl:call-template name="make-name"> + <xsl:with-param name="name">Bibliographic Field Names</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="possible-values"> + <xsl:with-param name="text" select="'Any Text'"/> + </xsl:call-template> + <block>**Defaults:** See below</block> + <block> + The function is the same for the following parameters: + </block> + <block>* author-text (default: Author: )</block> + <block>* authors-text (default: Authors: )</block> + <block>* organization-text (default: Organization: )</block> + <block>* contact-text (default: Contact: )</block> + <block>* status-text (default: Status: )</block> + <block>* copyright-text (default: Copyright: )</block> + <block>* address-text (default: Address: )</block> + <block>* version-text (default: Version: )</block> + <block>* revision-text (default: Revison: )</block> + <block>* date-text (default: Date: )</block> + <block> + Each parameter sets the text in the list for that particular bibliographic item. + For example if you wanted to change the default for ``contact`` from 'contact' to email, + you would simply set this value to 'email'. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='authors-text']| + xsl:param[@name='organization-text']| xsl:param[@name='contact-text']| + xsl:param[@name='status-text']| xsl:param[@name='copyright-text']| + xsl:param[@name='address-text']| xsl:param[@name='version-text']| + xsl:param[@name='revision-text']| xsl:param[@name='date-text'] " priority = "3"/> + + <xsl:template match="xsl:param[@name='attention-title']" priority = "3"> + <xsl:call-template name="make-name"> + <xsl:with-param name="name">Admonition Title Names</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="possible-values"> + <xsl:with-param name="text" select="'Any Text'"/> + </xsl:call-template> + <block>**Defaults:** See below</block> + <block> + The function is the same for the following parameters: + </block> + <block>* attention-title (default: Attention!)</block> + <block>* caution-title (default: Caution!)</block> + <block>* danger-title (default: !Danger!)</block> + <block>* error-title (default: Error)</block> + <block>* hint-title (default: Hint)</block> + <block>* important-title (default: Important)</block> + <block>* note-title (default: Note)</block> + <block>* tip-title (default: Tip)</block> + <block>* warning-title (default: Warning!)</block> + <block> + Each parameter sets the text for the title for that particular Admonition. + For example if you wanted to change the default for ``attention-title`` from + 'Important' to 'Pay Attention!', you would simply set this value to 'Pay Attnetion!'. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='caution-title']| xsl:param[@name='caution-title']| + xsl:param[@name='danger-title']| xsl:param[@name='error-title']| + xsl:param[@name='hint-title']| xsl:param[@name='important-title']| + xsl:param[@name='note-title']| xsl:param[@name='tip-title']| + xsl:param[@name='warning-title']" priority = "3"/> + + <xsl:template match="xsl:param[@name='transition-text']" priority = "3"> + <xsl:call-template name="make-name"> + <xsl:with-param name="name">transition-text</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="possible-values"> + <xsl:with-param name="text" select="'Any Text'"/> + </xsl:call-template> + <block>**Defaults:** \*\*\*</block> + <block> + The text to use for a transtion element. Use any text (including an empty + string) to change that value. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='number-section1']" priority = "3"> + <xsl:call-template name="make-name"> + <xsl:with-param name="name">Formatting of Section Numbering</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="possible-values"> + <xsl:with-param name="text" select="'Valid Number Formatting String'"/> + </xsl:call-template> + <block>**Defaults:** See below</block> + <block> + The function is the same for the following parameters: + </block> + <block>* number-section1 (default: 1)</block> + <block>* number-section2 (default: .1)</block> + <block>* number-section3 (default: .1)</block> + <block>* number-section4 (default: .1)</block> + <block>* number-section5 (default: .1)</block> + <block>* number-section6 (default: .1)</block> + <block>* number-section7 (default: .1)</block> + <block>* number-section8 (default: .1)</block> + <block>* number-section9 (default: .1)</block> + <block> + Each parameter sets the formatting (not the actual number) for that particular level. + The stylesheets allow for a great deal of flexibility here. For example, in + order to set a level 3 number format to '(II)3.b', you would set + ``number-section1`` to '(I)', ``number-section2`` to '.1' (the default, in this case, + meaning you woud not need to make a change), and ``number-section3`` to + '.a'. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='number-section2']| xsl:param[@name='number-section3']| + xsl:param[@name='number-section4']| xsl:param[@name='number-section5']| + xsl:param[@name='number-section6']| xsl:param[@name='number-section7']| + xsl:param[@name='number-section8']| xsl:param[@name='number-section9'] " + priority = "3"/> + + <xsl:template match="xsl:param[@name='inherit-section-num']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>True, False</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + If set to 'True', each section inherits the section numbering from the sections + above it. For example, section '1.1.2' will appear as '1.1.2'. If set to 'False', + the section number will appear as '2'. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='bullet-text']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>Any Text</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + Use to set the value for the bullets in a bullet list. If this string is left blank, + then the stylesheets will use the value in the XML. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='bullet-text-level2']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>Any Text</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + Use to set the value for the bullets in a nested bullet list. If this string is left blank, + then the stylesheets will use the value in the XML. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='options-separator']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>Any Text</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + Use to set the value for the text that separates the options in an option list. + For example, if your RST file has ``-f -file`` as the options, and you choose + ';' as the ``options-separator``, the output becomes ``-f; -file``. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='option-list-format']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>list, definition</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + Use to determine the formatting of an options list. If ``list`` is choosen, then + the options list is formatted as a traditional list, with the options to the left + and the description to the right. If ``definition`` is choosen, the options + list is formatted as a defintion list, with the options above the description, which + is indented. Lists with long options are probably better formatted using + ``definition.`` + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='number-verse']" priority = "3"> + <xsl:call-template name="make-name"> + <xsl:with-param name="name">number-verse</xsl:with-param> + </xsl:call-template> + <block>**Possible Values:** any positive integer, or ``''``</block> + <block>**Default:** 5</block> + <block> + When set, this parameter numbers a line block ("verse") every ``value`` lines. + The value of ``'5'`` numbers every 5th line. If ``number-verse`` is left + empty, the line block will not be numbered. + </block> + </xsl:template> + + + <xsl:template match="xsl:param[@name='text-before-block-quote-attribution']" priority = "3"> + <xsl:call-template name="make-name"> + <xsl:with-param name="name">Text Before Attributions</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="possible-values"> + <xsl:with-param name="text" select="'Any Text'"/> + </xsl:call-template> + <block>**Defaults:** —</block> + <block> + The function is the same for the following parameters: + </block> + <block>* text-before-block-quote-attribution</block> + <block>* text-before-epigraph-attribution</block> + <block>* text-before-pull-quote-attribution</block> + <block> + Each parameter determines the text before the attribution. When the parameter + is left empty, no text will appear before an attribution. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='text-before-epigraph-attribution']| + xsl:param[@name='text-before-pull-quote-attribution']" priority = "3"/> + + <xsl:template match="xsl:param[@name='table-title-placement']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>top, bottom</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + Where to place the table title, or caption. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='footnote-placement']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>footnote, endnote</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + This parameter determines whether footnotes will function as footnotes, + or endnotes. When ``footnote`` is choosen, footnotes appear at the + bottom of the page. When ``endnote`` is choosen, the *numbered* footnotes appear + as endnotes, in the same position where they are in the RST document. + If ``endnote`` is choosen, symbolic footnotes still appear as footnotes, + thus giving a user the ability to use both footnotes and endnotes. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='footnote-style']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>list, traditional</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + This parameter determines the style of the footnote or endnote text. + When ``'list'``, is choosen, the text is formatted as a list, + with the number as the item. When ``'traditional'`` is choosen, + the footnote appears in the more traditional manner, as a paragraph + with the first line indented. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='space-between-footnotes']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>Any Measure</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + Use to set the space between footnotes. (I have not determined how to set + this property in the normal way, which is why this property appears as + a parameter, rather than in an attribute set, like the other similar + properties.) + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='internal-link-type']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>link, page, page-link</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + When set to ``'page'``, the page number of the target appears. When + set to ``'link'``, the text of the link appears, and clicking on that + link takes you to the target. When set to ``'page-link'``, the page + of the target appears, and clicking on that page number takes you to + the target. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='bibliographic-format']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>list, normal, ''</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + Determines the formatting of the bibliographic info. When set to ``'list'`` + (the default), the bibliograhic fields will be formatted as a list. When set + to ``'normal'`` or ``''``, the each bibliographic field will be formatted + as a block. + </block> + </xsl:template> + + + <xsl:template match="xsl:param[@name='custom-bib-info1-name']" priority = "3"> + <xsl:call-template name="make-name"> + <xsl:with-param name="name">Custom bibliographic field names</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="possible-values"> + <xsl:with-param name="text" select="'Any Text'"/> + </xsl:call-template> + <block>**Defaults:** ''</block> + <block> + The function is the same for the following parameters: + </block> + <block>* custom-bib-info1-name</block> + <block>* custom-bib-info2-name</block> + <block>* custom-bib-info3-name</block> + <block>* custom-bib-info4-name</block> + <block>* custom-bib-info5-name</block> + <block>* custom-bib-info6-name</block> + <block>* custom-bib-info7-name</block> + <block>* custom-bib-info8-name</block> + <block>* custom-bib-info9-name</block> + <block>* custom-bib-info10-name</block> + <block> + Each parameter sets the value of the corresponding text for cutom bibliographic fields. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='custom-bib-info2-name']| + xsl:param[@name='custom-bib-info3-name']| + xsl:param[@name='custom-bib-info4-name']| + xsl:param[@name='custom-bib-info5-name']| + xsl:param[@name='custom-bib-info6-name']| + xsl:param[@name='custom-bib-info7-name']| + xsl:param[@name='custom-bib-info8-name']| + xsl:param[@name='custom-bib-info9-name']| + xsl:param[@name='custom-bib-info10-name'] " priority = "3"/> + + <xsl:template match="xsl:param[@name='table-cols']" priority = "3"> + <xsl:call-template name="make-name"> + <xsl:with-param name="name">Custom Table Columns</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="possible-values"> + <xsl:with-param name="text" select="'numbers separated by commas'"/> + </xsl:call-template> + <block>**Defaults:** ''</block> + <block> + The function is the same for the following parameters: + </block> + <block>* table-cols</block> + <block>* table-borderless-cols</block> + <block>* table-long-cols</block> + <block>* table1-cols</block> + <block>* table2-cols</block> + <block>* ...</block> + <block>* table30-cols</block> + <block> + Each parameter sets the columns for the table. ``'table-cols'`` sets the columns + for the default table; ``'table-borderless-cols'`` sets the columns for the + borderless table, and ``'table-long-cols'`` sets the columns for the long + table. There are also 30 custom tables, and the parameter for the columns is + ``'table1-cols'``, ``'table2-cols'`` ... ``'table30-cols'``. + </block> + <block> + Use these parameters to override the defualts created by rst2xml.py + </block> + + <block> + Use a value of numbers separated by commas. For example, a value of + ``'10,20,10'`` sets the first column to 10, the second to 20, and the + third to 10. That means the first and third columns will have the + same width, and the second will be twice as large as those. + </block> + </xsl:template> + + <xsl:template match="xsl:param[@name='table1-cols']| + xsl:param[@name='table2-cols']| + xsl:param[@name='table3-cols']| + xsl:param[@name='table4-cols']| + xsl:param[@name='table5-cols']| + xsl:param[@name='table6-cols']| + xsl:param[@name='table7-cols']| + xsl:param[@name='table8-cols']| + xsl:param[@name='table9-cols']| + xsl:param[@name='table10-cols']| + xsl:param[@name='table11-cols']| + xsl:param[@name='table12-cols']| + xsl:param[@name='table13-cols']| + xsl:param[@name='table14-cols']| + xsl:param[@name='table15-cols']| + xsl:param[@name='table16-cols']| + xsl:param[@name='table17-cols']| + xsl:param[@name='table18-cols']| + xsl:param[@name='table19-cols']| + xsl:param[@name='table20-cols']| + xsl:param[@name='table21-cols']| + xsl:param[@name='table22-cols']| + xsl:param[@name='table23-cols']| + xsl:param[@name='table24-cols']| + xsl:param[@name='table25-cols']| + xsl:param[@name='table26-cols']| + xsl:param[@name='table27-cols']| + xsl:param[@name='table28-cols']| + xsl:param[@name='table29-cols']| + xsl:param[@name='table30-cols']| + xsl:param[@name='table-borderless-cols']| + xsl:param[@name='table-long-cols'] " priority = "3"/> + + <xsl:template match="xsl:param[@name='long-rows-first-page']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>numbers separated by commas</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + + Use this property to set the number of rows you want on the first + page for a table with a class of ``'long'``. Only use if you desire + a different caption from that which appears on the first page. + + </block> + <block> + FO by itself cannot create different table headings or footings + from on subsequent pages. The stylesheets get around this + limitation by creating two tables, one which takes the first + heading (or footing), and one which takes the second. The user + must tell the stylesheets when to start the new table; the + stylesheets have no way of calcuating this on their own. + + </block> + <block> + Use numbers separated by commas for this parameter, where the first number + inidcatetes the first long table, the second the second table, and so on. For + example, a value of ``'8,10'`` tells the stylesheet to break the first *long* table + at 8 rows, and the second at 10 rows. + </block> + <block> + Leave this parameter empty, or set it to 0 in order to have the same caption on + all pages. + </block> + + </xsl:template> + + + + <xsl:template match="xsl:param[@name='custom-spacing-header-footer']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>boolean</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + Tells the stylesheets to use attributes of body and region-before that will determine + the spacing for the header. Normally, the stylesheets sets the area to .75in, if a + relevant header or footer is found. When ``'custom-spacing-header-footer'`` + is set to true, the stylesheets + won't try to generate any spacing, but will require these attributes to be set in + the relevant attribute sets. + </block> + </xsl:template> + + + <xsl:template match="xsl:param[@name='test']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>True, False, ''</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + For testing purposes only. + </block> + </xsl:template> + + + + <xsl:template match="xsl:param" priority="2"> + <xsl:message> + <xsl:text>no match for "</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>"</xsl:text> + </xsl:message> + </xsl:template> + + + <xsl:template match="@*|node()" /> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/document_stylesheet.xsl b/sandbox/paultremblay/python_interface/docs/xsl/document_stylesheet.xsl new file mode 100644 index 000000000..5c196896d --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/document_stylesheet.xsl @@ -0,0 +1,341 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:include href="root.xsl"/> + <xsl:include href="page.xsl"/> + <xsl:include href="bibliographic_fields.xsl"/> + <xsl:include href="front_matter.xsl"/> + <xsl:include href="header_footer.xsl"/> + <xsl:include href="toc.xsl"/> + <xsl:include href="section.xsl"/> + <xsl:include href="body_elements.xsl"/> + <xsl:include href="bullet_list.xsl"/> + <xsl:include href="enumerated_list.xsl"/> + <xsl:include href="option_list.xsl"/> + <xsl:include href="definition_list.xsl"/> + <xsl:include href="field_list.xsl"/> + <xsl:include href="line_block.xsl"/> + <xsl:include href="table.xsl"/> + <xsl:include href="table_extended.xsl"/> + <xsl:include href="table_extended2.xsl"/> + <xsl:include href="table_long.xsl"/> + <xsl:include href="footnote.xsl"/> + <xsl:include href="admonitions.xsl"/> + <xsl:include href="image_figure.xsl"/> + <xsl:include href="body_directives.xsl"/> + <xsl:include href="inline.xsl"/> + <xsl:include href="comment.xsl"/> + <xsl:include href="utils.xsl"/> + + <xsl:output method="xml"/> + + <xsl:template match="xsl:stylesheet"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="/"> + <doc> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">1</xsl:with-param> + <xsl:with-param name="text">XSL-FO Documentation</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">2</xsl:with-param> + <xsl:with-param name="text">Attribute Sets</xsl:with-param> + </xsl:call-template> + <block>.. contents:: Table of Contents</block> + + <!--root attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Root Attribute Sets</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets root elements. Use these attribute sets to format + the defaults in a document, such as font, font-size, or line-height. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/root.xsl')/xsl:stylesheet"/> + + <xsl:call-template name="make-title"> + <!--page attribute sets--> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Page Attribute Sets</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for page. These attributes control the formatting of + the actual pages: the paper size and margins. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/page.xsl')/xsl:stylesheet"/> + + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Bibliograhic Fields Attribute Sets</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the bibliograhic fields. These attributes control the formatting of + bibliographic fields. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/bibliographic_fields.xsl')/xsl:stylesheet"/> + + <!--front matter attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Front Matter Attribute Sets</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the dedication and abstract. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/front_matter.xsl')/xsl:stylesheet"/> + + <!--header footer--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Header and Footer Attribute Sets</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the headers and footers. Since headers and footers often need + very special formatting, the stylesheets allow for the formatting of up to three + paragraphs for each header and footer. The first refers to the first that occurrs in + the document, the second to the second, and the third to the third. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/header_footer.xsl')/xsl:stylesheet"/> + + <!--TOC attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">TOC Matter Attribute Sets</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the TOC. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/toc.xsl')/xsl:stylesheet"/> + + <!--Section attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Section Attribute Sets</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the section titles. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/section.xsl')/xsl:stylesheet"/> + + <!--body-element attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Body Elements</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for body elements, including the document title and subtitle; the + default paragraph; the transition element; and the literal block. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/body_elements.xsl')/xsl:stylesheet"/> + + <!--bullet-list attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">bullet list</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the bullet list. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/bullet_list.xsl')/xsl:stylesheet"/> + + <!--enumerated-list attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">enumerated list</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the enumerated list. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/enumerated_list.xsl')/xsl:stylesheet"/> + + <!--definition-list attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">definition list</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the definition list. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/definition_list.xsl')/xsl:stylesheet"/> + + <!--field-list attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">field list</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the field list. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/field_list.xsl')/xsl:stylesheet"/> + + <!--option-list attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">option list as list</xsl:with-param> + </xsl:call-template> + <block> + Since an option list can be rendered as either a traditonal list, or a + definition list, there are two sets of attribute sets. These attribute sets + are used for the options list when it is rendered as a list. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/option_list.xsl')/xsl:stylesheet"/> + + <!--line-block attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Line Block</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the line block. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/line_block.xsl')/xsl:stylesheet"/> + + <!--table attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Table</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the Table. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/table.xsl')/xsl:stylesheet"/> + + <!--table extended attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Table Extended</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the Extended Tables. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/table_extended.xsl')/xsl:stylesheet"/> + + <!--table extended 2 attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Table Extended 2 (Borderless)</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the Extended 2 (Borderless) Tables. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/table_extended2.xsl')/xsl:stylesheet"/> + + <!--table long attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Table Long</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the Long Tables. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/table_long.xsl')/xsl:stylesheet"/> + + + + + <!--footnote attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Footnote</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for footnotes, endnotes, and the endnotes title. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/footnote.xsl')/xsl:stylesheet"/> + + <!--admonitions attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Admonitions</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for Admonitions. By default, the admontioins have a + border around them. Each admonition gets its title from the parameter + of that name. For example, the danger admonitions title gets its title + from the 'danger-title' parameter, the caution from the `caution-title` + paramter, and so fourth. + </block> + <block> + Although each admonition and each admonition title has its own attribute-set, + by default they all inherit these values from two default attribute sets. (See + below.) Each of these areas can thus be customized. In contrast, all the paragrahs + in each admonition are identical. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/admonitions.xsl')/xsl:stylesheet"/> + + <!--image and figure attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Image and Figure</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for Images and Figures. The image property of + ``alt`` and ``target`` are ignored by the stylesheets, since + they have no use in PDF. In addtion, if the ``align`` is set + to ``top`` or ``bottom``, both properties that have no meaning + for PDF, the stylesheets will report an error, and if + ``strict`` is set to ``true``, quit. + </block> + + <block> + Likwise, the figure ``figwidth`` property will be ignored, since there + is not way to implement this property directy in FO. + </block> + <block> + In order to control the scaling, alignment, and width of images and + figures, it is better to use the attribute sets than to try to set these + properties in RST. The regions of 'image', 'figure', 'caption', and 'legend' + are all wrapped in blocks. Use the attribute sets for these blocks to control the + properties. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/image_figure.xsl')/xsl:stylesheet"/> + + <!--body_directive attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Body Elements Directives</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for Body Elements Directives. + </block> + + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/body_directives.xsl')/xsl:stylesheet"/> + + <!--option-inline attribute sets--> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">Inline</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for all the inline elements. The parameter 'footnote-style' + controls the style of the footnote. The paramater 'footnote-placement' determines + whether the footnotes that are numbered will be placed as footnotes or endnotes. + </block> + <block> + The parameter 'space-between-foototes' controls the space between footnotes. + (Becuase of a flaw(?) in FOP, an attribute set could not be used.) This parameter + has no effect on the space between endnotes. + </block> + <xsl:apply-templates select="document('../../docutilsToFo/xsl_fo/inline.xsl')/xsl:stylesheet"/> + </doc> + </xsl:template> + + <xsl:template match="xsl:attribute-set" priority="2"> + <xsl:message> + <xsl:text>no match for "</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>"</xsl:text> + </xsl:message> + </xsl:template> + + <xsl:template match="@*|node()"/> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/enumerated_list.xsl b/sandbox/paultremblay/python_interface/docs/xsl/enumerated_list.xsl new file mode 100644 index 000000000..32ab39147 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/enumerated_list.xsl @@ -0,0 +1,132 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + + + <xsl:template match= "xsl:attribute-set[@name='enumerated-list-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">list-block</xsl:with-param> + <xsl:with-param name="docutils">enumerated_list</xsl:with-param> + </xsl:call-template> + <block> + For the enumerated list. Since this element contains all the other list + elements, it can be used to set values such as the font, background color, + line-height, etc, for the entire list, as well as the space after and + before. + </block> + <block> + "The provisional-distance-between-starts property of the list-block + specifies the distance bewteen the start of the label (the bullet, for + example) and the actual start of the list content" (Pawson, 100) + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='enumerated-level2-list-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">list-block</xsl:with-param> + <xsl:with-param name="docutils">enumerated_list/enumerated_list</xsl:with-param> + </xsl:call-template> + <block> + Same as for the enumerated-list-block attribute. The default sets the + start-indent property to a greater value to indent this nested + list. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='enumerated-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">enumerated_list/list_item</xsl:with-param> + </xsl:call-template> + <block> + For the item in the enumerated list. The attributes can control the + spacing between each item. A different set of attributes controls the spacing + of the first item (see below). + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='enumerated-level2-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">enumerated_list/list_item/enumerated_list/list-item</xsl:with-param> + </xsl:call-template> + <block> + Same as above, but formats item of nested list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='enumerated-first-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">enumerated_list/list_item[1]</xsl:with-param> + <xsl:with-param name="inherits">enumerated-list-item</xsl:with-param> + </xsl:call-template> + <block> + For the first item in the enumerated list. This attribute set inherits + all the properties form 'enumerated-list-item', and then re-defines the + space-before to 0pt. In order to get space between the first item and the + text before it, use the space-after attribute in the enumerated-list attribute + set. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='enumerated-level2-first-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">enumerated_list/item/enumerated_list/list_item[1]</xsl:with-param> + <xsl:with-param name="inherits">enumerated-level2-list-item</xsl:with-param> + </xsl:call-template> + <block> + For the first item in the nested enumerated list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='enumerated-list-item-label']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-label</xsl:with-param> + <xsl:with-param name="docutils">enumerated_list/list_item</xsl:with-param> + </xsl:call-template> + <block> + The default attribute end-indent = "label-end()" ensures + that the label aligns properly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='enumerated-list-item-label-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">enumerated_list/list_item</xsl:with-param> + </xsl:call-template> + <block> + These attributes format the block that wraps the the number. (FO requires such + a block, even for a small label like this.) + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='enumerated-list-item-body']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-body</xsl:with-param> + <xsl:with-param name="docutils">enumerated_list/list_item</xsl:with-param> + </xsl:call-template> + <block> + The default of start-indent = "body-start()" ensures the correct + alignment of the labels. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='enumerated-list-item-body-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">enumerated_list/list_item/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the blocks (docutilis paragraphs) of the body of each item. + </block> + </xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/field_list.xsl b/sandbox/paultremblay/python_interface/docs/xsl/field_list.xsl new file mode 100644 index 000000000..4d80889b5 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/field_list.xsl @@ -0,0 +1,100 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='field-list-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">list-block</xsl:with-param> + <xsl:with-param name="docutils">field_list</xsl:with-param> + </xsl:call-template> + <block> + Formats the field list. Since this element contains all the other list + elements, it can be used to set values such as the font, background color, + line-height, etc, for the entire list, as well as the space after and + before. + </block> + <block> + "The provisional-distance-between-starts property of the list-block + specifies the distance bewteen the start of the label (the bullet, for + example) and the actual start of the list content" (Pawson, 100). + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='field-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">field_list/field</xsl:with-param> + </xsl:call-template> + <block> + For the items, or 'fields' in the field list. The attributes can control the + spacing between each item. A different set of attributes controls the spacing + of the first item (see below). + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='field-first-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">field_list/field[1]</xsl:with-param> + <xsl:with-param name="inherits">field-list-item</xsl:with-param> + </xsl:call-template> + <block> + For the first item in the field list. This attribute set inherits + all the properties form 'field-list-item', and then re-defines the + space-before to 0pt. In order to get space between the first item and the + text before it, use the space-after attribute in the field-list-block attribute + set. + </block> + <block> + It does not make sense to change this attriubte set directly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='field-list-item-label']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-label</xsl:with-param> + <xsl:with-param name="docutils">field_list/field/field_name</xsl:with-param> + </xsl:call-template> + <block> + The default attribute end-indent = "label-end()" ensures + that the label aligns properly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='field-list-item-label-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">field_list/field/field_name</xsl:with-param> + </xsl:call-template> + <block> + Formats the block that wraps the field name. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='field-list-item-body']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-body</xsl:with-param> + <xsl:with-param name="docutils">field_list/field/field_body</xsl:with-param> + </xsl:call-template> + <block> + The default of start-indent = "body-start()" ensures the correct + alignment of the labels. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='field-body-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">field_list/field/field_body/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the blocks (docutilis paragraphs) of the field. + </block> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/footnote.xsl b/sandbox/paultremblay/python_interface/docs/xsl/footnote.xsl new file mode 100644 index 000000000..5b4d0ee8e --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/footnote.xsl @@ -0,0 +1,204 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='default-footnote-label-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">None</xsl:with-param> + </xsl:call-template> + <block> + Sets of the defaults for the label (1, \*, etc), of each label. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footnote']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:footnote</xsl:with-param> + <xsl:with-param name="docutils">footnote</xsl:with-param> + </xsl:call-template> + <block> + Formats the footnote. By default, it sets properties to neutral, so + that it does not inherit any unwanted properties, such as from a + definition term. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footnote-separator-flow']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:flow</xsl:with-param> + <xsl:with-param name="docutils">footnote</xsl:with-param> + </xsl:call-template> + <block> + Formats the flow of the footnote. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footnote-separator-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">footnote</xsl:with-param> + </xsl:call-template> + <block> + Formats the block (with the leader) that separates the footnotes from the rest + of the page. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='footnote-label-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">footnote/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">default-footnote-label-inline</xsl:with-param> + </xsl:call-template> + <block> + Formats the label for *traditional* footnotes and endnotes at the bottomm of the page + or with the endnotes. This attribute set does not affect the label for footnotes and + endnotes formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footnote-body-label-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">footnote/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">default-footnote-label-inline</xsl:with-param> + </xsl:call-template> + <block> + Formats the label for *traditional* footnotes and endnotes in the body + of the text. This attribute set does not affect the label for footnotes and + endnotes formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footnote-list-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-block</xsl:with-param> + <xsl:with-param name="docutils">footnote</xsl:with-param> + </xsl:call-template> + <block> + Formats the list that contains the footnote. The 'provisional-distance-between-starts' + controls how far away the footnote label is from the text. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footnote-item-label']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-label</xsl:with-param> + <xsl:with-param name="docutils">footnote</xsl:with-param> + </xsl:call-template> + <block> + Formats the item-label when the footnote or endnote is formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footnote-label-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">footnote_reference</xsl:with-param> + </xsl:call-template> + <block> + Formats the block in item-label when the footnote or endnote is formatted as a list. + By default, the label has no superscript (as opposed to when formatting a + "traditional" footnote. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='footnote-item-body']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-body</xsl:with-param> + <xsl:with-param name="docutils">footnote</xsl:with-param> + </xsl:call-template> + <block> + Formats the item-body when the footnote or endnote is formatted as a list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footnote-body']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:footnote-body</xsl:with-param> + <xsl:with-param name="docutils">footnote</xsl:with-param> + </xsl:call-template> + <block> + Formats the body of the footnote. Space-after and space-before seem + to have no affect, at least with fop. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footnote-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">footnote/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs in the body of a footnote or endnote. Use the 'space-before' + to set the space between each paragraphs, for footnotes or endnotes + with multiple paragraphs. In addition, for traditional footnotes, use the + 'text-indent="18pt" to create a traditional footnote. (The deault does not + do this, in order to accommodate the footnote-as-a-list.) + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footnote-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">footnote/paragraph[1]</xsl:with-param> + <xsl:with-param name="inherits">footnote-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first paragraphs in the body of a footnote or endnote. It inherits + all the attributes from the 'footnote-paragraphs-block' and sets the space-before + to 0. It does not make sense to change attributes on this block directly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='endnotes-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">footnote</xsl:with-param> + </xsl:call-template> + <block> + The block that wraps all the other blocks of the endnotes. Use to create a + page break before, or to create space before and after the endnotes. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='endnote-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">footnote</xsl:with-param> + </xsl:call-template> + <block> + The block that wraps each individual endnote ('footnote' in docutils). Use + to control the spacing between each endnote. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='endnote-first-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">footnote</xsl:with-param> + <xsl:with-param name="inherits">endnote-block</xsl:with-param> + </xsl:call-template> + <block> + The block that wraps each the first endnote ('footnote' in docutils). It + does not make sense to change attributes on this set directly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='endnotes-title-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">rubric[@classes='endnotes']</xsl:with-param> + </xsl:call-template> + <block> + Formats the title for the endnotes, when one is present. + </block> + </xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/front_matter.xsl b/sandbox/paultremblay/python_interface/docs/xsl/front_matter.xsl new file mode 100644 index 000000000..c1a8e70b0 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/front_matter.xsl @@ -0,0 +1,94 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + + <xsl:template match= "xsl:attribute-set[@name='dedication-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "dedication"]</xsl:with-param> + </xsl:call-template> + <block> + Formats the dedication text, including the title and subsequent paragraphs, by + wrapping them in a block. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='abstract-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "abstract"]</xsl:with-param> + </xsl:call-template> + <block> + Formats the abstract text, including the title and subsequent paragraphs, by + wrapping them in a block. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='dedication-title-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "dedication"]/title</xsl:with-param> + </xsl:call-template> + <block> + Formats the title for the dedication. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='abstract-title-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "abstract"]/title</xsl:with-param> + </xsl:call-template> + <block> + Formats the abstract title. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='dedication-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "dedication"]/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs of the dedication. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='dedication-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "dedication"]/paragraph</xsl:with-param> + <xsl:with-param name="inherits">dedication-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first paragraph of the dedication. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='abstract-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "abstract"]/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs of the abstract. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='abstract-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "abstract"]/paragraph</xsl:with-param> + <xsl:with-param name="inherits">abstract-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first paragraph of the abstract. + </block> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/header_footer.xsl b/sandbox/paultremblay/python_interface/docs/xsl/header_footer.xsl new file mode 100644 index 000000000..60d3001b6 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/header_footer.xsl @@ -0,0 +1,261 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='header-first-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">decoration/header/paragraph[1]</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the first paragrah in the header. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='header-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">decoration/header</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the header. Use to set the space between + the header and the body text, using ``'space-before = x'`` + and setting ``'space-before.conditionality'`` to ``'retain'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">decoration/footer</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the footer. Use to set the space between + the header and the body text, using ``'space-before = x'`` + and setting ``'space-before.conditionality'`` to ``'retain'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='paragraph-header-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">decoration/footer/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the paragraphs in the header. Use to set the space between + the footer and the body text, using ``'space-before = x'`` + and setting ``'space-before.conditionality'`` to ``'retain'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='paragraph-footer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">decoration/footer/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the footer. Use to set the space between + the footer and the body text, using ``'space-before = x'`` + and setting ``'space-before.conditionality'`` to ``'retain'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='first-header-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='first-header']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the header for the first page. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='body-header-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='body-header']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the header of the body, when using a layout of + ``'first'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='odd-header-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='odd-header']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the header of odd pages, when using a layout of + ``'first-odd-even'``, or ``'odd-even'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='even-header-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='even-header']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the header of even pages, when using a layout of + ``'first-odd-even'``, or ``'odd-even'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='first-footer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='first-footer']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the footer for the first page. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='body-footer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='body-footer']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the footer of the body, when using a layout of + ``'first'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='odd-footer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='odd-footer']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the footer of odd pages, when using a layout of + ``'first-odd-even'``, or ``'odd-even'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='even-footer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='even-footer']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the footer of even pages, when using a layout of + ``'first-odd-even'``, or ``'odd-even'``. + </block> + + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='toc-first-header-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='toc-first-header']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the header for the first page of the TOC. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-body-header-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='toc-body-header']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the header of the body of the TOC, when using a layout of + ``'first'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-odd-header-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='toc-odd-header']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the header of odd pages of the TOC, when using a layout of + ``'first-odd-even'``, or ``'odd-even'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-even-header-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='toc-even-header']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the header of even pages of the TOC, when using a layout of + ``'first-odd-even'``, or ``'odd-even'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-first-footer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='toc-first-footer']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the footer for the first page of the TOC. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-body-footer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='toc-body-footer']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the footer of the body of the TOC, when using a layout of + ``'first'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-odd-footer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='toc-odd-footer']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the footer of odd pages of the TOC, when using a layout of + ``'first-odd-even'``, or ``'odd-even'``. + </block> + + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-even-footer-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">container[@classes='toc-even-footer']</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the for the footer of even pages of the TOC, when using a layout of + ``'first-odd-even'``, or ``'odd-even'``. + </block> + + </xsl:template> + + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/image_figure.xsl b/sandbox/paultremblay/python_interface/docs/xsl/image_figure.xsl new file mode 100644 index 000000000..5df2b02d2 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/image_figure.xsl @@ -0,0 +1,75 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + <xsl:template match= "xsl:attribute-set[@name='figure-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">figure</xsl:with-param> + </xsl:call-template> + <block> + Formats the block that wraps the figure. Use this attribute set to set + properties on the image, caption, and legend, as well as to set the space + before and after the figure. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='image-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">image</xsl:with-param> + </xsl:call-template> + <block> + Formats the block that wraps the image, both for an image by itself, and + for an image included in a figure. Use this attribute set to control the space + before and after the image, as well as to align the image itself. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='figure-caption-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">figure/caption</xsl:with-param> + </xsl:call-template> + <block> + Formats the block that wraps the caption. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='figure-legend-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">figure/legend</xsl:with-param> + </xsl:call-template> + <block> + Formats the block that wraps the legend. The paragrahs in the legend have + their own blocks. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='legend-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">figure/legend/paragaph</xsl:with-param> + </xsl:call-template> + <block> + Formats the block that wraps the paragraphs in the legend. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='legend-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">figure/legend/paragaph[1]</xsl:with-param> + <xsl:with-param name="inherits">legend-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first block that wraps the paragraphs in the legend. + </block> + </xsl:template> + + +</xsl:stylesheet> + diff --git a/sandbox/paultremblay/python_interface/docs/xsl/inline.xsl b/sandbox/paultremblay/python_interface/docs/xsl/inline.xsl new file mode 100644 index 000000000..80d304b4b --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/inline.xsl @@ -0,0 +1,58 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='emphasis-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">emphasis</xsl:with-param> + </xsl:call-template> + <block> + Formats the emphasis element. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='strong-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">strong</xsl:with-param> + </xsl:call-template> + <block> + Formats the strong element. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='basic-link-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">basic_link</xsl:with-param> + </xsl:call-template> + <block> + Formats the basic_link element. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='literal-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">literal</xsl:with-param> + </xsl:call-template> + <block> + Formats the literal element. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='title-reference-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">title-reference</xsl:with-param> + </xsl:call-template> + <block> + Formats the title_reference element. + </block> + </xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/line_block.xsl b/sandbox/paultremblay/python_interface/docs/xsl/line_block.xsl new file mode 100644 index 000000000..7fe6d7577 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/line_block.xsl @@ -0,0 +1,80 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='outer-line-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">line_block</xsl:with-param> + </xsl:call-template> + <block> + The outer block containing the blocks of lines. Use the outer block to + set space before or after the verse. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='level1-line-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">line_block/line</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the first level of lines. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='level2-line-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">line_block/line_block/line</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the second level of lines. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='level3-line-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">line_block/line_block/line_block/line</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the third level of lines. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='level4-line-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">line_block/line_block/line_block/line_block/line</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the fourth level of lines. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='level5-line-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">line_block/line_block/line_block/line_block/line_block/line</xsl:with-param> + </xsl:call-template> + <block> + Attribute sets for the fifth level of lines. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='stanza-title-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">line_block/title_reference</xsl:with-param> + </xsl:call-template> + <block> + Formats the title of a stanza. + </block> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/option_list.xsl b/sandbox/paultremblay/python_interface/docs/xsl/option_list.xsl new file mode 100644 index 000000000..59b95ad5c --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/option_list.xsl @@ -0,0 +1,250 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + + + <xsl:template match= "xsl:attribute-set[@name='option-list-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">list-block</xsl:with-param> + <xsl:with-param name="docutils">option_list</xsl:with-param> + </xsl:call-template> + <block> + For the option list. Since this element contains all the other list + elements, it can be used to set values such as the font, background color, + line-height, etc, for the entire list, as well as the space after and + before. + </block> + <block> + "The provisional-distance-between-starts property of the list-block + specifies the distance bewteen the start of the label (the bullet, for + example) and the actual start of the list content" (Pawson, 100) + </block> + + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='option-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item</xsl:with-param> + </xsl:call-template> + <block> + For the items in the option list. The attributes can control the + spacing between each item. A different set of attributes controls the spacing + of the first item (see below). + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-first-list-item']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item[1]</xsl:with-param> + <xsl:with-param name="inherits">option-list-item</xsl:with-param> + </xsl:call-template> + <block> + For the first item in the option list. This attribute set inherits + all the properties form 'option-list-item', and then re-defines the + space-before to 0pt. In order to get space between the first item and the + text before it, use the space-after attribute in the option-list attribute + set. + </block> + <block> + It does not make sense to change this attriubte set directly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-list-item-label']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-label</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item/option_group</xsl:with-param> + </xsl:call-template> + <block> + The default attribute end-indent = "label-end()" ensures + that the label aligns properly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-list-item-label-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item/option_group/option_string|option_argument</xsl:with-param> + </xsl:call-template> + <block> + These attributes format the block that wraps the option_string and + option_argument. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item/option_group/option/option_string</xsl:with-param> + </xsl:call-template> + <block> + Used to format any inline properties of the option_string. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-argument-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item/option_group/option/option_argument</xsl:with-param> + </xsl:call-template> + <block> + Used to format any inline properties of the option_string. + </block> + </xsl:template> + + + + <xsl:template match= "xsl:attribute-set[@name='option-list-item-body']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:list-item-body</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item/description</xsl:with-param> + </xsl:call-template> + <block> + The default of start-indent = "body-start()" ensures the correct + alignment of the labels. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-list-item-body-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item/description/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the blocks (docutilis paragraphs) that describe the + options. If there was more than one paragraph, you could use attributes + such as space after. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-list-definition-block']" priority="3"> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text">option list as definition list</xsl:with-param> + </xsl:call-template> + <block> + These attribute sets are used for the options list when it is rendered as a + definition list. (See the docutils reference guide for an example of a + definition list, or see the defintion list in the test files.) + </block> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">option_list</xsl:with-param> + </xsl:call-template> + <block> + Formats the block that wraps the other blocks. Use to control + space after and before, or to set any block items on the entire list. + </block> + <block> + This block wraps around another block, which in turn wraps around a third + block. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-list-item-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item</xsl:with-param> + </xsl:call-template> + <block> + Formats the block that wraps the options and descriptions, which are also blocks. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-list-first-item-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item</xsl:with-param> + </xsl:call-template> + <block> + Same as for option-list-item-block, but sets the space-before to 0pt + </block> + <block> + Does not make sense to change the attributes here directly. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-list-item-first-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item</xsl:with-param> + <xsl:with-param name="inherits">option-list-definition-item-block</xsl:with-param> + </xsl:call-template> + <block> + The same as the option-list-definition-item-block, except these attributes + format the first item. By default, this attribute set inherits the attributes from + the option-list-definition-item-block, and then re-defines the space-before to 0pt. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='option-group-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">option_list_item/option_list_item/option_group</xsl:with-param> + </xsl:call-template> + <block> + Formats the block that contains the inline elements of the options and arguments. + For a defintion list, this block serves as the term, and sits on top, and to the left + of the description. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-list-description-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item/description</xsl:with-param> + </xsl:call-template> + <block> + + Formats the blocks wrappring the paragraphs describing the options + or arguments. This groups of blocks sits below the blocks + formatting the options and arguments, and in a defintion list are + usually indented right. + + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-list-description-first-block']" + priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item/description[1]</xsl:with-param> + <xsl:with-param name="inherits">option-list-description-block</xsl:with-param> + </xsl:call-template> + <block> + + Same as above, except formats the first such element. + + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-list-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item/description/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Formats the paragraphs in the description for an options list formatted as a definition list. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='option-list-first-paragraph-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">option_list/option_list_item/description/paragraph</xsl:with-param> + <xsl:with-param name="inherits">option-list-paragraph-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the first paragraph in the description for an options list formatted as a definition list. + </block> + </xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/page.xsl b/sandbox/paultremblay/python_interface/docs/xsl/page.xsl new file mode 100644 index 000000000..fe769404b --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/page.xsl @@ -0,0 +1,114 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + + <xsl:template match= "xsl:attribute-set[@name='paper-size-simple-page-master']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">None</xsl:with-param> + <xsl:with-param name="docutils">/</xsl:with-param> + </xsl:call-template> + <block> + Sets up the defaults for the paper size, used in other attribute sets. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='default-simple-page-master']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">None</xsl:with-param> + <xsl:with-param name="docutils">/</xsl:with-param> + </xsl:call-template> + <block> + Sets up the defaults for the margins of the fo:body-region for all the pages. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='simple-page-master']" priority="3"> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">5</xsl:with-param> + <xsl:with-param name="text">Simple Page Master Sets</xsl:with-param> + </xsl:call-template> + + <block> + <xsl:text>:fo: fo:simple-page-master</xsl:text> + </block> + <block first-line-indent="-9"> + <xsl:text>:docutils: /</xsl:text> + </block> + <block first-line-indent="-9"> + <xsl:text>:inherits: paper-size, default-page-setup</xsl:text> + </block> + <block> + The following attribute sets are identical: + </block> + <block>- simple-page-master</block> + <block>- first-simple-page-master</block> + <block>- body-simpe-page-master</block> + <block>- odd-simple-page-master</block> + <block>- even-simple-page-master</block> + <block>- toc-simple-page-master</block> + <block>- toc-first-simple-page-master</block> + <block>- toc-body-simple-page-master</block> + <block>- toc-odd-simple-page-master</block> + <block>- toc-even-simple-page-master</block> + <block>- front-simple-page-master</block> + <block>- front-first-simple-page-master</block> + <block>- front-body-simple-page-master</block> + <block>- front-odd-simple-page-master</block> + <block>- front-even-simple-page-master</block> + <block> + These attriute sets format the margins of the + fo:simple-page-master. By default, they inherit the + ``'paper-size-simple-page-master'`` and + ``'default-simple-page-master'`` attriute-sets, meaning each page + will have identical size and margins, a satisfactory setup for + many documents. However, the sizes and margins can be modified by + page type, if desired. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='first-simple-page-master']| + xsl:attribute-set[@name='body-simple-page-master']| + xsl:attribute-set[@name='odd-simple-page-master']| + xsl:attribute-set[@name='even-simple-page-master']| + xsl:attribute-set[@name='toc-simple-page-master']| + xsl:attribute-set[@name='toc-first-simple-page-master']| + xsl:attribute-set[@name='toc-body-simple-page-master']| + xsl:attribute-set[@name='toc-odd-simple-page-master']| + xsl:attribute-set[@name='toc-even-simple-page-master']| + xsl:attribute-set[@name='front-simple-page-master']| + xsl:attribute-set[@name='front-first-simple-page-master']| + xsl:attribute-set[@name='front-body-simple-page-master']| + xsl:attribute-set[@name='front-odd-simple-page-master']| + xsl:attribute-set[@name='front-even-simple-page-master'] + " + priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='header-region-before']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:region-before</xsl:with-param> + <xsl:with-param name="docutils">decoration/header</xsl:with-param> + </xsl:call-template> + <block> + The extent attribute specifies the header and footer height. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='footer-region-after']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:region-after</xsl:with-param> + <xsl:with-param name="docutils">decoration/footer</xsl:with-param> + </xsl:call-template> + <block> + The extent attribute specifies the header and footer height. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='front-matter-region-body']| + xsl:attribute-set[@name='region-body']" priority="3"/> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/root.xsl b/sandbox/paultremblay/python_interface/docs/xsl/root.xsl new file mode 100644 index 000000000..f7af3afc9 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/root.xsl @@ -0,0 +1,104 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='default-page-sequence']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:page-sequence</xsl:with-param> + <xsl:with-param name="docutils">document</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the all of the document. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='front-page-sequence']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:page-sequence</xsl:with-param> + <xsl:with-param name="docutils">document</xsl:with-param> + <xsl:with-param name="inherits">default-page-sequence</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the complete run of pages, in this case, the front matter. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-page-sequence']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:page-sequence</xsl:with-param> + <xsl:with-param name="docutils">document</xsl:with-param> + <xsl:with-param name="inherits">default-page-sequence</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the complete run of pages, in this case, the toc and any + pages associated with it. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='body-page-sequence']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:page-sequence</xsl:with-param> + <xsl:with-param name="docutils">document</xsl:with-param> + <xsl:with-param name="inherits">default-page-sequence</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties for the complete run of pages, in this case, the body. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='default-flow']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:flow</xsl:with-param> + <xsl:with-param name="docutils">document</xsl:with-param> + </xsl:call-template> + <block> + Sets up the default attributes for the front-flow, toc-flow, + and body-flow + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='front-flow']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:flow</xsl:with-param> + <xsl:with-param name="docutils">document</xsl:with-param> + <xsl:with-param name="inherits">default-flow</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties of the body in the front sequence of pages. Since + the front sequence has no headers and footers, that means everything. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-flow']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:flow</xsl:with-param> + <xsl:with-param name="docutils">document</xsl:with-param> + <xsl:with-param name="inherits">default-flow</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties of the body in the toc sequence of pages, which + means everything except headers and footers. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='body-flow']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:flow</xsl:with-param> + <xsl:with-param name="docutils">document</xsl:with-param> + <xsl:with-param name="inherits">default-flow</xsl:with-param> + </xsl:call-template> + <block> + Formats the properties of the body in the body sequence of pages, which + means everything except headers and footers. + </block> + </xsl:template> + + + + +</xsl:stylesheet> + diff --git a/sandbox/paultremblay/python_interface/docs/xsl/section.xsl b/sandbox/paultremblay/python_interface/docs/xsl/section.xsl new file mode 100644 index 000000000..9d73d7b1b --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/section.xsl @@ -0,0 +1,72 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='default-section-title-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">None</xsl:with-param> + <xsl:with-param name="docutils">None</xsl:with-param> + </xsl:call-template> + <block> + Sets up the defaults for the section titles. The title should always have some text beneath it + to avoid widows and orphans; hence the keep-with-always property. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='title-level1-block']" priority="3"> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">5</xsl:with-param> + <xsl:with-param name="text">title-level-block</xsl:with-param> + </xsl:call-template> + <block> + <xsl:text>:fo: fo:block</xsl:text> + </block> + <block first-line-indent="-9"> + <xsl:text>:docutils: section/title|section/section/title|etc.</xsl:text> + </block> + <block first-line-indent="-9"> + <xsl:text>:inherits: default-section-title-block</xsl:text> + </block> + <block> + The following attribute sets are identical in nature: + </block> + <block>- title-level1-block</block> + <block>- title-level2-block</block> + <block>- title-level3-block</block> + <block>- title-level4-block</block> + <block>- title-level5-block</block> + <block>- title-level6-block</block> + <block>- title-level7-block</block> + <block>- title-level8-block</block> + <block>- title-level9-block</block> + <block> + These attribute-sets format the titles of all sections. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='title-level2-block']| + xsl:attribute-set[@name='title-level3-block']| + xsl:attribute-set[@name='title-level4-block']| + xsl:attribute-set[@name='title-level5-block']| + xsl:attribute-set[@name='title-level6-block']| + xsl:attribute-set[@name='title-level7-block']| + xsl:attribute-set[@name='title-level8-block']| + xsl:attribute-set[@name='title-level9-block']" + + priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='title-number-inline']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:inline</xsl:with-param> + <xsl:with-param name="docutils">section/title/generated[@classes="sectnum]"</xsl:with-param> + </xsl:call-template> + <block> + Formats the title number generated by docutils. + </block> + </xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/table.xsl b/sandbox/paultremblay/python_interface/docs/xsl/table.xsl new file mode 100644 index 000000000..41b64adf8 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/table.xsl @@ -0,0 +1,147 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='table-block-container']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block-container</xsl:with-param> + <xsl:with-param name="docutils">table</xsl:with-param> + </xsl:call-template> + <block> + Formats the block container that wraps bothe the table and a the table title (captin) + if one exists. Use to control space before and after the table. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='table']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:table</xsl:with-param> + <xsl:with-param name="docutils">table</xsl:with-param> + </xsl:call-template> + <block> + Formats the table. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='table-header']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:table-header</xsl:with-param> + <xsl:with-param name="docutils">tgroup/thead</xsl:with-param> + </xsl:call-template> + <block> + Formats the header of the table. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='default-cell']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:cell</xsl:with-param> + <xsl:with-param name="docutils">None</xsl:with-param> + </xsl:call-template> + <block> + Sets the defaults for all cells. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='table-header-cell']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:cell</xsl:with-param> + <xsl:with-param name="docutils">thead/row/entry</xsl:with-param> + <xsl:with-param name="inherits">default-cell</xsl:with-param> + </xsl:call-template> + <block> + Formats the cells in the table header. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='thead-borderless-cell_old']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:cell</xsl:with-param> + <xsl:with-param name="docutils">thead/row/entry</xsl:with-param> + </xsl:call-template> + <block> + Formats the cells in the table header for a borderless table. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='table-body']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:table-body</xsl:with-param> + <xsl:with-param name="docutils">tbody</xsl:with-param> + </xsl:call-template> + <block> + Attributes for the table body. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='table-row']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:table-row</xsl:with-param> + <xsl:with-param name="docutils">tbody/row</xsl:with-param> + </xsl:call-template> + <block> + Attributes for the table row. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='table-cell']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:table-cell</xsl:with-param> + <xsl:with-param name="docutils">tbody/row/entry</xsl:with-param> + <xsl:with-param name="inherits">default-cell</xsl:with-param> + </xsl:call-template> + <block> + Attributes for the table cell. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='table-cell-borderless_old']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:table-cell</xsl:with-param> + <xsl:with-param name="docutils">tbody/row/entry</xsl:with-param> + </xsl:call-template> + <block> + Attributes for the table cell for borderless table. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='cell-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">tbody/row/entry/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Attributes for the paragraphs in the cell. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='table-header-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">thead/row/entry/paragraph</xsl:with-param> + </xsl:call-template> + <block> + Attributes for the paragraphs in the header cell. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='caption-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">table/title</xsl:with-param> + </xsl:call-template> + <block> + Attributes for the table title, or caption. The parameter 'table-title-placement', + controls whether this block is placed before or after the table. If it is placed + on top of the table, it has a 'keep-with-next="always"' value that cannot be changed. + If this block is placed on the bottom it has a 'keep-with-previous="always"' value + that cannot be changed. + </block> + </xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/table_extended.xsl b/sandbox/paultremblay/python_interface/docs/xsl/table_extended.xsl new file mode 100644 index 000000000..9a7c1d4b3 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/table_extended.xsl @@ -0,0 +1,368 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='table1-block-container']" priority="3"> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">5</xsl:with-param> + <xsl:with-param name="text">Custom Tables</xsl:with-param> + </xsl:call-template> + <block> + <xsl:text>:fo: See below</xsl:text> + </block> + <block first-line-indent="-9"> + <xsl:text>:docutils: See below</xsl:text> + </block> + <block> + + The table_extend.xsl contains templates to match 30 custom tables, + and and attribute sets for each of these tables. Each attribute set has + has the same function as its corresponding attribute set in the regular + table, as documented above. + + </block> + + <block>* table1-block-container => table-block-contanter</block> + <block>* table1 => table</block> + <block>* table1-header => table-header</block> + <block>* table1-header-cell => table-header-cell</block> + <block>* table1-header-block => table-header-block</block> + <block>* table1-body => table-body</block> + <block>* table1-header-row => table-header-row</block> + <block>* table1-row => table-row</block> + <block>* table1-cell => table-cell</block> + <block>* cell1-block => cell-block</block> + <block>* table2-block-container => table-block-contanter</block> + <block>* table2 => table</block> + <block>* ... </block> + <block>* table2-row => table-row</block> + <block>* table2-cell => table-cell</block> + <block>* cell2-block => cell-block</block> + <block>* ... </block> + <block>* table30-block-container => table-block-contanter</block> + <block>* table30 => table</block> + <block>* table30-header => table-header</block> + <block>* table30-header-cell => table-header-cell</block> + <block>* table30-header-block => table-header-block</block> + <block>* table30-body => table-body</block> + <block>* table30-header-row => table-header-row</block> + <block>* table30-row => table-row</block> + <block>* table30-cell => table-cell</block> + <block>* cell30-block => cell-block</block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='table2-block-container']| + xsl:attribute-set[@name='table3-block-container']| + xsl:attribute-set[@name='table4-block-container']| + xsl:attribute-set[@name='table5-block-container']| + xsl:attribute-set[@name='table6-block-container']| + xsl:attribute-set[@name='table7-block-container']| + xsl:attribute-set[@name='table8-block-container']| + xsl:attribute-set[@name='table9-block-container']| + xsl:attribute-set[@name='table10-block-container']| + xsl:attribute-set[@name='table11-block-container']| + xsl:attribute-set[@name='table12-block-container']| + xsl:attribute-set[@name='table13-block-container']| + xsl:attribute-set[@name='table14-block-container']| + xsl:attribute-set[@name='table15-block-container']| + xsl:attribute-set[@name='table16-block-container']| + xsl:attribute-set[@name='table17-block-container']| + xsl:attribute-set[@name='table18-block-container']| + xsl:attribute-set[@name='table19-block-container']| + xsl:attribute-set[@name='table20-block-container']| + xsl:attribute-set[@name='table21-block-container']| + xsl:attribute-set[@name='table22-block-container']| + xsl:attribute-set[@name='table23-block-container']| + xsl:attribute-set[@name='table24-block-container']| + xsl:attribute-set[@name='table25-block-container']| + xsl:attribute-set[@name='table26-block-container']| + xsl:attribute-set[@name='table27-block-container']| + xsl:attribute-set[@name='table28-block-container']| + xsl:attribute-set[@name='table29-block-container']| + xsl:attribute-set[@name='table30-block-container']" priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='table1']| + xsl:attribute-set[@name='table2']| + xsl:attribute-set[@name='table3']| + xsl:attribute-set[@name='table4']| + xsl:attribute-set[@name='table5']| + xsl:attribute-set[@name='table6']| + xsl:attribute-set[@name='table7']| + xsl:attribute-set[@name='table8']| + xsl:attribute-set[@name='table9']| + xsl:attribute-set[@name='table10']| + xsl:attribute-set[@name='table11']| + xsl:attribute-set[@name='table12']| + xsl:attribute-set[@name='table13']| + xsl:attribute-set[@name='table14']| + xsl:attribute-set[@name='table15']| + xsl:attribute-set[@name='table16']| + xsl:attribute-set[@name='table17']| + xsl:attribute-set[@name='table18']| + xsl:attribute-set[@name='table19']| + xsl:attribute-set[@name='table20']| + xsl:attribute-set[@name='table21']| + xsl:attribute-set[@name='table22']| + xsl:attribute-set[@name='table23']| + xsl:attribute-set[@name='table24']| + xsl:attribute-set[@name='table25']| + xsl:attribute-set[@name='table26']| + xsl:attribute-set[@name='table27']| + xsl:attribute-set[@name='table28']| + xsl:attribute-set[@name='table29']| + xsl:attribute-set[@name='table30']" priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='table1-header']| + xsl:attribute-set[@name='table2-header']| + xsl:attribute-set[@name='table3-header']| + xsl:attribute-set[@name='table4-header']| + xsl:attribute-set[@name='table5-header']| + xsl:attribute-set[@name='table6-header']| + xsl:attribute-set[@name='table7-header']| + xsl:attribute-set[@name='table8-header']| + xsl:attribute-set[@name='table9-header']| + xsl:attribute-set[@name='table10-header']| + xsl:attribute-set[@name='table11-header']| + xsl:attribute-set[@name='table12-header']| + xsl:attribute-set[@name='table13-header']| + xsl:attribute-set[@name='table14-header']| + xsl:attribute-set[@name='table15-header']| + xsl:attribute-set[@name='table16-header']| + xsl:attribute-set[@name='table17-header']| + xsl:attribute-set[@name='table18-header']| + xsl:attribute-set[@name='table19-header']| + xsl:attribute-set[@name='table20-header']| + xsl:attribute-set[@name='table21-header']| + xsl:attribute-set[@name='table22-header']| + xsl:attribute-set[@name='table23-header']| + xsl:attribute-set[@name='table24-header']| + xsl:attribute-set[@name='table25-header']| + xsl:attribute-set[@name='table26-header']| + xsl:attribute-set[@name='table27-header']| + xsl:attribute-set[@name='table28-header']| + xsl:attribute-set[@name='table29-header']| + xsl:attribute-set[@name='table30-header']" priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='table1-header-cell']| + xsl:attribute-set[@name='table2-header-cell']| + xsl:attribute-set[@name='table3-header-cell']| + xsl:attribute-set[@name='table4-header-cell']| + xsl:attribute-set[@name='table5-header-cell']| + xsl:attribute-set[@name='table6-header-cell']| + xsl:attribute-set[@name='table7-header-cell']| + xsl:attribute-set[@name='table8-header-cell']| + xsl:attribute-set[@name='table9-header-cell']| + xsl:attribute-set[@name='table10-header-cell']| + xsl:attribute-set[@name='table11-header-cell']| + xsl:attribute-set[@name='table12-header-cell']| + xsl:attribute-set[@name='table13-header-cell']| + xsl:attribute-set[@name='table14-header-cell']| + xsl:attribute-set[@name='table15-header-cell']| + xsl:attribute-set[@name='table16-header-cell']| + xsl:attribute-set[@name='table17-header-cell']| + xsl:attribute-set[@name='table18-header-cell']| + xsl:attribute-set[@name='table19-header-cell']| + xsl:attribute-set[@name='table20-header-cell']| + xsl:attribute-set[@name='table21-header-cell']| + xsl:attribute-set[@name='table22-header-cell']| + xsl:attribute-set[@name='table23-header-cell']| + xsl:attribute-set[@name='table24-header-cell']| + xsl:attribute-set[@name='table25-header-cell']| + xsl:attribute-set[@name='table26-header-cell']| + xsl:attribute-set[@name='table27-header-cell']| + xsl:attribute-set[@name='table28-header-cell']| + xsl:attribute-set[@name='table29-header-cell']| + xsl:attribute-set[@name='table30-header-cell']" priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='table1-header-block']| + xsl:attribute-set[@name='table2-header-block']| + xsl:attribute-set[@name='table3-header-block']| + xsl:attribute-set[@name='table4-header-block']| + xsl:attribute-set[@name='table5-header-block']| + xsl:attribute-set[@name='table6-header-block']| + xsl:attribute-set[@name='table7-header-block']| + xsl:attribute-set[@name='table8-header-block']| + xsl:attribute-set[@name='table9-header-block']| + xsl:attribute-set[@name='table10-header-block']| + xsl:attribute-set[@name='table11-header-block']| + xsl:attribute-set[@name='table12-header-block']| + xsl:attribute-set[@name='table13-header-block']| + xsl:attribute-set[@name='table14-header-block']| + xsl:attribute-set[@name='table15-header-block']| + xsl:attribute-set[@name='table16-header-block']| + xsl:attribute-set[@name='table17-header-block']| + xsl:attribute-set[@name='table18-header-block']| + xsl:attribute-set[@name='table19-header-block']| + xsl:attribute-set[@name='table20-header-block']| + xsl:attribute-set[@name='table21-header-block']| + xsl:attribute-set[@name='table22-header-block']| + xsl:attribute-set[@name='table23-header-block']| + xsl:attribute-set[@name='table24-header-block']| + xsl:attribute-set[@name='table25-header-block']| + xsl:attribute-set[@name='table26-header-block']| + xsl:attribute-set[@name='table27-header-block']| + xsl:attribute-set[@name='table28-header-block']| + xsl:attribute-set[@name='table29-header-block']| + xsl:attribute-set[@name='table30-header-block']" priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='table1-body']| + xsl:attribute-set[@name='table2-body']| + xsl:attribute-set[@name='table3-body']| + xsl:attribute-set[@name='table4-body']| + xsl:attribute-set[@name='table5-body']| + xsl:attribute-set[@name='table6-body']| + xsl:attribute-set[@name='table7-body']| + xsl:attribute-set[@name='table8-body']| + xsl:attribute-set[@name='table9-body']| + xsl:attribute-set[@name='table10-body']| + xsl:attribute-set[@name='table11-body']| + xsl:attribute-set[@name='table12-body']| + xsl:attribute-set[@name='table13-body']| + xsl:attribute-set[@name='table14-body']| + xsl:attribute-set[@name='table15-body']| + xsl:attribute-set[@name='table16-body']| + xsl:attribute-set[@name='table17-body']| + xsl:attribute-set[@name='table18-body']| + xsl:attribute-set[@name='table19-body']| + xsl:attribute-set[@name='table20-body']| + xsl:attribute-set[@name='table21-body']| + xsl:attribute-set[@name='table22-body']| + xsl:attribute-set[@name='table23-body']| + xsl:attribute-set[@name='table24-body']| + xsl:attribute-set[@name='table25-body']| + xsl:attribute-set[@name='table26-body']| + xsl:attribute-set[@name='table27-body']| + xsl:attribute-set[@name='table28-body']| + xsl:attribute-set[@name='table29-body']| + xsl:attribute-set[@name='table30-body']" priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='table1-header-row']| + xsl:attribute-set[@name='table2-header-row']| + xsl:attribute-set[@name='table3-header-row']| + xsl:attribute-set[@name='table4-header-row']| + xsl:attribute-set[@name='table5-header-row']| + xsl:attribute-set[@name='table6-header-row']| + xsl:attribute-set[@name='table7-header-row']| + xsl:attribute-set[@name='table8-header-row']| + xsl:attribute-set[@name='table9-header-row']| + xsl:attribute-set[@name='table10-header-row']| + xsl:attribute-set[@name='table11-header-row']| + xsl:attribute-set[@name='table12-header-row']| + xsl:attribute-set[@name='table13-header-row']| + xsl:attribute-set[@name='table14-header-row']| + xsl:attribute-set[@name='table15-header-row']| + xsl:attribute-set[@name='table16-header-row']| + xsl:attribute-set[@name='table17-header-row']| + xsl:attribute-set[@name='table18-header-row']| + xsl:attribute-set[@name='table19-header-row']| + xsl:attribute-set[@name='table20-header-row']| + xsl:attribute-set[@name='table21-header-row']| + xsl:attribute-set[@name='table22-header-row']| + xsl:attribute-set[@name='table23-header-row']| + xsl:attribute-set[@name='table24-header-row']| + xsl:attribute-set[@name='table25-header-row']| + xsl:attribute-set[@name='table26-header-row']| + xsl:attribute-set[@name='table27-header-row']| + xsl:attribute-set[@name='table28-header-row']| + xsl:attribute-set[@name='table29-header-row']| + xsl:attribute-set[@name='table30-header-row']" priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='table1-row']| + xsl:attribute-set[@name='table2-row']| + xsl:attribute-set[@name='table3-row']| + xsl:attribute-set[@name='table4-row']| + xsl:attribute-set[@name='table5-row']| + xsl:attribute-set[@name='table6-row']| + xsl:attribute-set[@name='table7-row']| + xsl:attribute-set[@name='table8-row']| + xsl:attribute-set[@name='table9-row']| + xsl:attribute-set[@name='table10-row']| + xsl:attribute-set[@name='table11-row']| + xsl:attribute-set[@name='table12-row']| + xsl:attribute-set[@name='table13-row']| + xsl:attribute-set[@name='table14-row']| + xsl:attribute-set[@name='table15-row']| + xsl:attribute-set[@name='table16-row']| + xsl:attribute-set[@name='table17-row']| + xsl:attribute-set[@name='table18-row']| + xsl:attribute-set[@name='table19-row']| + xsl:attribute-set[@name='table20-row']| + xsl:attribute-set[@name='table21-row']| + xsl:attribute-set[@name='table22-row']| + xsl:attribute-set[@name='table23-row']| + xsl:attribute-set[@name='table24-row']| + xsl:attribute-set[@name='table25-row']| + xsl:attribute-set[@name='table26-row']| + xsl:attribute-set[@name='table27-row']| + xsl:attribute-set[@name='table28-row']| + xsl:attribute-set[@name='table29-row']| + xsl:attribute-set[@name='table30-row']" priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='table1-cell']| + xsl:attribute-set[@name='table2-cell']| + xsl:attribute-set[@name='table3-cell']| + xsl:attribute-set[@name='table4-cell']| + xsl:attribute-set[@name='table5-cell']| + xsl:attribute-set[@name='table6-cell']| + xsl:attribute-set[@name='table7-cell']| + xsl:attribute-set[@name='table8-cell']| + xsl:attribute-set[@name='table9-cell']| + xsl:attribute-set[@name='table10-cell']| + xsl:attribute-set[@name='table11-cell']| + xsl:attribute-set[@name='table12-cell']| + xsl:attribute-set[@name='table13-cell']| + xsl:attribute-set[@name='table14-cell']| + xsl:attribute-set[@name='table15-cell']| + xsl:attribute-set[@name='table16-cell']| + xsl:attribute-set[@name='table17-cell']| + xsl:attribute-set[@name='table18-cell']| + xsl:attribute-set[@name='table19-cell']| + xsl:attribute-set[@name='table20-cell']| + xsl:attribute-set[@name='table21-cell']| + xsl:attribute-set[@name='table22-cell']| + xsl:attribute-set[@name='table23-cell']| + xsl:attribute-set[@name='table24-cell']| + xsl:attribute-set[@name='table25-cell']| + xsl:attribute-set[@name='table26-cell']| + xsl:attribute-set[@name='table27-cell']| + xsl:attribute-set[@name='table28-cell']| + xsl:attribute-set[@name='table29-cell']| + xsl:attribute-set[@name='table30-cell']" priority="3"/> + + <xsl:template match= "xsl:attribute-set[@name='cell1-block']| + xsl:attribute-set[@name='cell2-block']| + xsl:attribute-set[@name='cell3-block']| + xsl:attribute-set[@name='cell4-block']| + xsl:attribute-set[@name='cell5-block']| + xsl:attribute-set[@name='cell6-block']| + xsl:attribute-set[@name='cell7-block']| + xsl:attribute-set[@name='cell8-block']| + xsl:attribute-set[@name='cell9-block']| + xsl:attribute-set[@name='cell10-block']| + xsl:attribute-set[@name='cell11-block']| + xsl:attribute-set[@name='cell12-block']| + xsl:attribute-set[@name='cell13-block']| + xsl:attribute-set[@name='cell14-block']| + xsl:attribute-set[@name='cell15-block']| + xsl:attribute-set[@name='cell16-block']| + xsl:attribute-set[@name='cell17-block']| + xsl:attribute-set[@name='cell18-block']| + xsl:attribute-set[@name='cell19-block']| + xsl:attribute-set[@name='cell20-block']| + xsl:attribute-set[@name='cell21-block']| + xsl:attribute-set[@name='cell22-block']| + xsl:attribute-set[@name='cell23-block']| + xsl:attribute-set[@name='cell24-block']| + xsl:attribute-set[@name='cell25-block']| + xsl:attribute-set[@name='cell26-block']| + xsl:attribute-set[@name='cell27-block']| + xsl:attribute-set[@name='cell28-block']| + xsl:attribute-set[@name='cell29-block']| + xsl:attribute-set[@name='cell30-block']" priority="3"/> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/table_extended2.xsl b/sandbox/paultremblay/python_interface/docs/xsl/table_extended2.xsl new file mode 100644 index 000000000..5348c23eb --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/table_extended2.xsl @@ -0,0 +1,51 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='borderless-table-block-container']" priority="3"> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">5</xsl:with-param> + <xsl:with-param name="text">Custom Tables</xsl:with-param> + </xsl:call-template> + <block> + <xsl:text>:fo: See below</xsl:text> + </block> + <block first-line-indent="-9"> + <xsl:text>:docutils: See below</xsl:text> + </block> + <block> + + The table_extend2.xsl contains templates for the borderless table. Each attribute set has + has the same function as its corresponding attribute set in the regular + table, as documented above. + + </block> + + <block>* borderless-table-block-container => table-block-contanter</block> + <block>* borderless-table => table</block> + <block>* borderless-table-header => table-header</block> + <block>* borderless-table-header-cell => table-header-cell</block> + <block>* borderless-table-header-block => table-header-block</block> + <block>* borderless-table-body => table-body</block> + <block>* borderless-table-header-row => table-header-row</block> + <block>* borderless-table-row => table-row</block> + <block>* borderless-table-cell => table-cell</block> + <block>* borderless-cell-block => cell-block</block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='borderless-table']| + xsl:attribute-set[@name='borderless-table-header']| + xsl:attribute-set[@name='borderless-table-header-row']| + xsl:attribute-set[@name='borderless-table-header-cell']| + xsl:attribute-set[@name='borderless-table-header-block']| + xsl:attribute-set[@name='borderless-table-body']| + xsl:attribute-set[@name='borderless-table-row']| + xsl:attribute-set[@name='borderless-table-cell']| + xsl:attribute-set[@name='borderless-cell-block']" priority="3"/> + + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/table_long.xsl b/sandbox/paultremblay/python_interface/docs/xsl/table_long.xsl new file mode 100644 index 000000000..9e9524c3a --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/table_long.xsl @@ -0,0 +1,54 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='long-table']" priority="3"> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">5</xsl:with-param> + <xsl:with-param name="text">Long Tables</xsl:with-param> + </xsl:call-template> + <block> + <xsl:text>:fo: See below</xsl:text> + </block> + <block first-line-indent="-9"> + <xsl:text>:docutils: See below</xsl:text> + </block> + <block> + + The table_long.xsl contains templates for a long table. Each attribute set has + has the same function as its corresponding attribute set in the regular + table, as documented above. There is no block-container attriute set, because + there is no block-container element; the caption is rendered as part of the + header or footer. + + </block> + + <block>* long-table => table</block> + <block>* long-table-header => table-header</block> + <block>* long-table-header-row => table-header-row</block> + <block>* long-thead-cell => thead-cell</block> + <block>* long-table-header-block => table-header-block</block> + <block>* long-table-body => table-body</block> + <block>* long-table-header-row => table-header-row</block> + <block>* long-table-row => table-row</block> + <block>* long-table-cell => table-cell</block> + <block>* long-cell-block => cell-block</block> + <block>* long-caption-block => caption-block</block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='long-table-header']| + xsl:attribute-set[@name='long-table-header-row']| + xsl:attribute-set[@name='long-table-header-cell']| + xsl:attribute-set[@name='long-table-header-block']| + xsl:attribute-set[@name='long-table-body']| + xsl:attribute-set[@name='long-table-row']| + xsl:attribute-set[@name='long-table-cell']| + xsl:attribute-set[@name='long-cell-block']| + xsl:attribute-set[@name='long-caption-block']" priority="3"/> + + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/toc.xsl b/sandbox/paultremblay/python_interface/docs/xsl/toc.xsl new file mode 100644 index 000000000..463bcc77e --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/toc.xsl @@ -0,0 +1,98 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:template match= "xsl:attribute-set[@name='toc-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "contents"]</xsl:with-param> + </xsl:call-template> + <block> + Formats the block that wraps the TOC. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-title-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "contents"]/title</xsl:with-param> + </xsl:call-template> + <block> + Formats the block for the title for the TOC. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-entry-defaults-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">None</xsl:with-param> + <xsl:with-param name="docutils">None</xsl:with-param> + </xsl:call-template> + <block> + Sets up the defaults for the TOC entries. + </block> + </xsl:template> + + + <xsl:template match= "xsl:attribute-set[@name='toc-level1-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "contents"]/bullet_list/list_item/paragraph/</xsl:with-param> + <xsl:with-param name="inherits">toc-entry-defaults-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the block for the level 1 table of contents entry. If a number exists, it is + formatted according to the parameter 'number-section1'. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-level2-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "contents"]/bullet_list/list_item/bullet_list/list_item/paragraph/</xsl:with-param> + <xsl:with-param name="inherits">toc-entry-defaults-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the block for the level 2 table of contents entry. If a number exists, it is + formatted according to the parameter 'number-section2'. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-level3-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "contents"]/bullet_list/list_item/bullet_list/list_item/paragraph/etc.</xsl:with-param> + <xsl:with-param name="inherits">toc-entry-defaults-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the block for the level 3 table of contents entry. If a number exists, it is + formatted according to the parameter 'number-section3'. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-level4-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="fo">fo:block</xsl:with-param> + <xsl:with-param name="docutils">topic[@classes = "contents"]/bullet_list/list_item/bullet_list/list_item/paragraph/etc.</xsl:with-param> + <xsl:with-param name="inherits">toc-entry-defaults-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the block for the level 4 table of contents entry. If a number exists, it is + formatted according to the parameter 'number-section4'. + </block> + </xsl:template> + + <xsl:template match= "xsl:attribute-set[@name='toc-level5-block']" priority="3"> + <xsl:call-template name="before-desc"> + <xsl:with-param name="docutils">topic[@classes = "contents"]/bullet_list/list_item/bullet_list/list_item/paragraph/etc.</xsl:with-param> + <xsl:with-param name="inherits">toc-entry-defaults-block</xsl:with-param> + </xsl:call-template> + <block> + Formats the block for the level 5 table of contents entry. If a number exists, it is + formatted according to the parameter 'number-section5'. + </block> + </xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docs/xsl/utils.xsl b/sandbox/paultremblay/python_interface/docs/xsl/utils.xsl new file mode 100644 index 000000000..e1c2d4c54 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docs/xsl/utils.xsl @@ -0,0 +1,201 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + + <!-- $Id$ --> + + <xsl:template name="make-border"> + <xsl:param name="length"/> + <xsl:param name="border-text">-</xsl:param> + <xsl:if test="$length != 0"> + <xsl:value-of select="$border-text"/> + <xsl:call-template name="make-border"> + <xsl:with-param name="border-text" select="$border-text"/> + <xsl:with-param name="length" select="$length - 1"/> + </xsl:call-template> + </xsl:if> + </xsl:template> + + <xsl:template name="make-title"> + <xsl:param name="level">5</xsl:param> + <xsl:param name="text"/> + <xsl:choose> + <xsl:when test="$level = 1"> + <block bottom-border="#" bottom-border-length="text" top-border="#" top-border-length="text"> + <xsl:value-of select="$text"/> + </block> + </xsl:when> + <xsl:when test="$level = 2"> + <block bottom-border="^" bottom-border-length="text" top-border="^" top-border-length="text"> + <xsl:value-of select="$text"/> + </block> + </xsl:when> + <xsl:when test="$level = 3"> + <block bottom-border="=" bottom-border-length="text" > + <xsl:value-of select="$text"/> + </block> + </xsl:when> + <xsl:when test="$level = 5"> + <block bottom-border="-" bottom-border-length="text"> + <xsl:value-of select="$text"/> + </block> + </xsl:when> + </xsl:choose> + </xsl:template> + + <xsl:template name="make-defaults"> + <block>:defaults:</block> + <xsl:for-each select="xsl:attribute"> + <block left-indent="5"> + <xsl:value-of select="@name"/> + <xsl:text>: </xsl:text> + <xsl:value-of select='.'/> + </block> + </xsl:for-each> + </xsl:template> + + <xsl:template name="make-defaults_old"> + <xsl:text>:defaults:</xsl:text> + <xsl:text>

</xsl:text> + <xsl:for-each select="xsl:attribute"> + <xsl:text> </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>: </xsl:text> + <xsl:value-of select="."/> + <xsl:text>

</xsl:text> + </xsl:for-each> + </xsl:template> + + <xsl:template name="before-desc"> + <xsl:param name="fo"/> + <xsl:param name="docutils"/> + <xsl:param name="inherits"/> + <xsl:call-template name="make-title"> + <xsl:with-param name="text" select="@name"/> + </xsl:call-template> + <block> + <xsl:text>:fo: </xsl:text> + <xsl:value-of select="$fo"/> + </block> + <block first-line-indent="-9"> + <xsl:text>:docutils: </xsl:text> + <xsl:value-of select="$docutils"/> + </block> + <!-- + <block literal="true"> + <xsl:text>

</xsl:text> + <xsl:text>:docutils: </xsl:text> + <xsl:value-of select="$docutils"/> + <xsl:text>

</xsl:text> + </block> + --> + <xsl:if test="$inherits != ''"> + <block> + <xsl:text>:inherits: </xsl:text> + <xsl:value-of select="$inherits"/> + </block> + </xsl:if> + <xsl:call-template name="make-defaults"/> + </xsl:template> + + <xsl:template name="make-name"> + <xsl:param name="name"/> + <xsl:call-template name="make-title"> + <xsl:with-param name="level">3</xsl:with-param> + <xsl:with-param name="text"> + <xsl:choose> + <xsl:when test="$name = ''"> + <xsl:value-of select="@name"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$name"/> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + <xsl:template name="possible-values-recurs"> + <xsl:param name="text"/> + <xsl:param name="final-string">**Possible Values**: </xsl:param> + <xsl:variable name="value" select="normalize-space(substring-before($text, ','))"/> + <xsl:choose> + <xsl:when test="$value != ''"> + <xsl:call-template name="possible-values-recurs"> + <xsl:with-param name="text" select="substring-after($text, ',')"/> + <xsl:with-param name="final-string"> + <xsl:value-of select="$final-string"/> + <xsl:text>``</xsl:text> + <xsl:value-of select="$value"/> + <xsl:text>``, </xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="substring($final-string, 1, string-length($final-string) - 2)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="possible-values"> + <xsl:param name="text"/> + <xsl:choose> + <xsl:when test="$text = 'Any Measure' or $text = 'Any Text' or + $text = 'Valid Number Formatting String'"> + <block> + <xsl:text>**Possible Values**: </xsl:text> + <xsl:value-of select="$text"/> + </block> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="parsed-text"> + <xsl:choose> + <xsl:when test="substring($text, string-length($text), 1) = ','"> + <xsl:value-of select="$text"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$text"/> + <xsl:text>,</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <block> + <xsl:call-template name="possible-values-recurs"> + <xsl:with-param name="text" select="$parsed-text"/> + </xsl:call-template> + </block> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="xsl:param[@name='strict']" priority = "3"> + <xsl:call-template name="before_p_text"> + <xsl:with-param name="possible-values"> + <xsl:text>True, False, ''</xsl:text> + </xsl:with-param> + </xsl:call-template> + <block> + If set to True, stylesheet processing quits when an error is found. + </block> + </xsl:template> + + <xsl:template name="p-defaults"> + <block> + <xsl:text>**Default:** </xsl:text> + <xsl:value-of select="."/> + </block> + </xsl:template> + + <xsl:template name="before_p_text"> + <xsl:param name="possible-values"/> + <xsl:call-template name="make-name"/> + <xsl:call-template name="possible-values"> + <xsl:with-param name="text" select="$possible-values"/> + </xsl:call-template> + <xsl:call-template name="p-defaults"/> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/__init__.py b/sandbox/paultremblay/python_interface/docutilsToFo/__init__.py new file mode 100644 index 000000000..b3d0c915b --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/__init__.py @@ -0,0 +1,3 @@ +''' +modules for rtf2xml +''' diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/att_set_dict.py b/sandbox/paultremblay/python_interface/docutilsToFo/att_set_dict.py new file mode 100644 index 000000000..2b39447d9 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/att_set_dict.py @@ -0,0 +1,590 @@ +att_set_dict = {'Some-custom-field': 'block', +'abstract-block': 'block', +'abstract-first-paragraph-block': 'block', +'abstract-paragraph-block': 'block', +'abstract-title-block': 'block', +'address-block': 'block', +'address-value-block': 'block', +'admonition-custom-block': 'block', +'admonition-custorm-title-block': 'block', +'admonition-first-paragraph-block': 'block', +'admonition-paragraph-block': 'block', +'attention-block': 'block', +'attention-title-block': 'block', +'author-block': 'block', +'authors-block': 'block', +'basic-link-inline': 'basic-link', +'bibliographic-fields-block': 'block', +'bibliographic-fields-first-list-item': 'list-item', +'bibliographic-fields-item-body': 'list-item-body', +'bibliographic-fields-item-label-block': 'block', +'bibliographic-fields-list-block': 'list-block', +'bibliographic-fields-list-item': 'list-item', +'bibliographic-fields-list-item-label': 'list-item-label', +'bibliographic-first-fields-block': 'block', +'block-quote-attribution-block': 'block', +'block-quote-first-paragraph-block': 'block', +'block-quote-outer-block': 'block', +'block-quote-paragraph-block': 'block', +'body-flow': 'flow', +'body-footer-block': 'block', +'body-header-block': 'block', +'body-page-sequence': 'page-sequence', +'body-simple-page-master': 'simple-page-master', +'borderless-cell-block': 'block', +'borderless-table': 'table', +'borderless-table-block-container': 'block-container', +'borderless-table-body': 'table-body', +'borderless-table-cell': 'table-cell', +'borderless-table-header': 'table-header', +'borderless-table-header-block': 'block', +'borderless-table-header-cell': 'table-cell', +'borderless-table-header-row': 'table-row', +'borderless-table-row': 'table-row', +'bullet-first-list-item': 'list-item', +'bullet-level2-first-list-item': 'list-item', +'bullet-level2-list-block': 'list-block', +'bullet-level2-list-item': 'list-item', +'bullet-list-block': 'list-block', +'bullet-list-item': 'list-item', +'bullet-list-item-body': 'list-item-body', +'bullet-list-item-body-block': 'block', +'bullet-list-item-label': 'list-item-label', +'bullet-list-item-label-block': 'block', +'caption-block': 'block', +'caution-block': 'block', +'caution-title-block': 'block', +'cell-block': 'block', +'cell1-block': 'block', +'cell10-block': 'block', +'cell11-block': 'block', +'cell12-block': 'block', +'cell13-block': 'block', +'cell14-block': 'block', +'cell15-block': 'block', +'cell16-block': 'block', +'cell17-block': 'block', +'cell18-block': 'block', +'cell19-block': 'block', +'cell2-block': 'block', +'cell20-block': 'block', +'cell21-block': 'block', +'cell22-block': 'block', +'cell23-block': 'block', +'cell24-block': 'block', +'cell25-block': 'block', +'cell26-block': 'block', +'cell27-block': 'block', +'cell28-block': 'block', +'cell29-block': 'block', +'cell3-block': 'block', +'cell30-block': 'block', +'cell4-block': 'block', +'cell5-block': 'block', +'cell6-block': 'block', +'cell7-block': 'block', +'cell8-block': 'block', +'cell9-block': 'block', +'classifier-inline': 'inline', +'contact-block': 'block', +'container-first-paragraph-block': 'block', +'container-outer-block': 'block', +'container-paragraph-block': 'block', +'copyright-block': 'block', +'custom-bib-info1': 'block', +'custom-bib-info10': 'block', +'custom-bib-info2': 'block', +'custom-bib-info3': 'block', +'custom-bib-info4': 'block', +'custom-bib-info5': 'block', +'custom-bib-info6': 'block', +'custom-bib-info7': 'block', +'custom-bib-info8': 'block', +'custom-bib-info9': 'block', +'danger-block': 'block', +'danger-title-block': 'block', +'date-block': 'block', +'dedication-block': 'block', +'dedication-first-paragraph-block': 'block', +'dedication-paragraph-block': 'block', +'dedication-title-block': 'block', +'default-admonition-outer-block': 'block', +'default-admonition-title-block': 'block', +'default-cell': 'table-cell', +'default-flow': 'flow', +'default-footnote-label-inline': 'inline', +'default-page-sequence': 'page-sequence', +'default-section-title-block': 'block', +'default-simple-page-master': 'simple-page-master', +'definition-block': 'block', +'definition-first-paragraph-block': 'block', +'definition-list-block': 'block', +'definition-list-item-block': 'block', +'definition-list-item-first-block': 'block', +'definition-paragraph-block': 'block', +'definition-term-block': 'block', +'definition-term-inline': 'inline', +'document-subtitle-block': 'block', +'document-title-block': 'block', +'document-title-page-block': 'block', +'emphasis-inline': 'inline', +'endnote-block': 'block', +'endnote-first-block': 'block', +'endnotes-block': 'block', +'endnotes-title-block': 'block', +'enumerated-first-list-item': 'list-item', +'enumerated-level2-first-list-item': 'list-item', +'enumerated-level2-list-block': 'list-block', +'enumerated-level2-list-item': 'list-item', +'enumerated-list-block': 'list-block', +'enumerated-list-item': 'list-item', +'enumerated-list-item-body': 'list-item-body', +'enumerated-list-item-body-block': 'block', +'enumerated-list-item-label': 'list-item-label', +'epigraph-attribution-block': 'block', +'epigraph-first-paragraph-block': 'block', +'epigraph-outer-block': 'block', +'epigraph-paragraph-block': 'block', +'error-block': 'block', +'error-title-block': 'block', +'even-footer-block': 'block', +'even-header-block': 'block', +'even-simple-page-master': 'simple-page-master', +'field-body-block': 'block', +'field-first-list-item': 'list-item', +'field-list-block': 'list-block', +'field-list-item': 'list-item', +'field-list-item-body': 'list-item-body', +'field-list-item-label': 'list-item-label', +'field-list-item-label-block': 'block', +'figure-block': 'block', +'figure-caption-block': 'block', +'figure-legend-block': 'block', +'first-footer-block': 'block', +'first-header-block': 'block', +'first-paragraph-block': 'block', +'first-simple-page-master': 'simple-page-master', +'footer-block': 'block', +'footer-region-after': 'region-after', +'footnote': 'footnote', +'footnote-body': 'footnote-body', +'footnote-body-label-inline': 'inline', +'footnote-first-paragraph-block': 'block', +'footnote-item-body': 'list-item-body', +'footnote-item-label': 'list-item-label', +'footnote-label-block': 'block', +'footnote-label-inline': 'inline', +'footnote-list-block': 'list-block', +'footnote-paragraph-block': 'block', +'footnote-separator-block': 'block', +'footnote-separator-flow': 'static-content', +'front-body-simple-page-master': 'simple-page-master', +'front-even-simple-page-master': 'simple-page-master', +'front-first-simple-page-master': 'simple-page-master', +'front-flow': 'flow', +'front-matter-region-body': 'region-body', +'front-odd-simple-page-master': 'simple-page-master', +'front-page-sequence': 'page-sequence', +'front-simple-page-master': 'simple-page-master', +'header-block': 'block', +'header-region-before': 'region-before', +'highlights-first-paragraph-block': 'block', +'highlights-outer-block': 'block', +'highlights-paragraph-block': 'block', +'hint-block': 'block', +'hint-title-block': 'block', +'image-block': 'block', +'important-block': 'block', +'important-title-block': 'block', +'legend-first-paragraph-block': 'block', +'legend-paragraph-block': 'block', +'level1-line-block': 'block', +'level2-line-block': 'block', +'level3-line-block': 'block', +'level4-line-block': 'block', +'level5-line-block': 'block', +'literal-block': 'block', +'literal-inline': 'inline', +'long-caption-block': 'block', +'long-cell-block': 'block', +'long-table': 'table', +'long-table-body': 'table-body', +'long-table-cell': 'table-cell', +'long-table-header': 'table-header', +'long-table-header-block': 'block', +'long-table-header-cell': 'table-cell', +'long-table-header-row': 'table-row', +'long-table-row': 'table-row', +'note-block': 'block', +'note-title-block': 'block', +'odd-footer-block': 'block', +'odd-header-block': 'block', +'odd-simple-page-master': 'simple-page-master', +'option-argument-inline': 'inline', +'option-first-list-item': 'list-item', +'option-group-block': 'block', +'option-inline': 'inline', +'option-list-block': 'list-block', +'option-list-definition-block': 'block', +'option-list-description-block': 'block', +'option-list-first-item-block': 'block', +'option-list-first-paragraph-block': 'block', +'option-list-item': 'list-item', +'option-list-item-block': 'block', +'option-list-item-body': 'list-item-body', +'option-list-item-body-block': 'block', +'option-list-item-label': 'list-item-label', +'option-list-item-label-block': 'block', +'option-list-paragraph-block': 'block', +'organization-block': 'block', +'outer-line-block': 'block', +'paper-size-simple-page-master': 'simple-page-master', +'paragraph-block': 'block', +'paragraph-footer-block': 'block', +'paragraph-header-block': 'block', +'pull-quote-attribution-block': 'block', +'pull-quote-first-paragraph-block': 'block', +'pull-quote-outer-block': 'block', +'pull-quote-paragraph-block': 'block', +'region-body': 'region-body', +'revision-block': 'block', +'rubric-block': 'block', +'sidebar-block': 'block', +'sidebar-first-paragraph-block': 'block', +'sidebar-paragraph-block': 'block', +'sidebar-subtitle-block': 'block', +'sidebar-title-block': 'block', +'simple-page-master': 'simple-page-master', +'stanza-title-block': 'block', +'stanza2-first-line-block': 'block', +'stanza2-line-block': 'block', +'stanza3-first-line-block': 'block', +'stanza3-line-block': 'block', +'stanza4-first-line-block': 'block', +'stanza4-line-block': 'block', +'stanza5-first-line-block': 'block', +'stanza5-line-block': 'block', +'status-block': 'block', +'strong-inline': 'inline', +'table': 'table', +'table-block-container': 'block-container', +'table-body': 'table-body', +'table-cell': 'table-cell', +'table-header': 'table-header', +'table-header-block': 'block', +'table-header-cell': 'table-cell', +'table-row': 'table-row', +'table1': 'table', +'table1-block-container': 'block-container', +'table1-body': 'table-body', +'table1-cell': 'table-cell', +'table1-header': 'table-header', +'table1-header-block': 'block', +'table1-header-cell': 'table-cell', +'table1-header-row': 'table-row', +'table1-row': 'table-row', +'table10': 'table', +'table10-block-container': 'block-container', +'table10-body': 'table-body', +'table10-cell': 'table-cell', +'table10-header': 'table-header', +'table10-header-block': 'block', +'table10-header-cell': 'table-cell', +'table10-header-row': 'table-row', +'table10-row': 'table-row', +'table11': 'table', +'table11-block-container': 'block-container', +'table11-body': 'table-body', +'table11-cell': 'table-cell', +'table11-header': 'table-header', +'table11-header-block': 'block', +'table11-header-cell': 'table-cell', +'table11-header-row': 'table-row', +'table11-row': 'table-row', +'table12': 'table', +'table12-block-container': 'block-container', +'table12-body': 'table-body', +'table12-cell': 'table-cell', +'table12-header': 'table-header', +'table12-header-block': 'block', +'table12-header-cell': 'table-cell', +'table12-header-row': 'table-row', +'table12-row': 'table-row', +'table13': 'table', +'table13-block-container': 'block-container', +'table13-body': 'table-body', +'table13-cell': 'table-cell', +'table13-header': 'table-header', +'table13-header-block': 'block', +'table13-header-cell': 'table-cell', +'table13-header-row': 'table-row', +'table13-row': 'table-row', +'table14': 'table', +'table14-block-container': 'block-container', +'table14-body': 'table-body', +'table14-cell': 'table-cell', +'table14-header': 'table-header', +'table14-header-block': 'block', +'table14-header-cell': 'table-cell', +'table14-header-row': 'table-row', +'table14-row': 'table-row', +'table15': 'table', +'table15-block-container': 'block-container', +'table15-body': 'table-body', +'table15-cell': 'table-cell', +'table15-header': 'table-header', +'table15-header-block': 'block', +'table15-header-cell': 'table-cell', +'table15-header-row': 'table-row', +'table15-row': 'table-row', +'table16': 'table', +'table16-block-container': 'block-container', +'table16-body': 'table-body', +'table16-cell': 'table-cell', +'table16-header': 'table-header', +'table16-header-block': 'block', +'table16-header-cell': 'table-cell', +'table16-header-row': 'table-row', +'table16-row': 'table-row', +'table17': 'table', +'table17-block-container': 'block-container', +'table17-body': 'table-body', +'table17-cell': 'table-cell', +'table17-header': 'table-header', +'table17-header-block': 'block', +'table17-header-cell': 'table-cell', +'table17-header-row': 'table-row', +'table17-row': 'table-row', +'table18': 'table', +'table18-block-container': 'block-container', +'table18-body': 'table-body', +'table18-cell': 'table-cell', +'table18-header': 'table-header', +'table18-header-block': 'block', +'table18-header-cell': 'table-cell', +'table18-header-row': 'table-row', +'table18-row': 'table-row', +'table19': 'table', +'table19-block-container': 'block-container', +'table19-body': 'table-body', +'table19-cell': 'table-cell', +'table19-header': 'table-header', +'table19-header-block': 'block', +'table19-header-cell': 'table-cell', +'table19-header-row': 'table-row', +'table19-row': 'table-row', +'table2': 'table', +'table2-block-container': 'block-container', +'table2-body': 'table-body', +'table2-cell': 'table-cell', +'table2-header': 'table-header', +'table2-header-block': 'block', +'table2-header-cell': 'table-cell', +'table2-header-row': 'table-row', +'table2-row': 'table-row', +'table20': 'table', +'table20-block-container': 'block-container', +'table20-body': 'table-body', +'table20-cell': 'table-cell', +'table20-header': 'table-header', +'table20-header-block': 'block', +'table20-header-cell': 'table-cell', +'table20-header-row': 'table-row', +'table20-row': 'table-row', +'table21': 'table', +'table21-block-container': 'block-container', +'table21-body': 'table-body', +'table21-cell': 'table-cell', +'table21-header': 'table-header', +'table21-header-block': 'block', +'table21-header-cell': 'table-cell', +'table21-header-row': 'table-row', +'table21-row': 'table-row', +'table22': 'table', +'table22-block-container': 'block-container', +'table22-body': 'table-body', +'table22-cell': 'table-cell', +'table22-header': 'table-header', +'table22-header-block': 'block', +'table22-header-cell': 'table-cell', +'table22-header-row': 'table-row', +'table22-row': 'table-row', +'table23': 'table', +'table23-block-container': 'block-container', +'table23-body': 'table-body', +'table23-cell': 'table-cell', +'table23-header': 'table-header', +'table23-header-block': 'block', +'table23-header-cell': 'table-cell', +'table23-header-row': 'table-row', +'table23-row': 'table-row', +'table24': 'table', +'table24-block-container': 'block-container', +'table24-body': 'table-body', +'table24-cell': 'table-cell', +'table24-header': 'table-header', +'table24-header-block': 'block', +'table24-header-cell': 'table-cell', +'table24-header-row': 'table-row', +'table24-row': 'table-row', +'table25': 'table', +'table25-block-container': 'block-container', +'table25-body': 'table-body', +'table25-cell': 'table-cell', +'table25-header': 'table-header', +'table25-header-block': 'block', +'table25-header-cell': 'table-cell', +'table25-header-row': 'table-row', +'table25-row': 'table-row', +'table26': 'table', +'table26-block-container': 'block-container', +'table26-body': 'table-body', +'table26-cell': 'table-cell', +'table26-header': 'table-header', +'table26-header-block': 'block', +'table26-header-cell': 'table-cell', +'table26-header-row': 'table-row', +'table26-row': 'table-row', +'table27': 'table', +'table27-block-container': 'block-container', +'table27-body': 'table-body', +'table27-cell': 'table-cell', +'table27-header': 'table-header', +'table27-header-block': 'block', +'table27-header-cell': 'table-cell', +'table27-header-row': 'table-row', +'table27-row': 'table-row', +'table28': 'table', +'table28-block-container': 'block-container', +'table28-body': 'table-body', +'table28-cell': 'table-cell', +'table28-header': 'table-header', +'table28-header-block': 'block', +'table28-header-cell': 'table-cell', +'table28-header-row': 'table-row', +'table28-row': 'table-row', +'table29': 'table', +'table29-block-container': 'block-container', +'table29-body': 'table-body', +'table29-cell': 'table-cell', +'table29-header': 'table-header', +'table29-header-block': 'block', +'table29-header-cell': 'table-cell', +'table29-header-row': 'table-row', +'table29-row': 'table-row', +'table3': 'table', +'table3-block-container': 'block-container', +'table3-body': 'table-body', +'table3-cell': 'table-cell', +'table3-header': 'table-header', +'table3-header-block': 'block', +'table3-header-cell': 'table-cell', +'table3-header-row': 'table-row', +'table3-row': 'table-row', +'table30': 'table', +'table30-block-container': 'block-container', +'table30-body': 'table-body', +'table30-cell': 'table-cell', +'table30-header': 'table-header', +'table30-header-block': 'block', +'table30-header-cell': 'table-cell', +'table30-header-row': 'table-row', +'table30-row': 'table-row', +'table4': 'table', +'table4-block-container': 'block-container', +'table4-body': 'table-body', +'table4-cell': 'table-cell', +'table4-header': 'table-header', +'table4-header-block': 'block', +'table4-header-cell': 'table-cell', +'table4-header-row': 'table-row', +'table4-row': 'table-row', +'table5': 'table', +'table5-block-container': 'block-container', +'table5-body': 'table-body', +'table5-cell': 'table-cell', +'table5-header': 'table-header', +'table5-header-block': 'block', +'table5-header-cell': 'table-cell', +'table5-header-row': 'table-row', +'table5-row': 'table-row', +'table6': 'table', +'table6-block-container': 'block-container', +'table6-body': 'table-body', +'table6-cell': 'table-cell', +'table6-header': 'table-header', +'table6-header-block': 'block', +'table6-header-cell': 'table-cell', +'table6-header-row': 'table-row', +'table6-row': 'table-row', +'table7': 'table', +'table7-block-container': 'block-container', +'table7-body': 'table-body', +'table7-cell': 'table-cell', +'table7-header': 'table-header', +'table7-header-block': 'block', +'table7-header-cell': 'table-cell', +'table7-header-row': 'table-row', +'table7-row': 'table-row', +'table8': 'table', +'table8-block-container': 'block-container', +'table8-body': 'table-body', +'table8-cell': 'table-cell', +'table8-header': 'table-header', +'table8-header-block': 'block', +'table8-header-cell': 'table-cell', +'table8-header-row': 'table-row', +'table8-row': 'table-row', +'table9': 'table', +'table9-block-container': 'block-container', +'table9-body': 'table-body', +'table9-cell': 'table-cell', +'table9-header': 'table-header', +'table9-header-block': 'block', +'table9-header-cell': 'table-cell', +'table9-header-row': 'table-row', +'table9-row': 'table-row', +'tip-block': 'block', +'tip-title-block': 'block', +'title-level1-block': 'block', +'title-level2-block': 'block', +'title-level3-block': 'block', +'title-level4-block': 'block', +'title-level5-block': 'block', +'title-level6-block': 'block', +'title-level7-block': 'block', +'title-level8-block': 'block', +'title-level9-block': 'block', +'title-number-inline': 'inline', +'title-reference-inline': 'inline', +'toc-block': 'block', +'toc-body-footer-block': 'block', +'toc-body-header-block': 'block', +'toc-body-simple-page-master': 'simple-page-master', +'toc-entry-defaults-block': 'block', +'toc-even-footer-block': 'block', +'toc-even-header-block': 'block', +'toc-even-simple-page-master': 'simple-page-master', +'toc-first-footer-block': 'block', +'toc-first-header-block': 'block', +'toc-first-simple-page-master': 'simple-page-master', +'toc-flow': 'flow', +'toc-level1-block': 'block', +'toc-level2-block': 'block', +'toc-level3-block': 'block', +'toc-level4-block': 'block', +'toc-level5-block': 'block', +'toc-odd-footer-block': 'block', +'toc-odd-header-block': 'block', +'toc-odd-simple-page-master': 'simple-page-master', +'toc-page-sequence': 'page-sequence', +'toc-simple-page-master': 'simple-page-master', +'toc-title-block': 'block', +'topic-block': 'block', +'topic-first-paragraph-block': 'block', +'topic-paragraph-block': 'block', +'topic-title-block': 'block', +'transition-block': 'block', +'version-block': 'block', +'warning-block': 'block', +'warning-title-block': 'block'} diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/docutils_fo_dicts.py b/sandbox/paultremblay/python_interface/docutilsToFo/docutils_fo_dicts.py new file mode 100644 index 000000000..cdd5b29fb --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/docutils_fo_dicts.py @@ -0,0 +1,906 @@ + # -*- coding: UTF8 -*- +from att_set_dict import att_set_dict + + +#=========================================================== +# SHORT CUTS + +short_cut_att_sets = { +'abstract': 'abstract-block', +'abstract-title': 'abstract-title-block', +'abstract-paragraph': 'abstract-paragraph-block', +'address':'address-block', +'author':'author-block', +'authors':'authors-block', +'bibliographic-field':'bibliographic-fields-item-label-block', +'bibliographic-fields': 'bibliographic-fields-list-block', +'bibliographic-fields-text': 'bibliographic-fields-item-body', +'bibliographic-fields-paragraph': 'bibliographic-fields-block', +'body': 'default-flow', +'body-header' : 'body-header-block', +'body-footer' : 'body-footer-block', +'bullet-list': 'bullet-list-block', +'bullet-list-level2' :'bullet-level2-list-block', +'bullet-list-paragraph': 'bullet-list-item-body-block', +'contact':'contact-block', +'copyright':'copyright-block', +'bibliographic-field-custom1': 'custom-bib-info1', +'bibliographic-field-custom2': 'custom-bib-info2', +'bibliographic-field-custom3': 'custom-bib-info3', +'bibliographic-field-custom4': 'custom-bib-info4', +'bibliographic-field-custom5': 'custom-bib-info5', +'bibliographic-field-custom6': 'custom-bib-info6', +'bibliographic-field-custom7': 'custom-bib-info7', +'bibliographic-field-custom8': 'custom-bib-info8', +'bibliographic-field-custom9': 'custom-bib-info9', +'bibliographic-field-custom10': 'custom-bib-info10', +'block-quote' : 'block-quote-outer-block', +'block-quote-paragraph' : 'block-quote-paragraph-block', +'block-quote-attribution' : 'block-quote-attribution-block', +'date':'date-block', +'dedication': 'dedication-block', +'dedication-title': 'dedication-title-block', +'dedication-paragraph': 'dedication-paragraph-block', +'definition-list-classifier': 'classifier-inline', +'definition-list': 'definition-list-block', +'definition-list-paragraph': 'definition-paragraph-block', +'definition-list-definition': 'definition-block', +'definition-term':'definition-term-block', +'document': 'default-page-sequence', +'even-footer': 'even-footer-block', +'even-header': 'even-header-block', +'even-page': 'even-simple-page-master', +'enumerated-list': 'enumerated-list-block', +'enumerated-list-level2': 'enumerated-level2-list-block', +'enumerated-list-paragraph': 'enumerated-list-item-body-block', +'field-name':'field-list-item-label-block', +'field-list': 'field-list-block', +'field-list-paragraph': 'field-body-block', +'field-name':'field-list-item-label-block', +'first-header' : 'first-header-block', +'first-footer' : 'first-footer-block', +'first-page': 'first-simple-page-master', +'first-paragraph': 'first-paragraph-block', +'footer' : 'footer-block', +'footer-paragraph': 'paragraph-footer-block', +'header': 'header-block', +'even-header': 'even-header-block', +'header-paragraph': 'paragraph-header-block', +'heading1':'title-level1-block', +'heading2':'title-level2-block', +'heading3':'title-level3-block', +'heading4':'title-level4-block', +'heading5':'title-level5-block', +'heading6':'title-level6-block', +'heading7':'title-level7-block', +'line-block': 'outer-line-block', +'line-level1': 'level1-line-block', +'line-level2': 'level2-line-block', +'line-level3': 'level3-line-block', +'line-level4': 'level4-line-block', +'line-level5': 'level5-line-block', +'odd-footer': 'odd-footer-block', +'odd-header': 'odd-header-block', +'odd-page': 'odd-simple-page-master', +'option': 'option-inline', +'option-argument': 'option-argument-inline', +'organization':'organization-block', +'page': 'default-simple-page-master', +'paper-size': 'paper-size-simple-page-master', +'paragraph': 'paragraph-block', +'revision':'revision-block', +'stanza-title': 'stanza-title-block', +'status':'status-block', +'subtitle': 'document-subtitle-block', +'table-and-caption' : 'table-block-container', +'title': 'document-title-block', +'title-subtitle': 'document-title-page-block', +'toc': 'toc-block', +'toc-body-footer':'toc-body-footer-block', +'toc-body-header':'toc-body-header-block', +'toc-first-header':'toc-first-header-block', +'toc-first-footer':'toc-first-footer-block', +'toc-odd-header':'toc-odd-header-block', +'toc-even-header':'toc-even-header-block', +'toc-odd-footer':'toc-odd-footer-block', +'toc-even-footer':'toc-even-footer-block', +'toc-title': 'toc-title-block', +'toc-entry1': 'toc-level1-block', +'toc-entry2': 'toc-level2-block', +'toc-entry3': 'toc-level3-block', +'toc-entry4': 'toc-level4-block', +'toc-entry5': 'toc-level5-block', +'toc-default': 'toc-entry-defaults-block', +'transition':'transition-block', +'version':'version-block', +} + +short_cut_att_sets2 = { +('option-list-body','list') :'option-list-item-body', +('option-list-body','definition') :'option-list-description-block', +('option-list','list') :'option-list-block', +('option-list','definition') :'option-list-definition-block', +('options', 'list'): 'option-list-item-label-block', +('options', 'definition'): 'option-group-block', +('option-list-paragraph', 'list'): 'option-list-item-body-block', +('option-list-paragraph', 'definition'): 'option-list-paragraph-block', +} +# =========================================================== + + + + +# ATT LISTS +# ========================================================================== + +accessibility_properties = [ +'source-document', +'role'] +area_alignment_properties = [ +'alignment-adjust', +'alignment-baseline', +'baseline-shift', +'dominant-baseline', +'vertical-align'] +area_properties = [ +] +area_properties_inheritable = [ +'display-align', +'reference-orientation', +'writing-mode'] +area_properties_unheritable = [ +'clip', +'overflow'] +aural_properties_inheritable = [ +'azimuth', +'elevation', +'pitch', +'pitch-range', +'play-during', +'richness', +'speak', +'speak-header', +'speak-numeral', +'speak-punctuation', +'speech-rate', +'stress', +'voice-family', +'volume'] +aural_properties_unheritable = [ +'cue', +'cue-after', +'cue-before', +'pause', +'pause-after', +'pause-before'] +background_properties = [ +'background', +'background-attachment', +'background-color', +'background-image', +'background-position', +'background-position-vertical', +'background-position-horizontal', +'background-repeat', +'rx:background-content-type', +'rx:background-content-height', +'rx:background-content-width', +'rx:background-scaling'] +block_attlist = [ +'text-altitude', +'text-depth'] +block_container_attlist = [ +'absolute-position', +'z-index'] +block_properties = [ +'clear', +'span'] +border_padding_background_properties = [ +] +border_precedence_properties = [ +'border-after-precedence', +'border-before-precedence', +'border-end-precedence', +'border-start-precedence'] +border_properties = [ +'border', +'border-after-color', +'border-after-style', +'border-after-width', +'border-after-width.length', +'border-after-width.conditionality', +'border-before-color', +'border-before-style', +'border-before-width', +'border-before-width.length', +'border-before-width.conditionality', +'border-bottom', +'border-bottom-color', +'border-bottom-style', +'border-bottom-width', +'border-bottom-width.length', +'border-bottom-width.conditionality', +'border-color', +'border-end-color', +'border-end-style', +'border-end-width', +'border-end-width.length', +'border-end-width.conditionality', +'border-left', +'border-left-color', +'border-left-style', +'border-left-width', +'border-left-width.length', +'border-left-width.conditionality', +'border-right', +'border-right-color', +'border-right-style', +'border-right-width', +'border-right-width.length', +'border-right-width.conditionality', +'border-start-color', +'border-start-style', +'border-start-width', +'border-start-width.length', +'border-start-width.conditionality', +'border-style', +'border-top', +'border-top-color', +'border-top-style', +'border-top-width', +'border-top-width.length', +'border-top-width.conditionality', +'border-width'] +box_size_properties = [ +] +character_properties_inheritable = [ +'letter-spacing', +'letter-spacing.minimum', +'letter-spacing.optimum', +'letter-spacing.maximum', +'letter-spacing.precedence', +'letter-spacing.conditionality', +'word-spacing', +'word-spacing.minimum', +'word-spacing.optimum', +'word-spacing.maximum', +'word-spacing.precedence', +'word-spacing.conditionality', +'glyph-orientation-horizontal', +'glyph-orientation-vertical', +'score-spaces', +'text-transform'] +character_properties_unheritable = [ +'text-decoration', +'text-shadow'] +common_block_properties = [ +'id', +'rx:key'] +common_inline_properties = [ +'id', +'rx:key', +'text-altitude', +'text-depth'] +flow_attlist = [ +] +flow_properties = [ +'id', +'rx:key', +'flow-name'] +font_properties = [ +'font', +'font-selection-strategy', +'font-family', +'font-size', +'font-size-adjust', +'font-stretch', +'font-style', +'font-variant', +'font-weight'] +footnote_body_attlist = [ +] +height_properties = [ +'height', +'min-height', +'max-height', +'block-progression-dimension', +'block-progression-dimension.minimum', +'block-progression-dimension.optimum', +'block-progression-dimension.maximum'] +hyphenation_properties_block = [ +'hyphenation-keep', +'hyphenation-ladder-count'] +hyphenation_properties_inline = [ +'country', +'language', +'script', +'xml:lang', +'hyphenate', +'hyphenation-character', +'hyphenation-push-character-count', +'hyphenation-remain-character-count'] +inheritable_properties = [ +] +inheritable_properties_block = [ +'intrusion-displace', +'relative-align'] +inheritable_properties_inline = [ +'color', +'visibility'] +inline_attlist = [ +] +inline_properties = [ +] +keeps_and_breaks_properties_atomic = [ +'break-after', +'break-before', +'page-break-after', +'page-break-before'] +keeps_and_breaks_properties_block_inheritable = [ +'orphans', +'widows'] +keeps_and_breaks_properties_inline_inheritable = [ +'keep-together', +'keep-together.within-line', +'keep-together.within-column', +'keep-together.within-page', +'page-break-inside'] +keeps_properties_atomic = [ +'keep-with-next', +'keep-with-next.within-line', +'keep-with-next.within-column', +'keep-with-next.within-page', +'keep-with-previous', +'keep-with-previous.within-line', +'keep-with-previous.within-column', +'keep-with-previous.within-page'] +leader_properties = [ +'leader-alignment', +'leader-pattern', +'leader-pattern-width', +'leader-length', +'leader-length.minimum', +'leader-length.optimum', +'leader-length.maximum', +'rule-style', +'rule-thickness'] +line_height_properties = [ +'line-height', +'line-height.minimum', +'line-height.optimum', +'line-height.maximum', +'line-height.precedence', +'line-height.conditionality', +'line-height-shift-adjustment'] +line_related_properties = [ +'text-align', +'text-align-last', +'text-indent', +'last-line-end-indent', +'line-stacking-strategy', +'linefeed-treatment', +'white-space', +'white-space-treatment', +'white-space-collapse', +'wrap-option', +'direction'] +list_block_attlist = [ +'clear'] +list_item_attlist = [ +] +list_item_body_attlist = [ +'id', +'rx:key'] +list_item_label_attlist = [ +'id', +'rx:key'] +list_properties = [ +'provisional-distance-between-starts', +'provisional-label-separation'] +margin_properties_CSS = [ +'margin', +'margin-bottom', +'margin-left', +'margin-right', +'margin-top'] +margin_properties_block = [ +'space-after', +'space-after.minimum', +'space-after.optimum', +'space-after.maximum', +'space-after.precedence', +'space-after.conditionality', +'space-before', +'space-before.minimum', +'space-before.optimum', +'space-before.maximum', +'space-before.precedence', +'space-before.conditionality'] +margin_properties_inheritable = [ +'start-indent', +'end-indent'] +margin_properties_inline = [ +'space-start', +'space-start.minimum', +'space-start.optimum', +'space-start.maximum', +'space-start.precedence', +'space-start.conditionality', +'space-end', +'space-end.minimum', +'space-end.optimum', +'space-end.maximum', +'space-end.precedence', +'space-end.conditionality'] +padding_properties = [ +'padding', +'padding-after', +'padding-after.length', +'padding-after.conditionality', +'padding-before', +'padding-before.length', +'padding-before.conditionality', +'padding-bottom', +'padding-bottom.length', +'padding-bottom.conditionality', +'padding-end', +'padding-end.length', +'padding-end.conditionality', +'padding-left', +'padding-left.length', +'padding-left.conditionality', +'padding-right', +'padding-right.length', +'padding-right.conditionality', +'padding-start', +'padding-start.length', +'padding-start.conditionality', +'padding-top', +'padding-top.length', +'padding-top.conditionality'] +page_sequence_attlist = [ +'format', +'letter-value', +'grouping-separator', +'grouping-size', +'id', +'rx:key', +'initial-page-number', +'force-page-count', +'master-reference'] +region_after_attlist = [ +'extent', +'precedence'] +region_before_attlist = [ +'extent', +'precedence'] +region_body_attlist = [ +'column-count', +'column-gap'] +region_properties = [ +'region-name'] +relative_position_properties = [ +'relative-position', +'position'] +row_group_attlist = [ +'id', +'rx:key'] +simple_page_master_attlist = [ +'master-name', +'page-height', +'page-width', +'reference-orientation', +'size', +'writing-mode'] +table_attlist = [ +'clear'] +table_body_attlist = [ +] +table_cell_attlist = [ +'id', +'rx:key', +'column-number', +'ends-row', +'number-columns-spanned', +'number-rows-spanned', +'starts-row'] +table_header_attlist = [ +] +table_properties_inheritable = [ +'border-collapse', +'border-spacing', +'border-separation', +'border-separation.inline-progression-direction', +'border-separation.block-progression-direction', +'caption-side', +'empty-cells'] +table_properties_unheritable = [ +'table-layout', +'table-omit-header-at-break', +'table-omit-footer-at-break', +'rx:table-omit-initial-header'] +table_row_attlist = [ +] +width_properties = [ +'width', +'min-width', +'max-width', +'inline-progression-dimension', +'inline-progression-dimension.minimum', +'inline-progression-dimension.optimum', +'inline-progression-dimension.maximum'] + +area_properties.extend(area_properties_inheritable) +area_properties.extend(area_properties_unheritable) + +inheritable_properties_inline.extend(aural_properties_inheritable) +inheritable_properties_inline.extend(character_properties_inheritable) +inheritable_properties_inline.extend(font_properties) +inheritable_properties_inline.extend(hyphenation_properties_inline) +inheritable_properties_inline.extend(line_height_properties) + +inheritable_properties_block.extend(table_properties_inheritable) +inheritable_properties_block.extend(area_properties_inheritable) +inheritable_properties_block.extend(hyphenation_properties_block) +inheritable_properties_block.extend(margin_properties_inheritable) +inheritable_properties_block.extend(keeps_and_breaks_properties_inline_inheritable) +inheritable_properties_block.extend(keeps_and_breaks_properties_block_inheritable) +inheritable_properties_block.extend(leader_properties) +inheritable_properties_block.extend(line_related_properties) +inheritable_properties_block.extend(list_properties) + +inheritable_properties.extend(inheritable_properties_inline) +inheritable_properties.extend(inheritable_properties_block) + +border_padding_background_properties.extend(border_properties) +border_padding_background_properties.extend(padding_properties) +border_padding_background_properties.extend(background_properties) + +margin_properties_block.extend(margin_properties_CSS) +margin_properties_inline.extend(margin_properties_CSS) + +keeps_and_breaks_properties_atomic.extend(keeps_properties_atomic) + +common_block_properties.extend(accessibility_properties) +common_block_properties.extend(aural_properties_unheritable) +common_block_properties.extend(border_padding_background_properties) +common_block_properties.extend(margin_properties_block) +common_block_properties.extend(inheritable_properties) + +common_inline_properties.extend(accessibility_properties) +common_inline_properties.extend(aural_properties_unheritable) +common_inline_properties.extend(area_alignment_properties) +common_inline_properties.extend(border_padding_background_properties) +common_inline_properties.extend(character_properties_unheritable) +common_inline_properties.extend(keeps_properties_atomic) +common_inline_properties.extend(margin_properties_inline) +common_inline_properties.extend(relative_position_properties) +common_inline_properties.extend(inheritable_properties_inline) + +region_properties.extend(border_padding_background_properties) + +region_properties.extend(area_properties) +flow_properties.extend(inheritable_properties) + +block_properties.extend(common_block_properties) +block_properties.extend(keeps_and_breaks_properties_atomic) +block_properties.extend(relative_position_properties) + +box_size_properties.extend(height_properties) +box_size_properties.extend(width_properties) + +inline_properties.extend(common_inline_properties) +inline_properties.extend(inheritable_properties_block) + +block_attlist.extend(block_properties) +block_attlist.extend(character_properties_unheritable) +block_container_attlist.extend(area_properties_unheritable) +block_container_attlist.extend(block_properties) +block_container_attlist.extend(box_size_properties) +flow_attlist.extend(flow_properties) +footnote_body_attlist.extend(accessibility_properties) +footnote_body_attlist.extend(inheritable_properties) +inline_attlist.extend(height_properties) +inline_attlist.extend(inline_properties) +list_block_attlist.extend(common_block_properties) +list_block_attlist.extend(keeps_and_breaks_properties_atomic) +list_block_attlist.extend(relative_position_properties) +list_item_attlist.extend(common_block_properties) +list_item_attlist.extend(keeps_and_breaks_properties_atomic) +list_item_attlist.extend(relative_position_properties) +list_item_body_attlist.extend(accessibility_properties) +list_item_body_attlist.extend(inheritable_properties) +list_item_label_attlist.extend(accessibility_properties) +list_item_label_attlist.extend(inheritable_properties) +page_sequence_attlist.extend(inheritable_properties) +region_after_attlist.extend(region_properties) +region_before_attlist.extend(region_properties) +region_body_attlist.extend(margin_properties_CSS) +region_body_attlist.extend(region_properties) +row_group_attlist.extend(accessibility_properties) +row_group_attlist.extend(aural_properties_unheritable) +row_group_attlist.extend(background_properties) +row_group_attlist.extend(border_precedence_properties) +row_group_attlist.extend(border_properties) +row_group_attlist.extend(inheritable_properties) +row_group_attlist.extend(relative_position_properties) +simple_page_master_attlist.extend(margin_properties_CSS) +table_attlist.extend(box_size_properties) +table_attlist.extend(common_block_properties) +table_attlist.extend(keeps_and_breaks_properties_atomic) +table_attlist.extend(table_properties_unheritable) +table_body_attlist.extend(keeps_and_breaks_properties_atomic) +table_body_attlist.extend(row_group_attlist) +table_cell_attlist.extend(accessibility_properties) +table_cell_attlist.extend(aural_properties_unheritable) +table_cell_attlist.extend(border_padding_background_properties) +table_cell_attlist.extend(border_precedence_properties) +table_cell_attlist.extend(box_size_properties) +table_cell_attlist.extend(inheritable_properties) +table_cell_attlist.extend(keeps_and_breaks_properties_atomic) +table_header_attlist.extend(row_group_attlist) +table_row_attlist.extend(height_properties) +table_row_attlist.extend(keeps_and_breaks_properties_atomic) +table_row_attlist.extend(row_group_attlist) + +which_list = { +'block': block_attlist, +'block-container': block_container_attlist, +'cell': table_cell_attlist, +'flow': flow_attlist, +'footnote-body': footnote_body_attlist, +'header': table_header_attlist, +'inline': inline_attlist, +# 'item-body': list_item_body_attlist, +'list-item-body': list_item_body_attlist, +'item-label': list_item_label_attlist, +'list-block':list_block_attlist, +'list-item': list_item_attlist, +'page-sequence': page_sequence_attlist, +'region-after': region_after_attlist, +'region-before': region_before_attlist, +'region-body': region_body_attlist, +'simple-page-master': simple_page_master_attlist, +'table': table_attlist, +'table-body': table_body_attlist, +'table-cell': table_cell_attlist, +'table-header' : table_header_attlist, +'table-row': table_row_attlist +} + +custom_atts = { +'bottom-margin' : 'margin-bottom', +'left-margin' : 'margin-left', +'right-margin' : 'margin-right', +'top-margin' : 'margin-top', +'line-spacing':'line-height', +'first-line-indent': 'text-indent', +'left-indent': 'start-indent', +'right-indent': 'end-indent', +'alignment':'text-align', +'keep-on-same-page': 'keep-together.within-page', +'font': 'font-family', # could be problamatic +'space-from-label': 'provisional-distance-between-starts', +'height': 'page-height', +'width': 'page-width', +# 'space-from-option': 'provisional-distance-between-starts', +# 'space-between-items': 'space-before', +} + + +special_att_sets_dict = { + } + +# att att-sets +special_att_att_set_dict = { +('bold', 'font-style'): [('font-weight','bold')], +('italic', 'font-style'): [('font-style','italic')], +('bold-italic', 'font-style'):[('font-weight','bold'), ('font-style','italic')], +('italic-bold', 'font-style'):[('font-weight','bold'), ('font-style','italic')], +('normal', 'font-style'):[('font-weight', 'normal'), ('font-style', 'normal')] +} + +# att-sets atts +special_att_set_att_dict = { +('bibliographic-fields', 'space-from-field'): [('bibliographic-fields-list-block', 'provisional-distance-between-starts')], +('bibliographic-fields', 'space-from-name'): [('bibliographic-fields-list-block', 'provisional-distance-between-starts')], +('bibliographic-fields', 'space-between-items'): [('bibliographic-fields-list-item', 'space-before')], +('body-section' , 'start-page'):[('body-page-sequence', 'initial-page-number')], +('body-section' , 'page-format'):[('body-page-sequence', 'format')], +('bullet-list', 'space-between-items'): [('bullet-list-item', 'space-before')], +('bullet-list', 'space-from-bullet'): [('bullet-list-block', 'provisional-distance-between-starts')], +('bullet-list-level2', 'space-from-bullet'): [('bullet-level2-list-block', 'provisional-distance-between-starts')], +('bullet-list-level2', 'space-between-items'): [('bullet-level2-list-item', 'space-before')], +('definition-list', 'space-between-items'): [('definition-list-item-block', 'space-before')], +('definition-list', 'space-below-term'): [('definition-term-block', 'space-after')], + +('enumerated-list', 'space-between-items'): [('enumerated-list-item', 'space-before')], +('enumerated-list', 'space-from-number'): [('enumerated-list-block', 'provisional-distance-between-starts')], +('enumerated-list-level2', 'space-from-number'): [('bullet-level2-list-block', 'provisional-distance-between-starts')], +('enumerated-list-level2', 'space-between-items'): [('bullet-level2-list-item', 'space-before')], +('header' , 'height'):[('header-region-before', 'extent'),('region-body', 'margin-top')], +('field-list', 'space-from-name'): [('field-list-block', 'provisional-distance-between-starts')], +('field-list', 'space-between-items'): [('field-list-item', 'space-before')], +('footer' , 'height'):[('footer-region-after', 'extent'),('region-body', 'margin-bottom')], +('toc-section' , 'start-page'):[('toc-page-sequence', 'initial-page-number')], +('toc-section' , 'page-format'):[('toc-page-sequence', 'format')], +('table' , 'width'):[('table', 'inline-progression-dimension')], + +} + +# special: only in certain contexts +special_att_set_att_dict2 = { +('option-list', 'space-from-option', 'list'): [('option-list-block', 'provisional-distance-between-starts')], +('option-list', 'space-between-items', 'list'): [('option-list-item', 'space-before')], +('option-list', 'space-between-items', 'definition'): [('option-list-item-block', 'space-before')], +('option-list', 'space-below-option', 'definition'): [('option-group-block', 'space-after')], + } +special_att_value_dict = { +('font-style', 'bold'): [('font-weight','bold')], +('font-style', 'italic'): [('font-style','italic')], +('font-style','bold-italic'):[('font-weight','bold'), ('font-style','italic')], +('font-style','italic-bold' ):[('font-weight','bold'), ('font-style','italic')], +('font-style', 'normal'):[('font-weight', 'normal'), ('font-style', 'normal')], +('page-break-before' , 'True'):[('break-before', 'page')], +('page-break-before' , 'true'):[('break-before', 'page')], +('page-break-before' , 'Yes'):[('break-before', 'page')], +('page-break-before' , 'yes'):[('break-before', 'page')], +('page-break-before' , 'False'):[('break-before', 'auto')], +('page-break-before' , 'ralse'):[('break-before', 'auto')], +('page-break-before' , 'No'):[('break-before', 'auto')], +('page-break-before' , 'no'):[('break-before', 'auto')], +('page-break-after' , 'True'):[('break-after', 'page')], +('page-break-after' , 'true'):[('break-after', 'page')], +('page-break-after' , 'Yes'):[('break-after', 'page')], +('page-break-after' , 'yes'):[('break-after', 'page')], +('page-break-after' , 'False'):[('break-after', 'auto')], +('page-break-after' , 'ralse'):[('break-after', 'auto')], +('page-break-after' , 'No'):[('break-after', 'auto')], +('page-break-after' , 'no'):[('break-after', 'auto')], +('keep-with-next' , 'True'):[('keep-with-next', 'always')], +('keep-with-next' , 'true'):[('keep-with-next', 'always')], +('keep-with-next' , 'Yes'):[('keep-with-next', 'always')], +('keep-with-next' , 'yes'):[('keep-with-next', 'always')], +('keep-with-previous' , 'True'):[('keep-with-previous', 'always')], +('keep-with-previous' , 'true'):[('keep-with-previous', 'always')], +('keep-with-previous' , 'Yes'):[('keep-with-previous', 'always')], +('keep-with-previous' , 'yes'):[('keep-with-previous', 'always')], +('keep-on-same-page' , 'True'):[('keep-together.within-page', 'always')], +('keep-on-same-page' , 'true'):[('keep-together.within-page', 'always')], +('keep-on-same-page' , 'Yes'):[('keep-together.within-page', 'always')], +('keep-on-same-page' , 'yes'):[('keep-together.within-page', 'always')], +('vertical-alignment' , 'bottom'):[('display-align', 'after')], +('vertical-alignment' , 'top'):[('display-align', 'before')], +('vertical-alignment' , 'center'):[('display-align', 'center')], +} + +special_values_dict = { + } + + +# ================================================================== +# PROPERTIES THAT ARE REALLY PARAMS + +prop_as_param_dict = { +'page.page-layout':'page-layout', +'title-subtitle.placement': 'title-pagination', +'bibliographic-fields.placement' : 'bibliographic-pagination', +'dedication.placement': 'dedication-pagination', +'abstract.placement': 'abstract-pagination', +'toc.placement': 'toc-pagination', +'front.order': 'font-order', +'header.suppress-first-page': 'suppress-first-page-header', +'footer.suppress-first-page': 'suppress-first-page-footer', +'bibliographic-fields.author-text': 'author-text', +'bibliographic-fields.authors-text': 'authors-text', +'bibliographic-fields.organization-text': 'organization-text', +'bibliographic-fields.contact-text': 'contact-text', +'bibliographic-fields.status-text': 'status-text', +'bibliographic-fields.copyright-text': 'copyright-text', +'bibliographic-fields.address-text': 'address-text', +'bibliographic-fields.revision-text': 'revision-text', +'bibliographic-fields.date-text': 'date-text', +'bibliographic-fields.format': 'bibliographic-format', +'bibliographic-field-custom1.text': 'custom-bib-info1-name', +'bibliographic-field-custom2.text': 'custom-bib-info2-name', +'bibliographic-field-custom3.text': 'custom-bib-info3-name', +'bibliographic-field-custom4.text': 'custom-bib-info4-name', +'bibliographic-field-custom5.text': 'custom-bib-info5-name', +'bibliographic-field-custom6.text': 'custom-bib-info6-name', +'bibliographic-field-custom7.text': 'custom-bib-info7-name', +'bibliographic-field-custom8.text': 'custom-bib-info8-name', +'bibliographic-field-custom9.text': 'custom-bib-info9-name', +'bibliographic-field-custom10.text': 'custom-bib-info10-name', +'heading1.number-format':'number-section1', +'heading2.number-format':'number-section2', +'heading3.number-format':'number-section3', +'heading4.number-format':'number-section4', +'heading5.number-format':'number-section5', +'heading6.number-format':'number-section6', +'heading7.number-format':'number-section7', +'headings.inherit-sections-number':'inherit-section-num', +'line-block.number': 'number-verse', +'transition.text':'transition-text', +'bullet-list.text': 'bullet-text', +'bullet-list-level2.text': 'bullet-text-level2', +'option-list.format':'option-list-format', +'options-list.separator': 'options-separator', +'document.page-layout': 'page-layout', +'block-quote.attriubution-text' : 'text-before-block-quote-attribution', +'table.column-widths': 'table-cols', +} + + +# ======================================================================== +# DEFAULT PARAMS +param_dict = { +'abstract-pagination' : 'with-front', +'address-text' : 'Address: ', +'attention-title' : 'Attention!', +'author-text' : 'Author: ', +'authors-text' : 'Authors: ', +'bibliographic-pagination' : 'with-toc', +'bullet-text' : '•', +'caution-title' : 'Caution!', +'contact-text' : 'Contact: ', +'copyright-text' : 'Copyright: ', +'danger-title' : '!Danger!', +'date-text' : 'Date: ', +'dedication-pagination' : 'with-front', +'error-title' : 'Error', +'footnote-placement' : 'footnote', +'footnote-style' : 'list', +'front-order' : 'title,bibliographic,dedication,abstract,toc', +'hint-title' : 'Hint', +'important-title' : 'Important', +'inherit-section-num' : 'True', +'internal-link-type' : 'link', +'note-title' : 'Note', +'number-section1' : '1', +'number-section2' : '.1', +'number-section3' : '.1', +'number-section4' : '.1', +'number-section5' : '.1', +'number-section6' : '.1', +'number-section7' : '.1', +'number-section8' : '.1', +'number-section9' : '.1', +'number-verse' : '', +'option-list-format' : 'list', +'options-separator' : ', ', +'organization-text' : 'Organization: ', +'page-layout' : 'simple', +'revision-text' : 'Revision: ', +'space-between-footnotes' : '5pt', +'spacing-footer' : '', +'spacing-header' : '', +'status-text' : 'Status: ', +'strict' : '', +'suppress-first-page-footer' : '', +'suppress-first-page-header' : '', +'table-title-placement' : 'bottom', +'test' : '', +'text-before-block-quote-attribution' : '—', +'text-before-epigraph-attribution' : '—', +'text-before-pull-quote-attribution' : '—', +'tip-title' : 'Tip', +'title-pagination' : 'with-front', +'toc-pagination' : 'with-toc', +'transition-text' : '***', +'version-text' : 'Version: ', +'warning-title' : 'Warning!', +} +param_list = param_dict.keys() + +true_or_false_dict = {'True':'True', 'true':'True', 'yes':'True', 'Yes': 'True', 'False': 'False', + 'false':'False', 'no': 'False', 'No':'False'} +true_dict = {'true':True, 'True':True, 'yes':True, 'Yes':True} +false_dict = {'false':False, 'False':False, 'none': False, 'None':False, 'no': False, 'No':False} +param_dict_test = {'strict':true_or_false_dict, + 'suppress-first-page-header': true_or_false_dict, + 'suppress-first-page-footer': true_or_false_dict, + } + +# Commands List +# ========================================================================= +commands_list = ['xsl-stylesheet'] diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/make_stylesheet.py b/sandbox/paultremblay/python_interface/docutilsToFo/make_stylesheet.py new file mode 100644 index 000000000..ce93742dd --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/make_stylesheet.py @@ -0,0 +1,418 @@ +#! /Library/Frameworks/Python.framework/Versions/2.7/bin/python +# $Id$ +import sys, copy, os, ConfigParser, pprint, types +from docutils_fo_dicts import * +from xml.sax import saxutils +class FOConfigFileException(Exception): + pass + +def dump(object): + pp = pprint.PrettyPrinter(indent=4) + sys.stderr.write(pp.pformat(object)) + sys.stderr.write('\n') + + +class Dump: + def __init__(self): + pass + +class WriteStylesheet: + + def __init__(self, verbose = 0): + self.__verbose = verbose + self.__string = '' + + def __write_start_element(self, name, atts): + pass + + def __write_end_element(self, name): + pass + + def __write_root_start(self): + self.__string += """<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + >\n\n""" + pass + + def __write_root_end(self): + self.__string +='</xsl:stylesheet>' + + def __write_att_sets(self): + self.__string += '\n <!--ATTRIBUTE SETS-->\n\n' + att_sets = self.__att_sets.keys() + for att_set in att_sets: + self.__string += ' <xsl:attribute-set name="%s">\n' % (att_set) + att_dict = self.__att_sets[att_set] + atts = att_dict.keys() + for att in atts: + self.__string += ' <xsl:attribute name="%s">' % (att) + self.__string += saxutils.escape(att_dict[att]) + self.__string += '</xsl:attribute>\n' + + self.__string += ' </xsl:attribute-set>\n\n' + + def __write_import(self): + self.__string += """ <xsl:import href= "%s"/>\n\n""" % (self.__import_ss) + + def __write_params(self): + self.__string += '\n <!--PARAMS-->\n\n' + the_keys = self.__params.keys() + the_keys.sort() + for the_key in the_keys: + value = saxutils.escape(self.__params[the_key]) + self.__string += ' <xsl:param name = "%s">%s</xsl:param>\n' % (the_key, value) + self.__string += '\n\n' + + def write_stylesheet(self, import_ss, params, att_sets, out=None): + self.__import_ss = import_ss + self.__params = params + self.__att_sets = att_sets + self.__out = out + self.__write_root_start() + self.__write_import() + self.__write_params() + self.__write_att_sets() + self.__write_root_end() + return self.__string + +class PostProcess: + + def __init__(self, params, attribute_sets): + self.__attribute_sets = attribute_sets + self.__params = params + + + # not used + def __test_measure(self, the_string): + """ + test if string is a measure: + 12pt returns 12, pt + 1.5 returns None, None + + """ + accept_units = ['em', 'px', 'in', 'cm', 'mm', 'pt', 'pc'] + try: + float(the_string) + return None, None + except ValueError: + pass + if len(the_string) < 3: + return None, None + unit = the_string[-2:] + if unit not in accept_units: + return None, None + num = the_string[:-2] + try: + num = float(num) + except ValueError: + return None, None + return num, unit + + # not used + def __get_default_font_size(self): + document_att_set = self.__attribute_sets.get('default-page-sequence') + body_att_set = self.__attribute_sets.get('default-flow') + if document_att_set and document_att_set.get('font-size'): + default_font_size = document_att_set.get('font-size') + elif body_att_set and document_att_set.get('font-size'): + default_font_size = body_att_set.get('font-size') + else: + default_font_size = '12pt' + num, unit = self.__test_measure(default_font_size) + if not num: + default_font_size = '12pt' + self.__default_font_size = default_font_size + + def __fix_header_footer(self): + # have to set the param spacing-header to extent, if not already set + #custom-spacing-header-footer + header_att_set = self.__attribute_sets.get('header-region-before') + if header_att_set: + extent = header_att_set.get('extent') + if extent and not self.__params.get('spacing-header'): + # self.__params['spacing-header'] = extent + self.__params['custom-spacing-header-footer'] = 'yes' + + footer_att_set = self.__attribute_sets.get('footer-region-after') + if footer_att_set: + extent = footer_att_set.get('extent') + if extent and not self.__params.get('spacing-footer'): + # self.__params['spacing-footer'] = extent + self.__params['custom-spacing-header-footer'] = 'yes' + + + def __fix_title(self): + doc_tit_att_set = self.__attribute_sets.get('document-title-page-block') + if doc_tit_att_set: + space_before = doc_tit_att_set.get('space-before') + if space_before: + self.__attribute_sets['document-title-page-block']['space-before.conditionality'] = 'retain' + + + def __get_page_layout(self): + odd_page = self.__attribute_sets.get('odd-simple-page-master') + even_page = self.__attribute_sets.get('even-simple-page-master') + first_page = self.__attribute_sets.get('first-simple-page-master') + suppress_first_header = self.__params.get('suppress-first-page-header') + suppress_first_footer = self.__params.get('suppress-first-page-footer') + need_odd_or_even_page = False + if odd_page or even_page: + need_odd_or_even_page = True + need_first_page = False + # if suppress_first_footer or suppress_first_header or first_page: + # need_first_page = True + + if self.__params.get('page-layout'): + page_layout = self.__params.get('page-layout') + elif need_first_page and need_odd_or_even_page: + page_layout = 'first-odd-even' + elif need_first_page: + page_layout = 'first' + elif need_odd_or_even_page: + page_layout = 'odd-even' + else: + page_layout = '' + self.__params['page-layout'] = page_layout + + + + + def post_process(self): + self.__get_default_font_size() + self.__fix_header_footer() + self.__get_page_layout() + self. __fix_title() + return self.__attribute_sets, self.__params + +class ReadConfig: + + def __init__(self, import_ss = None, verbose = 0, config_file = None): + self.__verbose = verbose + if self.__verbose > 4: + sys.stderr.write('modules is "%s"\n' % __file__) + self.__attribute_sets = {} + self.__params = {} + self.__import_ss = import_ss + if not self.__import_ss: + self.__import_ss = os.path.join(os.path.dirname(__file__), 'xsl_fo','docutils_to_fo.xsl') + if os.sep != '/': + self.__correct_path = self.__correct_path(self.__import_ss) + if not os.path.isfile(self.__import_ss): + msg = '"%s" cannot be found\n' % (self.__import_ss) + raise FOConfigFileException(msg) + if self.__verbose > 3: + sys.stderr.write('self.__import_ss (stylesheet to import) is "%s" \n' % self.__import_ss) + self.__config_file = config_file + if self.__verbose > 3 and self.__config_file: + sys.stderr.write('self.__config_file is "%s" \n' % self.__config_file) + + def __correct_path(self, the_path): + """ + make sure the_path is os.path.abs(the_path) and that + the_path really exits or this may not work + + """ + paths = [] + head = None + counter = 1 + while 1: + counter += 1 + if not head: + head = the_path + head, tail = os.path.split(head) + paths.insert(0,tail) + if not tail: + break + if counter > 100: + raise RuntimeError, 'max num recursions (100) reached' + return '/'.join(paths) + + def write_config_file(self, dest=None): + w = WriteStylesheet() + ss_string = w.write_stylesheet(import_ss = self.__import_ss, params = self.__params, + att_sets = self.__attribute_sets) + return ss_string + + + def read_config_files(self): + config = ConfigParser.SafeConfigParser() + config_files = [] + if self.__config_file: + config.read(self.__config_file) + return config + if os.environ.get('HOME'): + config_files.append(os.path.join(os.environ.get('HOME'), '.docutils')) + config_files.append(os.path.join(os.getcwd(), 'docutils.conf')) + for the_path in config_files: + config.read(the_path) + if self.__verbose > 4: + sys.stderr.write('config is: \n' ) + dump(config.items('FO')) + return config + + + def parse_config_files(self): + config = self.read_config_files() + self.__config = config + if not 'FO' in config.sections(): + return + opts = config.items('FO') + opts_dict = {} + for pair_tupple in opts: + first = pair_tupple[0] + second = pair_tupple[1] + fields = first.split('.', 1) + if prop_as_param_dict.get(first): + self.__handle_param(prop_as_param_dict.get(first), second) + elif len(fields) == 2: + self.__handle_attributes(fields[0], fields[1], second) + elif first in param_list: + self.__handle_param(first, second) + elif first in commands_list: + pass + else: + self.__error('"%s" = "%s" not a valid config option\n' % (first, second)) + + def __post_process(self): + post_process_obj = PostProcess(attribute_sets = self.__attribute_sets, params = self.__params) + self.__attribute_sets, self.__params = post_process_obj.post_process() + if self.__verbose > 4: + sys.stderr.write('self.__attribute_sets after post process:\n') + dump(self.__attribute_sets) + sys.stderr.write('self.__params after post process:\n') + dump(self.__params) + sys.stderr.write('\n') + + def __get_shortcut_att_set(self, user_att_set): + format = self.__get_config_option(option = 'option-list.format', default = 'list') + att_set = short_cut_att_sets.get(user_att_set) + if att_set: + return att_set + att_set = short_cut_att_sets2.get((user_att_set, format)) + if att_set: + return att_set + elif att_set == None: + return user_att_set + + def __get_special_set_att(self, user_att_set, user_att): + format = self.__get_config_option(option = 'option-list.format', default = 'list') + spc_att_set_att_list = special_att_set_att_dict.get((user_att_set, user_att)) + if spc_att_set_att_list: + return spc_att_set_att_list + spc_att_set_att_list = special_att_set_att_dict2.get((user_att_set, user_att, format)) + if spc_att_set_att_list: + return spc_att_set_att_list + + + def __handle_attributes(self, user_att_set, user_att, value, check_special = True, s=None): + if special_att_sets_dict.get(user_att_set) and check_special: + self.__handle_special_atts(user_att_set, user_att, value) + return + + # change both att-set and att + spc_att_set_att_list = self.__get_special_set_att(user_att_set, user_att) + if spc_att_set_att_list and check_special: + for new_pair in spc_att_set_att_list: + att_set = new_pair[0] + att = new_pair[1] + self.__add_attribute(att_set, att, value ) + return + att_set = self.__get_shortcut_att_set(user_att_set) + fo_element = att_set_dict.get(att_set) + + spc_att_val_list = special_att_value_dict.get((user_att, value)) + if spc_att_val_list and fo_element: + for new_pair in spc_att_val_list: + att = new_pair[0] + value = new_pair[1] + self.__add_attribute(att_set, att, value ) + return + + elif fo_element: # found a valid att-set + att = custom_atts.get(user_att) + if not att: # valid attriubute, according to FO standards + att = user_att + if att not in which_list.get(fo_element): + self.__error('%s not a valid value for att-set %s' % (user_att, user_att_set)) + else: + self.__add_attribute(att_set, att, value ) + else: + self.__error('%s not a valid attribute-set' % (user_att_set)) + + def __check_value(self, att, value): + special = special_values_dict.get(value) + if special: + if special[0] == att: + return special[1] + else: + return value + else: + return value + + def __add_attribute(self, att_set, att, value): + att_exists = self.__attribute_sets.get(att_set) + if not att_exists: + self.__attribute_sets[att_set] = {} + value = self.__check_value(att, value) + self.__attribute_sets[att_set][att] = value + + def __error(self, msg): + # sys.stderr.write(msg) + # sys.stderr.write('\n') + raise FOConfigFileException(msg) + + def __get_config_option(self, option, section = 'FO', default = None): + try: + option = self.__config.get('FO', 'option-list.format') + return option + except ConfigParser.NoOptionError: + return default + + def __handle_special_atts(self, user_att_set, user_att, value): + # for opt list as list + att_list_dict = {'space-from-option_off':'provisional-distance-between-starts'} + # for opt list as def + att_def_dict = {'':''} + att_def_not_allowed = ['space-from-option_', 'space-from-label_'] + if user_att_set == 'option-list': + format = self.__get_config_option(option = 'option-list.format', default = 'list') + if format == 'list': + changed_att = att_list_dict.get(user_att) + if changed_att: + user_att = changed_att + self.__handle_attributes('option-list', user_att, value, check_special = False) + elif format == 'definition': + if user_att in att_def_not_allowed: + self.__error('%s.%s = %s not a valid attribute property\n' % + (user_att_set, user_att, value)) + self.__handle_attributes('option-list-definition-block', + user_att, value, check_special = False) + else: + self.__error('%s.%s = %s not a valid attribute property\n' % (user_att_set, user_att, value)) + + + def __handle_param(self, param, value): + to_test_dict = param_dict_test.get(param) + if to_test_dict: + correct_value = to_test_dict.get(value) + if correct_value: + self.__params[param] = correct_value + else: + self.__error('%s = %s not a valid command\n' % (param, value)) + else: + self.__params[param] = value + + def make_stylesheet(self): + self.parse_config_files() + self.__post_process() + ss_string = self.write_config_file() + return ss_string + # self.print_att_list() + + +if __name__ == '__main__': + read_config_obj = ReadConfig(import_ss = '/Users/cynthia/tmp/paultremblay/xsl_fo/docutils_to_fo.xsl' ) + ss_string = read_config_obj.main() + print ss_string diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/rst2xml_lib.py b/sandbox/paultremblay/python_interface/docutilsToFo/rst2xml_lib.py new file mode 100644 index 000000000..cb4216ace --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/rst2xml_lib.py @@ -0,0 +1,213 @@ +#!/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python +# $Id$ + +import cStringIO, sys +from lxml import etree +import lxml +import os + + +the_settings_dict = { '_config_files': ['/Users/cynthia/.docutils'], + '_destination': None, + '_disable_config': None, + '_source': 'test.rst', + 'auto_id_prefix': 'id', + 'config': None, + 'datestamp': None, + 'debug': None, + 'docinfo_xform': 1, + 'doctitle_xform': 1, + 'doctype_declaration': 1, + 'dump_internals': None, + 'dump_pseudo_xml': None, + 'dump_settings': None, + 'dump_transforms': None, + 'error_encoding': 'US-ASCII', + 'error_encoding_error_handler': 'backslashreplace', + 'exit_status_level': 5, + 'expose_internals': None, + 'file_insertion_enabled': 1, + 'footnote_backlinks': 1, + 'generator': None, + 'halt_level': 4, + 'id_prefix': '', + 'indents': None, + 'input_encoding': None, + 'input_encoding_error_handler': 'strict', + 'language_code': 'en', + 'newlines': None, + 'output_encoding': 'utf-8', + 'output_encoding_error_handler': 'xmlcharrefreplace', + 'pep_base_url': 'http://www.python.org/dev/peps/', + 'pep_file_url_template': 'pep-%04d', + 'pep_references': None, + 'raw_enabled': 1, + 'report_level': 2, + 'rfc_base_url': 'http://www.faqs.org/rfcs/', + 'rfc_references': None, + 'sectnum_xform': 1, + 'sectsubtitle_xform': 0, + 'source_link': None, + 'source_url': None, + 'strict_visitor': None, + 'strip_classes': None, + 'strip_comments': None, + 'strip_elements_with_classes': None, + 'tab_width': 8, + 'title': 'BOZO', + 'toc_backlinks': 'entry', + 'traceback': None, + 'trim_footnote_reference_space': None, + 'warning_stream': None, + 'xml_declaration': 1} + +def publish_xml_cmdline (in_path = None, in_string = None, out_path = None, settings_overrides=None ): + try: + import locale + locale.setlocale(locale.LC_ALL, '') + except: + pass + + + from docutils.core import default_description, default_usage, publish_file, publish_string + import docutils.core + description = ('Generates Docutils-native XML from standalone ' + 'reStructuredText sources. ' + default_description) + + if not in_path and not in_string: + raise TypeError('publish_xml_cmdlind() must have either "in_path" or "in_string" as parameters') + + + if in_path: + out_string = publish_file(source_path= in_path, destination_path=out_path, + settings_overrides = settings_overrides, writer_name='xml') + + elif in_string: + out_string = publish_string(source= in_string, destination_path=out_path, + settings_overrides = settings_overrides, writer_name='xml') + return out_string + + +def report_xsl_error(transform_error_obj): + for error_obj in transform_error_obj: + sys.stderr.write(error_obj.message) + sys.stderr.write('\n') + if error_obj.line != 0 and error_obj.column != 0: + sys.stderr.write(str(error_obj.line)) + sys.stderr.write(str(error_obj.column)) + #print error_obj.type, 'type' + #print error_obj.type_name, 'type_name' + +def validate_docutils(xml_file): + doc = etree.parse(file(xml_file)) + validate_docutils_rng(doc) + +# validate through xslt stylesheet +def validate_fo_xsl(xml_file): + xsl_ss = os.path.join(os.path.dirname(__file__), 'valid','folint.xsl') + xslt_doc = etree.parse(xsl_ss) + transform = etree.XSLT(xslt_doc) + try: + indoc = etree.parse(xml_file) + except lxml.etree.XMLSyntaxError, msg: + sys.stderr.write('Invalid XML\n') + sys.stderr.write(str(msg)) + sys.stderr.write('\n') + return 1 + try: + outdoc = transform(indoc) + except lxml.etree.XSLTApplyError, error: + msg = 'error converting %s to %s with %s:\n' % (xml_file, out_file, xslt_file) + msg += str(error) + msg += '\n' + report_xsl_error(transform.error_log) + return 1 + report_xsl_error(transform.error_log) + return len(transform.error_log) + +def validate_docutils_rng(xml_obj): + the_rng = os.path.join(os.path.dirname(__file__), 'valid','docutils.rng') + relaxng_doc = etree.parse(file(the_rng)) + relaxng = etree.RelaxNG(relaxng_doc) + is_valid = relaxng.validate(xml_obj) + if not is_valid: + sys.stderr.write('Document not Valid:\n') + report_xsl_error(relaxng.error_log) + return 1 + + + +def validate_docutils_dtd(xml_obj): + the_dtd = os.path.join(os.path.dirname(__file__), 'valid','docutils.dtd') + if not os.path.isfile(the_dtd): + msg = '"%s" cannot be found\n' % (the_dtd) + raise IOError(msg) + + dtd = etree.DTD(file(the_dtd)) + is_valid = dtd.validate(xml_obj) + if not is_valid: + sys.stderr.write('Document not Valid:\n') + report_xsl_error(dtd.error_log) + return 1 + +def transform_lxml(xslt_file, xml_file, valid_docutils = True, + param_dict = {}, out_file = None, verbose = 0, valid_fo = True): + # have to put quotes around string params + temp = {} + the_keys = param_dict.keys() + for the_key in the_keys: + if len(the_key) > 0: + if the_key[0] == '"' and the_key[-1] == '"': + temp[the_key] = param_dict[the_key] + elif the_key[0] == "'" and the_key[-1] == "'": + temp[the_key] = param_dict[the_key] + else: + temp[the_key] = "'%s'" % param_dict[the_key] + param_dict = {} + param_dict.update(temp) + + xslt_doc = etree.parse(xslt_file) + try: + transform = etree.XSLT(xslt_doc) + except lxml.etree.XSLTParseError, error: + sys.stderr.write(str(error) + '\n') + return 1 + try: + indoc = etree.parse(xml_file) + except lxml.etree.XMLSyntaxError, msg: + sys.stderr.write('Invalid XML\n') + sys.stderr.write(str(msg)) + sys.stderr.write('\n') + return 1 + if valid_docutils: + not_valid = validate_docutils_rng(indoc) + if not_valid: + return 1 + elif verbose > 2: + sys.stderr.write('docutils document is valid\n') + try: + outdoc = transform(indoc, **param_dict) + except lxml.etree.XSLTApplyError, error: + msg = 'error converting %s to %s with %s:\n' % (xml_file, out_file, xslt_file) + msg += str(error) + msg += '\n' + report_xsl_error(transform.error_log) + return 1 + report_xsl_error(transform.error_log) + if valid_fo: + not_valid = validate_fo_xsl(cStringIO.StringIO(str(outdoc))) + if not_valid: + return 1 + elif verbose > 2: + sys.stderr.write('FO document is valid\n') + if out_file: + write_obj = open(out_file, 'w') + outdoc.write(write_obj) + write_obj.close() + else: + sys.stdout.write(str(outdoc)) + + +if __name__ == '__main__': + custom = {'title':'Doc Title'} + publish_xml_cmdline('test.rst', 'out.xml', custom) diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/valid/basic_properties.rng b/sandbox/paultremblay/python_interface/docutilsToFo/valid/basic_properties.rng new file mode 100644 index 000000000..6cb38b8fe --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/valid/basic_properties.rng @@ -0,0 +1,3087 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ========================================================= + + (c) 2004, RenderX + + Author: Alexander Peshkov <peshkov@renderx.com> + + Permission is granted to use this document, copy and + modify free of charge, provided that every derived work + bear a reference to the present document. + + This document contains a computer program written in + XSL Transformations Language. It is published with no + warranty of any kind about its usability, as a mere + example of XSL technology. RenderX shall not be + considered liable for any damage or loss of data caused + by use of this program. + + ========================================================= +--> +<grammar xmlns:rx="http://www.renderx.com/XSL/Extensions" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <include href="datatype.rng"/> + <!-- + =============================================================== + Common properties content models used by several attributes + =============================================================== + --> + <define name="border-style.attr-content"> + <choice> + <value>none</value> + <value>hidden</value> + <value>dotted</value> + <value>dashed</value> + <value>solid</value> + <value>double</value> + <value>groove</value> + <value>ridge</value> + <value>inset</value> + <value>outset</value> + <value>inherit</value> + </choice> + </define> + <define name="orientation.attr-content"> + <choice> + <value>0</value> + <value>90</value> + <value>180</value> + <value>270</value> + <value>-90</value> + <value>-180</value> + <value>-270</value> + <value>0deg</value> + <value>90deg</value> + <value>180deg</value> + <value>270deg</value> + <value>-90deg</value> + <value>-180deg</value> + <value>-270deg</value> + <value>inherit</value> + </choice> + </define> + <define name="keep.attr-content"> + <choice> + <value>auto</value> + <value>always</value> + <ref name="integer.datatype"/> + </choice> + </define> + <!-- + =============================================================== + Definitions of all the attributes (properties) used in XSL FO + includeing those from RX extensions + (definitions of attributes bearing 'rx' namespace named as rx-..., + but sorted according to the actual attribute name) + =============================================================== + --> + <define name="absolute-position.attr"> + <attribute name="absolute-position"> + <choice> + <value>absolute</value> + <value>fixed</value> + </choice> + </attribute> + </define> + <!-- MEMO: We forced to separate this property from actual 'absolute-position' --> + <define name="container-position.attr"> + <attribute name="absolute-position"> + <choice> + <value>auto</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="active-state.attr"> + <attribute name="active-state"> + <choice> + <value>link</value> + <value>visited</value> + <value>active</value> + <value>hover</value> + <value>focus</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="alignment-adjust.attr"> + <attribute name="alignment-adjust"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="alignment-baseline.attr"> + <attribute name="alignment-baseline"> + <choice> + <value>auto</value> + <value>baseline</value> + <value>before-edge</value> + <value>text-before-edge</value> + <value>middle</value> + <value>central</value> + <value>after-edge</value> + <value>text-after-edge</value> + <value>top</value> + <value>text-top</value> + <value>bottom</value> + <value>text-bottom</value> + <value>ideographic</value> + <value>alphabetic</value> + <value>hanging</value> + <value>mathematical</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="auto-restore.attr"> + <attribute name="auto-restore"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="azimuth.attr"> + <attribute name="azimuth"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background.attr"> + <attribute name="background"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-attachment.attr"> + <attribute name="background-attachment"> + <choice> + <value>scroll</value> + <value>fixed</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-color.attr"> + <attribute name="background-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-image.attr"> + <attribute name="background-image"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-position.attr"> + <attribute name="background-position"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-position-horizontal.attr"> + <attribute name="background-position-horizontal"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-position-vertical.attr"> + <attribute name="background-position-vertical"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-repeat.attr"> + <attribute name="background-repeat"> + <choice> + <value>repeat</value> + <value>repeat-x</value> + <value>repeat-y</value> + <value>no-repeat</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <!-- RenderX extension attributes --> + <define name="rx-background-content-type.attr"> + <attribute name="rx:background-content-type"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rx-background-content-height.attr"> + <attribute name="rx:background-content-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rx-background-content-width.attr"> + <attribute name="rx:background-content-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rx-background-scaling.attr"> + <attribute name="rx:background-scaling"> + <choice> + <value>uniform</value> + <value>non-uniform</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="baseline-shift.attr"> + <attribute name="baseline-shift"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="blank-or-not-blank.attr"> + <attribute name="blank-or-not-blank"> + <choice> + <value>blank</value> + <value>not-blank</value> + <value>any</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="block-progression-dimension.attr"> + <attribute name="block-progression-dimension"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="block-progression-dimension.maximum.attr"> + <attribute name="block-progression-dimension.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="block-progression-dimension.minimum.attr"> + <attribute name="block-progression-dimension.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="block-progression-dimension.optimum.attr"> + <attribute name="block-progression-dimension.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border.attr"> + <attribute name="border"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-color.attr"> + <attribute name="border-after-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-precedence.attr"> + <attribute name="border-after-precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-style.attr"> + <attribute name="border-after-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-width.attr"> + <attribute name="border-after-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-width.conditionality.attr"> + <attribute name="border-after-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-width.length.attr"> + <attribute name="border-after-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-color.attr"> + <attribute name="border-before-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-precedence.attr"> + <attribute name="border-before-precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-style.attr"> + <attribute name="border-before-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-width.attr"> + <attribute name="border-before-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-width.conditionality.attr"> + <attribute name="border-before-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-width.length.attr"> + <attribute name="border-before-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom.attr"> + <attribute name="border-bottom"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom-color.attr"> + <attribute name="border-bottom-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom-style.attr"> + <attribute name="border-bottom-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom-width.attr"> + <attribute name="border-bottom-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom-width.conditionality.attr"> + <attribute name="border-bottom-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom-width.length.attr"> + <attribute name="border-bottom-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-collapse.attr"> + <attribute name="border-collapse"> + <choice> + <value>collapse</value> + <value>collapse-with-precedence</value> + <value>separate</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-color.attr"> + <attribute name="border-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-color.attr"> + <attribute name="border-end-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-precedence.attr"> + <attribute name="border-end-precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-style.attr"> + <attribute name="border-end-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-width.attr"> + <attribute name="border-end-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-width.conditionality.attr"> + <attribute name="border-end-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-width.length.attr"> + <attribute name="border-end-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left.attr"> + <attribute name="border-left"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left-color.attr"> + <attribute name="border-left-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left-style.attr"> + <attribute name="border-left-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left-width.attr"> + <attribute name="border-left-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left-width.conditionality.attr"> + <attribute name="border-left-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left-width.length.attr"> + <attribute name="border-left-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right.attr"> + <attribute name="border-right"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right-color.attr"> + <attribute name="border-right-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right-style.attr"> + <attribute name="border-right-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right-width.attr"> + <attribute name="border-right-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right-width.conditionality.attr"> + <attribute name="border-right-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right-width.length.attr"> + <attribute name="border-right-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-separation.attr"> + <attribute name="border-separation"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-separation.block-progression-direction.attr"> + <attribute name="border-separation.block-progression-direction"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-separation.inline-progression-direction.attr"> + <attribute name="border-separation.inline-progression-direction"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-spacing.attr"> + <attribute name="border-spacing"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-color.attr"> + <attribute name="border-start-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-precedence.attr"> + <attribute name="border-start-precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-style.attr"> + <attribute name="border-start-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-width.attr"> + <attribute name="border-start-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-width.conditionality.attr"> + <attribute name="border-start-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-width.length.attr"> + <attribute name="border-start-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-style.attr"> + <attribute name="border-style"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top.attr"> + <attribute name="border-top"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top-color.attr"> + <attribute name="border-top-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top-style.attr"> + <attribute name="border-top-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top-width.attr"> + <attribute name="border-top-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top-width.conditionality.attr"> + <attribute name="border-top-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top-width.length.attr"> + <attribute name="border-top-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-width.attr"> + <attribute name="border-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="bottom.attr"> + <attribute name="bottom"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="break-after.attr"> + <attribute name="break-after"> + <choice> + <value>auto</value> + <value>column</value> + <value>page</value> + <value>even-page</value> + <value>odd-page</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="break-before.attr"> + <attribute name="break-before"> + <choice> + <value>auto</value> + <value>column</value> + <value>page</value> + <value>even-page</value> + <value>odd-page</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="caption-side.attr"> + <attribute name="caption-side"> + <choice> + <value>before</value> + <value>after</value> + <value>start</value> + <value>end</value> + <value>top</value> + <value>bottom</value> + <value>left</value> + <value>right</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="case-name.attr"> + <attribute name="case-name"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="case-title.attr"> + <attribute name="case-title"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="character.attr"> + <attribute name="character"/> + </define> + <define name="clear.attr"> + <attribute name="clear"> + <choice> + <value>start</value> + <value>end</value> + <value>left</value> + <value>right</value> + <value>both</value> + <value>none</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="clip.attr"> + <attribute name="clip"> + <choice> + <ref name="shape.datatype"/> + <value>auto</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="collapse-subtree.attr"> + <attribute name="collapse-subtree"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="color.attr"> + <attribute name="color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="color-profile-name.attr"> + <attribute name="color-profile-name"/> + </define> + <define name="column-count.attr"> + <attribute name="column-count"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="column-gap.attr"> + <attribute name="column-gap"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="column-number.attr"> + <attribute name="column-number"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="column-width.attr"> + <attribute name="column-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="content-height.attr"> + <attribute name="content-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="content-type.attr"> + <attribute name="content-type"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="content-width.attr"> + <attribute name="content-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="country.attr"> + <attribute name="country"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="cue.attr"> + <attribute name="cue"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="cue-after.attr"> + <attribute name="cue-after"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="cue-before.attr"> + <attribute name="cue-before"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="destination-placement-offset.attr"> + <attribute name="destination-placement-offset"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="direction.attr"> + <attribute name="direction"> + <choice> + <value>ltr</value> + <value>rtl</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="display-align.attr"> + <attribute name="display-align"> + <choice> + <value>auto</value> + <value>before</value> + <value>center</value> + <value>after</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="dominant-baseline.attr"> + <attribute name="dominant-baseline"> + <choice> + <value>auto</value> + <value>use-script</value> + <value>no-change</value> + <value>reset-size</value> + <value>ideographic</value> + <value>alphabetic</value> + <value>hanging</value> + <value>mathematical</value> + <value>central</value> + <value>middle</value> + <value>text-after-edge</value> + <value>text-before-edge</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="elevation.attr"> + <attribute name="elevation"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="empty-cells.attr"> + <attribute name="empty-cells"> + <choice> + <value>show</value> + <value>hide</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="end-indent.attr"> + <attribute name="end-indent"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="ends-row.attr"> + <attribute name="ends-row"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="extent.attr"> + <attribute name="extent"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="external-destination.attr"> + <attribute name="external-destination"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <!-- + MEMO: We have separated this property into the two (for side and before floats) + MEMO: Float values "inside" and "outside" are RenderX extensions. + --> + <define name="before-float.attr"> + <attribute name="float"> + <value>before</value> + </attribute> + </define> + <define name="side-float.attr"> + <attribute name="float"> + <choice> + <value>start</value> + <value>end</value> + <value>left</value> + <value>right</value> + <value>none</value> + <value>inside</value> + <value>outside</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="flow-name.attr"> + <attribute name="flow-name"/> + </define> + <define name="font.attr"> + <attribute name="font"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-family.attr"> + <attribute name="font-family"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-selection-strategy.attr"> + <attribute name="font-selection-strategy"> + <choice> + <value>auto</value> + <value>character-by-character</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-size.attr"> + <attribute name="font-size"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-size-adjust.attr"> + <attribute name="font-size-adjust"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-stretch.attr"> + <attribute name="font-stretch"> + <choice> + <value>normal</value> + <value>wider</value> + <value>narrower</value> + <value>ultra-condensed</value> + <value>extra-condensed</value> + <value>condensed</value> + <value>semi-condensed</value> + <value>semi-expanded</value> + <value>expanded</value> + <value>extra-expanded</value> + <value>ultra-expanded</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-style.attr"> + <attribute name="font-style"> + <choice> + <value>normal</value> + <value>italic</value> + <value>oblique</value> + <value>backslant</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-variant.attr"> + <attribute name="font-variant"> + <choice> + <value>normal</value> + <value>small-caps</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-weight.attr"> + <attribute name="font-weight"> + <choice> + <value>normal</value> + <value>bold</value> + <value>bolder</value> + <value>lighter</value> + <value>inherit</value> + <value>100</value> + <value>200</value> + <value>300</value> + <value>400</value> + <value>500</value> + <value>600</value> + <value>700</value> + <value>800</value> + <value>900</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="force-page-count.attr"> + <attribute name="force-page-count"> + <choice> + <value>auto</value> + <value>even</value> + <value>odd</value> + <value>end-on-even</value> + <value>end-on-odd</value> + <value>no-force</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="format.attr"> + <attribute name="format"/> + </define> + <define name="glyph-orientation-horizontal.attr"> + <attribute name="glyph-orientation-horizontal"> + <choice> + <ref name="orientation.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="glyph-orientation-vertical.attr"> + <attribute name="glyph-orientation-vertical"> + <choice> + <ref name="orientation.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="grouping-separator.attr"> + <attribute name="grouping-separator"/> + </define> + <define name="grouping-size.attr"> + <attribute name="grouping-size"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="height.attr"> + <attribute name="height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="hyphenate.attr"> + <attribute name="hyphenate"> + <choice> + <value>false</value> + <value>true</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="hyphenation-character.attr"> + <attribute name="hyphenation-character"/> + </define> + <define name="hyphenation-keep.attr"> + <attribute name="hyphenation-keep"> + <choice> + <value>auto</value> + <value>column</value> + <value>page</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="hyphenation-ladder-count.attr"> + <attribute name="hyphenation-ladder-count"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="hyphenation-push-character-count.attr"> + <attribute name="hyphenation-push-character-count"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="hyphenation-remain-character-count.attr"> + <attribute name="hyphenation-remain-character-count"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="id.attr"> + <attribute name="id"/> + </define> + <define name="indicate-destination.attr"> + <attribute name="indicate-destination"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="initial-page-number.attr"> + <attribute name="initial-page-number"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="inline-progression-dimension.attr"> + <attribute name="inline-progression-dimension"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="inline-progression-dimension.maximum.attr"> + <attribute name="inline-progression-dimension.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="inline-progression-dimension.minimum.attr"> + <attribute name="inline-progression-dimension.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="inline-progression-dimension.optimum.attr"> + <attribute name="inline-progression-dimension.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="internal-destination.attr"> + <attribute name="internal-destination"/> + </define> + <define name="intrusion-displace.attr"> + <attribute name="intrusion-displace"> + <choice> + <value>auto</value> + <value>none</value> + <value>line</value> + <value>indent</value> + <value>block</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-together.attr"> + <attribute name="keep-together"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-together.within-column.attr"> + <attribute name="keep-together.within-column"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-together.within-line.attr"> + <attribute name="keep-together.within-line"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-together.within-page.attr"> + <attribute name="keep-together.within-page"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-next.attr"> + <attribute name="keep-with-next"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-next.within-column.attr"> + <attribute name="keep-with-next.within-column"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-next.within-line.attr"> + <attribute name="keep-with-next.within-line"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-next.within-page.attr"> + <attribute name="keep-with-next.within-page"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-previous.attr"> + <attribute name="keep-with-previous"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-previous.within-column.attr"> + <attribute name="keep-with-previous.within-column"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-previous.within-line.attr"> + <attribute name="keep-with-previous.within-line"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-previous.within-page.attr"> + <attribute name="keep-with-previous.within-page"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <!-- RenderX extension attribute --> + <define name="rx-key.attr"> + <attribute name="rx:key"/> + </define> + <define name="language.attr"> + <attribute name="language"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="last-line-end-indent.attr"> + <attribute name="last-line-end-indent"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-alignment.attr"> + <attribute name="leader-alignment"> + <choice> + <value>none</value> + <value>reference-area</value> + <value>page</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-length.attr"> + <attribute name="leader-length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-length.maximum.attr"> + <attribute name="leader-length.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-length.minimum.attr"> + <attribute name="leader-length.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-length.optimum.attr"> + <attribute name="leader-length.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-pattern.attr"> + <attribute name="leader-pattern"> + <choice> + <value>space</value> + <value>rule</value> + <value>dots</value> + <value>use-content</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-pattern-width.attr"> + <attribute name="leader-pattern-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="left.attr"> + <attribute name="left"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.attr"> + <attribute name="letter-spacing"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.conditionality.attr"> + <attribute name="letter-spacing.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.maximum.attr"> + <attribute name="letter-spacing.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.minimum.attr"> + <attribute name="letter-spacing.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.optimum.attr"> + <attribute name="letter-spacing.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.precedence.attr"> + <attribute name="letter-spacing.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-value.attr"> + <attribute name="letter-value"> + <choice> + <value>auto</value> + <value>alphabetic</value> + <value>traditional</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.attr"> + <attribute name="line-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height-shift-adjustment.attr"> + <attribute name="line-height-shift-adjustment"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.conditionality.attr"> + <attribute name="line-height.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.maximum.attr"> + <attribute name="line-height.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.minimum.attr"> + <attribute name="line-height.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.optimum.attr"> + <attribute name="line-height.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.precedence.attr"> + <attribute name="line-height.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-stacking-strategy.attr"> + <attribute name="line-stacking-strategy"> + <choice> + <value>line-height</value> + <value>font-height</value> + <value>max-height</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="linefeed-treatment.attr"> + <attribute name="linefeed-treatment"> + <choice> + <value>ignore</value> + <value>preserve</value> + <value>treat-as-space</value> + <value>treat-as-zero-width-space</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="link-back.attr"> + <attribute name="link-back"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="list-separator.attr"> + <attribute name="list-separator"/> + </define> + <define name="margin.attr"> + <attribute name="margin"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="margin-bottom.attr"> + <attribute name="margin-bottom"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="margin-left.attr"> + <attribute name="margin-left"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="margin-right.attr"> + <attribute name="margin-right"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="margin-top.attr"> + <attribute name="margin-top"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="marker-class-name.attr"> + <attribute name="marker-class-name"/> + </define> + <define name="master-name.attr"> + <attribute name="master-name"/> + </define> + <define name="master-reference.attr"> + <attribute name="master-reference"/> + </define> + <define name="max-height.attr"> + <attribute name="max-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="max-width.attr"> + <attribute name="max-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="maximum-repeats.attr"> + <attribute name="maximum-repeats"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="media-usage.attr"> + <attribute name="media-usage"> + <choice> + <value>auto</value> + <value>paginate</value> + <value>bounded-in-one-dimension</value> + <value>unbounded</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="merge-subsequent-page-numbers.attr"> + <attribute name="merge-subsequent-page-numbers"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="min-height.attr"> + <attribute name="min-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="min-width.attr"> + <attribute name="min-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <!-- NOTE: It's RenderX extension attribute (belongs to rx:meta-field). It enumerates values currently available in XEP --> + <define name="name.attr"> + <attribute name="name"> + <choice> + <value>author</value> + <value>title</value> + <value>subject</value> + <value>keywords</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="number-columns-repeated.attr"> + <attribute name="number-columns-repeated"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="number-columns-spanned.attr"> + <attribute name="number-columns-spanned"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="number-rows-spanned.attr"> + <attribute name="number-rows-spanned"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="odd-or-even.attr"> + <attribute name="odd-or-even"> + <choice> + <value>odd</value> + <value>even</value> + <value>any</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rx-table-omit-initial-header.attr"> + <attribute name="rx:table-omit-initial-header"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="orphans.attr"> + <attribute name="orphans"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="overflow.attr"> + <attribute name="overflow"> + <choice> + <value>visible</value> + <value>hidden</value> + <value>scroll</value> + <value>auto</value> + <value>error-if-overflow</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding.attr"> + <attribute name="padding"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-after.attr"> + <attribute name="padding-after"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-after.conditionality.attr"> + <attribute name="padding-after.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-after.length.attr"> + <attribute name="padding-after.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-before.attr"> + <attribute name="padding-before"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-before.conditionality.attr"> + <attribute name="padding-before.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-before.length.attr"> + <attribute name="padding-before.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-bottom.attr"> + <attribute name="padding-bottom"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-bottom.conditionality.attr"> + <attribute name="padding-bottom.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-bottom.length.attr"> + <attribute name="padding-bottom.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-end.attr"> + <attribute name="padding-end"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-end.conditionality.attr"> + <attribute name="padding-end.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-end.length.attr"> + <attribute name="padding-end.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-left.attr"> + <attribute name="padding-left"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-left.conditionality.attr"> + <attribute name="padding-left.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-left.length.attr"> + <attribute name="padding-left.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-right.attr"> + <attribute name="padding-right"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-right.conditionality.attr"> + <attribute name="padding-right.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-right.length.attr"> + <attribute name="padding-right.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-start.attr"> + <attribute name="padding-start"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-start.conditionality.attr"> + <attribute name="padding-start.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-start.length.attr"> + <attribute name="padding-start.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-top.attr"> + <attribute name="padding-top"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-top.conditionality.attr"> + <attribute name="padding-top.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-top.length.attr"> + <attribute name="padding-top.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-break-after.attr"> + <attribute name="page-break-after"> + <choice> + <value>auto</value> + <value>always</value> + <value>avoid</value> + <value>left</value> + <value>right</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-break-before.attr"> + <attribute name="page-break-before"> + <choice> + <value>auto</value> + <value>always</value> + <value>avoid</value> + <value>left</value> + <value>right</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-break-inside.attr"> + <attribute name="page-break-inside"> + <choice> + <value>avoid</value> + <value>auto</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-height.attr"> + <attribute name="page-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-position.attr"> + <attribute name="page-position"> + <choice> + <value>first</value> + <value>last</value> + <value>rest</value> + <value>any</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-width.attr"> + <attribute name="page-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="pause.attr"> + <attribute name="pause"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="pause-after.attr"> + <attribute name="pause-after"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="pause-before.attr"> + <attribute name="pause-before"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="pitch.attr"> + <attribute name="pitch"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="pitch-range.attr"> + <attribute name="pitch-range"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="play-during.attr"> + <attribute name="play-during"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <!-- MEMO: We forced to devide this shorthand since we have separate absolute-container element --> + <define name="absolute-position-shorthand.attr"> + <attribute name="position"> + <choice> + <value>absolute</value> + <value>fixed</value> + </choice> + </attribute> + </define> + <define name="relative-position-shorthand.attr"> + <attribute name="position"> + <choice> + <value>static</value> + <value>relative</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="precedence.attr"> + <attribute name="precedence"> + <choice> + <value>true</value> + <value>false</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="provisional-distance-between-starts.attr"> + <attribute name="provisional-distance-between-starts"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="provisional-label-separation.attr"> + <attribute name="provisional-label-separation"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="range-separator.attr"> + <attribute name="range-separator"/> + </define> + <define name="ref-id.attr"> + <attribute name="ref-id"/> + </define> + <define name="ref-key.attr"> + <attribute name="ref-key"/> + </define> + <define name="reference-orientation.attr"> + <attribute name="reference-orientation"> + <choice> + <ref name="orientation.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="region-name.attr"> + <attribute name="region-name"/> + </define> + <define name="relative-align.attr"> + <attribute name="relative-align"> + <choice> + <value>before</value> + <value>baseline</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="relative-position.attr"> + <attribute name="relative-position"> + <choice> + <value>auto</value> + <value>static</value> + <value>relative</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rendering-intent.attr"> + <optional> + <attribute name="rendering-intent"> + <choice> + <value>auto</value> + <value>perceptual</value> + <value>relative-colorimetric</value> + <value>saturation</value> + <value>absolute-colorimetric</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </optional> + </define> + <define name="retrieve-boundary.attr"> + <attribute name="retrieve-boundary"> + <choice> + <value>page</value> + <value>page-sequence</value> + <value>document</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="retrieve-class-name.attr"> + <attribute name="retrieve-class-name"/> + </define> + <define name="retrieve-position.attr"> + <attribute name="retrieve-position"> + <choice> + <value>first-starting-within-page</value> + <value>first-including-carryover</value> + <value>last-starting-within-page</value> + <value>last-ending-within-page</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="richness.attr"> + <attribute name="richness"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="right.attr"> + <attribute name="right"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="role.attr"> + <attribute name="role"/> + </define> + <define name="rule-style.attr"> + <attribute name="rule-style"> + <choice> + <value>none</value> + <value>dotted</value> + <value>dashed</value> + <value>solid</value> + <value>double</value> + <value>groove</value> + <value>ridge</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rule-thickness.attr"> + <attribute name="rule-thickness"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="scaling.attr"> + <attribute name="scaling"> + <choice> + <value>uniform</value> + <value>non-uniform</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="scaling-method.attr"> + <attribute name="scaling-method"> + <choice> + <value>auto</value> + <value>integer-pixels</value> + <value>resample-any-method</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="score-spaces.attr"> + <attribute name="score-spaces"> + <choice> + <value>true</value> + <value>false</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="script.attr"> + <attribute name="script"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="show-destination.attr"> + <attribute name="show-destination"> + <choice> + <value>replace</value> + <value>new</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="size.attr"> + <attribute name="size"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="source-document.attr"> + <attribute name="source-document"/> + </define> + <define name="space-after.attr"> + <attribute name="space-after"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-after.conditionality.attr"> + <attribute name="space-after.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-after.maximum.attr"> + <attribute name="space-after.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-after.minimum.attr"> + <attribute name="space-after.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-after.optimum.attr"> + <attribute name="space-after.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-after.precedence.attr"> + <attribute name="space-after.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.attr"> + <attribute name="space-before"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.conditionality.attr"> + <attribute name="space-before.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.maximum.attr"> + <attribute name="space-before.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.minimum.attr"> + <attribute name="space-before.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.optimum.attr"> + <attribute name="space-before.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.precedence.attr"> + <attribute name="space-before.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.attr"> + <attribute name="space-end"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.conditionality.attr"> + <attribute name="space-end.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.maximum.attr"> + <attribute name="space-end.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.minimum.attr"> + <attribute name="space-end.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.optimum.attr"> + <attribute name="space-end.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.precedence.attr"> + <attribute name="space-end.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.attr"> + <attribute name="space-start"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.conditionality.attr"> + <attribute name="space-start.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.maximum.attr"> + <attribute name="space-start.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.minimum.attr"> + <attribute name="space-start.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.optimum.attr"> + <attribute name="space-start.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.precedence.attr"> + <attribute name="space-start.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="span.attr"> + <attribute name="span"> + <choice> + <value>none</value> + <value>all</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="speak.attr"> + <attribute name="speak"> + <choice> + <value>normal</value> + <value>none</value> + <value>spell-out</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="speak-header.attr"> + <attribute name="speak-header"> + <choice> + <value>once</value> + <value>always</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="speak-numeral.attr"> + <attribute name="speak-numeral"> + <choice> + <value>digits</value> + <value>continuous</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="speak-punctuation.attr"> + <attribute name="speak-punctuation"> + <choice> + <value>code</value> + <value>none</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="speech-rate.attr"> + <attribute name="speech-rate"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="src.attr"> + <attribute name="src"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="start-indent.attr"> + <attribute name="start-indent"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="starting-state.attr"> + <attribute name="starting-state"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="starts-row.attr"> + <attribute name="starts-row"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="stress.attr"> + <attribute name="stress"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="suppress-at-line-break.attr"> + <attribute name="suppress-at-line-break"> + <choice> + <value>auto</value> + <value>suppress</value> + <value>retain</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="switch-to.attr"> + <attribute name="switch-to"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="table-layout.attr"> + <attribute name="table-layout"> + <choice> + <value>auto</value> + <value>fixed</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="table-omit-footer-at-break.attr"> + <attribute name="table-omit-footer-at-break"> + <choice> + <value>true</value> + <value>false</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="table-omit-header-at-break.attr"> + <attribute name="table-omit-header-at-break"> + <choice> + <value>true</value> + <value>false</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="target-presentation-context.attr"> + <attribute name="target-presentation-context"/> + </define> + <define name="target-processing-context.attr"> + <attribute name="target-processing-context"/> + </define> + <define name="target-stylesheet.attr"> + <attribute name="target-stylesheet"/> + </define> + <!-- MEMO: <string> values are temporarily excluded from text-align and text-align-last --> + <define name="text-align.attr"> + <attribute name="text-align"> + <choice> + <value>start</value> + <value>center</value> + <value>end</value> + <value>justify</value> + <value>inside</value> + <value>outside</value> + <value>left</value> + <value>right</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-align-last.attr"> + <attribute name="text-align-last"> + <choice> + <value>relative</value> + <value>start</value> + <value>center</value> + <value>end</value> + <value>justify</value> + <value>inside</value> + <value>outside</value> + <value>left</value> + <value>right</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-altitude.attr"> + <attribute name="text-altitude"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-decoration.attr"> + <attribute name="text-decoration"> + <choice> + <data type="NMTOKENS"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-depth.attr"> + <attribute name="text-depth"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-indent.attr"> + <attribute name="text-indent"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-shadow.attr"> + <attribute name="text-shadow"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-transform.attr"> + <attribute name="text-transform"> + <choice> + <value>capitalize</value> + <value>uppercase</value> + <value>lowercase</value> + <value>none</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="top.attr"> + <attribute name="top"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="treat-as-word-space.attr"> + <attribute name="treat-as-word-space"> + <choice> + <value>auto</value> + <value>true</value> + <value>false</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="unicode-bidi.attr"> + <attribute name="unicode-bidi"> + <choice> + <value>normal</value> + <value>embed</value> + <value>bidi-override</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="value.attr"> + <attribute name="value"/> + </define> + <define name="vertical-align.attr"> + <attribute name="vertical-align"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="visibility.attr"> + <attribute name="visibility"> + <choice> + <value>visible</value> + <value>hidden</value> + <value>collapse</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="voice-family.attr"> + <attribute name="voice-family"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="volume.attr"> + <attribute name="volume"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="white-space.attr"> + <attribute name="white-space"> + <choice> + <value>normal</value> + <value>pre</value> + <value>nowrap</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="white-space-collapse.attr"> + <attribute name="white-space-collapse"> + <choice> + <value>false</value> + <value>true</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="white-space-treatment.attr"> + <attribute name="white-space-treatment"> + <choice> + <value>ignore</value> + <value>preserve</value> + <value>ignore-if-before-linefeed</value> + <value>ignore-if-after-linefeed</value> + <value>ignore-if-surrounding-linefeed</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="widows.attr"> + <attribute name="widows"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="width.attr"> + <attribute name="width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.attr"> + <attribute name="word-spacing"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.conditionality.attr"> + <attribute name="word-spacing.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.maximum.attr"> + <attribute name="word-spacing.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.minimum.attr"> + <attribute name="word-spacing.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.optimum.attr"> + <attribute name="word-spacing.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.precedence.attr"> + <attribute name="word-spacing.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="wrap-option.attr"> + <attribute name="wrap-option"> + <choice> + <value>no-wrap</value> + <value>wrap</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="writing-mode.attr"> + <attribute name="writing-mode"> + <choice> + <value>lr-tb</value> + <value>rl-tb</value> + <value>tb-rl</value> + <value>lr</value> + <value>rl</value> + <value>tb</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="z-index.attr"> + <attribute name="z-index"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> +</grammar> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/valid/datatype.rng b/sandbox/paultremblay/python_interface/docutilsToFo/valid/datatype.rng new file mode 100644 index 000000000..86b9f0e57 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/valid/datatype.rng @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ========================================================= + + (c) 2004, RenderX + + Author: Alexander Peshkov <peshkov@renderx.com> + + Permission is granted to use this document, copy and + modify free of charge, provided that every derived work + bear a reference to the present document. + + This document contains a computer program written in + XSL Transformations Language. It is published with no + warranty of any kind about its usability, as a mere + example of XSL technology. RenderX shall not be + considered liable for any damage or loss of data caused + by use of this program. + + ========================================================= +--> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <!-- + *************************************************************** + Common XSL FO datatypes definitions + *************************************************************** + --> + <define name="integer.datatype"> + <data type="integer"/> + </define> + <define name="number.datatype"> + <data type="decimal"/> + </define> + <define name="length.datatype"> + <data type="string"> + <param name="pattern">[\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em)</param> + </data> + </define> + <define name="angle.datatype"> + <data type="string"> + <param name="pattern">[\-+]?(\d*\.?\d+)(deg|grad|rad)</param> + </data> + </define> + <define name="percentage.datatype"> + <data type="string"> + <param name="pattern">[\-+]?(\d*\.?\d+)%</param> + </data> + </define> + <define name="character.datatype"> + <data type="string"> + <param name="pattern">.|\r|\n</param> + </data> + </define> + <define name="string.datatype"> + <data type="string" datatypeLibrary=""/> + </define> + <define name="name.datatype"> + <data type="NCName"/> + </define> + <define name="family-name.datatype"> + <data type="normalizedString"/> + </define> + <!-- MEMO: Should I add some constraints to the family-name.datatype? --> + <define name="color.datatype"> + <data type="token"/> + </define> + <!-- MEMO: Should I add some constraints to the color.datatype? --> + <define name="country.datatype"> + <data type="string"> + <param name="pattern">\w{2,3}</param> + </data> + </define> + <define name="language.datatype"> + <data type="string"> + <param name="pattern">\w{2,3}</param> + </data> + </define> + <define name="script.datatype"> + <data type="string"> + <param name="pattern">\w</param> + </data> + </define> + <!-- MEMO: Should I add detailed constraints to the country/language/script.datatype? --> + <define name="uri-specification.datatype"> + <data type="string"/> + </define> + <!-- MEMO: Should I add some constraints to the uri-specification.datatype? --> + <define name="time.datatype"> + <data type="string"> + <param name="pattern">[\-+]?(\d*\.?\d+)(m?s)</param> + </data> + </define> + <define name="frequency.datatype"> + <data type="string"> + <param name="pattern">[\-+]?(\d*\.?\d+)(k?Hz)</param> + </data> + </define> + <!-- NOTE: <shape> datatype added in XSL FO 1.0 Errata --> + <define name="shape.datatype"> + <data type="normalizedString"> + <param name="pattern">(([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto)</param> + </data> + </define> + <!-- + *************************************************************** + Special datatype - expressions + *************************************************************** + MEMO: simple example of constraint for functions + --> + <define name="expr.datatype"> + <data type="normalizedString"> + <param name="pattern">.*\(.*\).*</param> + </data> + </define> +</grammar> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/valid/docutils.dtd b/sandbox/paultremblay/python_interface/docutilsToFo/valid/docutils.dtd new file mode 100644 index 000000000..571c4228e --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/valid/docutils.dtd @@ -0,0 +1,618 @@ +<!-- +====================================================================== + Docutils Generic DTD +====================================================================== +:Author: David Goodger +:Contact: goodger@python.org +:Revision: $Revision: 4564 $ +:Date: $Date: 2006-05-21 16:44:42 -0400 (Sun, 21 May 2006) $ +:Copyright: This DTD has been placed in the public domain. +:Filename: docutils.dtd + +More information about this DTD (document type definition) and the +Docutils project can be found at http://docutils.sourceforge.net/. +The latest version of this DTD is available from +http://docutils.sourceforge.net/docs/ref/docutils.dtd. + +The formal public identifier for this DTD is:: + + +//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML +--> + +<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Parameter Entities +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Parameter entities are used to simplify the DTD (reduce duplication) +and to allow the DTD to be customized by wrapper DTDs. Parameter +entities beginning with "additional" are meant to allow easy extension +by wrapper DTDs. +--> + +<!-- Attributes +================================================================== --> + +<!-- Boolean: no if zero(s), yes if any other value. --> +<!ENTITY % yesorno "NMTOKEN"> + +<!-- Emphasize that the attribute value must be a number. --> +<!ENTITY % number "NMTOKEN"> + +<!-- A number which may be immediately followed by a unit. --> +<!ENTITY % measure "NMTOKEN"> + +<!ENTITY % additional.basic.atts ""> +<!-- +Attributes shared by all elements in this DTD: + +- `id` is a unique identifier, typically assigned by the system. +- `name` is an identifier assigned in the markup. +- `dupname` is the same as `name`, used when it's a duplicate. +- `source` is the name of the source of this document or fragment. +- `class` is used to transmit individuality information forward. +--> + +<!ENTITY % basic.atts + " ids NMTOKENS #IMPLIED + names CDATA #IMPLIED + dupnames CDATA #IMPLIED + source CDATA #IMPLIED + classes NMTOKENS #IMPLIED + %additional.basic.atts; "> + +<!-- External reference to a URI/URL. --> +<!ENTITY % refuri.att + " refuri CDATA #IMPLIED "> + +<!-- Internal reference to the `id` attribute of an element. --> +<!ENTITY % refid.att + " refid IDREF #IMPLIED "> + +<!-- Space-separated list of id references, for backlinks. --> +<!ENTITY % backrefs.att + " backrefs IDREFS #IMPLIED "> + +<!-- +Internal reference to the `name` attribute of an element. On a +'target' element, 'refname' indicates an indirect target which may +resolve to either an internal or external reference. +--> +<!ENTITY % refname.att + " refname NMTOKENS #IMPLIED "> + +<!ENTITY % additional.reference.atts ""> +<!-- Collected hyperlink reference attributes. --> +<!ENTITY % reference.atts + " %refuri.att; + %refid.att; + %refname.att; + %additional.reference.atts; "> + +<!-- Unnamed hyperlink. --> +<!ENTITY % anonymous.att + " anonymous %yesorno; #IMPLIED "> + +<!-- Auto-numbered footnote or title. --> +<!ENTITY % auto.att + " auto CDATA #IMPLIED "> + +<!-- XML standard attribute for whitespace-preserving elements. --> +<!ENTITY % fixedspace.att + " xml:space (default | preserve) #FIXED 'preserve' "> + +<!ENTITY % align-h.att + " align (left | center | right) #IMPLIED "> + +<!ENTITY % align-hv.att + " align (top | middle | bottom | left | center | right) #IMPLIED "> + + +<!-- Element OR-Lists +============================================================= --> + +<!ENTITY % additional.bibliographic.elements ""> +<!ENTITY % bibliographic.elements + " author | authors | organization | address | contact + | version | revision | status | date | copyright + | field + %additional.bibliographic.elements; "> + +<!ENTITY % additional.section.elements ""> +<!ENTITY % section.elements + " section + %additional.section.elements; "> + +<!ENTITY % additional.body.elements ""> +<!ENTITY % body.elements + " paragraph | compound | container | literal_block | doctest_block + | line_block | block_quote + | table | figure | image | footnote | citation | rubric + | bullet_list | enumerated_list | definition_list | field_list + | option_list + | attention | caution | danger | error | hint | important | note + | tip | warning | admonition + | reference | target | substitution_definition | comment | pending + | system_message | raw + %additional.body.elements; "> + +<!ENTITY % additional.inline.elements ""> +<!ENTITY % inline.elements + " emphasis | strong | literal + | reference | footnote_reference | citation_reference + | substitution_reference | title_reference + | abbreviation | acronym | subscript | superscript + | inline | problematic | generated + | target | image | raw + %additional.inline.elements; "> + + +<!-- Element Content Models +================================================================== --> + +<!-- The structure model may not end with a transition. --> +<!ENTITY % structure.model + " ( ( (%body.elements; | topic | sidebar)+, transition? )*, + ( (%section.elements;), (transition?, (%section.elements;) )* )? )"> + +<!ENTITY % text.model + " (#PCDATA | %inline.elements;)* "> + + +<!-- Table Model +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This DTD uses the Exchange subset of the CALS-table model (OASIS +Technical Memorandum 9901:1999 "XML Exchange Table Model DTD", +http://www.oasis-open.org/html/tm9901.htm). +--> + +<!ENTITY % calstblx PUBLIC + "-//OASIS//DTD XML Exchange Table Model 19990315//EN" + "soextblx.dtd"> + +<!-- These parameter entities customize the table model DTD. --> +<!ENTITY % bodyatt " %basic.atts; "> <!-- table elt --> +<!ENTITY % tbl.tgroup.att " %basic.atts; "> +<!ENTITY % tbl.thead.att " %basic.atts; "> +<!ENTITY % tbl.tbody.att " %basic.atts; "> +<!ENTITY % tbl.colspec.att + " %basic.atts; + stub %yesorno; #IMPLIED "> +<!ENTITY % tbl.row.att " %basic.atts; "> +<!ENTITY % tbl.entry.mdl " (%body.elements;)* "> + +<!ENTITY % tbl.entry.att + " %basic.atts; + morecols %number; #IMPLIED "> + +<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Root Element +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--> + +<!-- Optional elements may be generated by internal processing. --> +<!ELEMENT document + ( (title, subtitle?)?, + decoration?, + (docinfo, transition?)?, + %structure.model; )> +<!ATTLIST document + %basic.atts; + title CDATA #IMPLIED> + +<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Title Elements +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--> + +<!ELEMENT title %text.model;> +<!ATTLIST title + %basic.atts; + %refid.att; + %auto.att;> + +<!ELEMENT subtitle %text.model;> +<!ATTLIST subtitle %basic.atts;> + +<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Bibliographic Elements +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--> + +<!-- Container for bibliographic elements. May not be empty. --> +<!ELEMENT docinfo (%bibliographic.elements;)+> +<!ATTLIST docinfo %basic.atts;> + +<!-- Container for bibliographic elements. May not be empty. +Eventual replacement for docinfo? --> +<!ELEMENT info (%bibliographic.elements;)+> +<!ATTLIST info %basic.atts;> + +<!ELEMENT author %text.model;> +<!ATTLIST author %basic.atts;> + +<!ELEMENT authors (author, organization?, address?, contact?)+> +<!ATTLIST authors %basic.atts;> + +<!ELEMENT organization %text.model;> +<!ATTLIST organization %basic.atts;> + +<!ELEMENT address %text.model;> +<!ATTLIST address + %basic.atts; + %fixedspace.att;> + +<!ELEMENT contact %text.model;> +<!ATTLIST contact %basic.atts;> + +<!ELEMENT version %text.model;> +<!ATTLIST version %basic.atts;> + +<!ELEMENT revision %text.model;> +<!ATTLIST revision %basic.atts;> + +<!ELEMENT status %text.model;> +<!ATTLIST status %basic.atts;> + +<!ELEMENT date %text.model;> + +<!ATTLIST date %basic.atts;> + +<!ELEMENT copyright %text.model;> +<!ATTLIST copyright %basic.atts;> + +<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Decoration Elements +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--> + +<!ELEMENT decoration (header?, footer?)> +<!ATTLIST decoration %basic.atts;> + +<!ELEMENT header (%body.elements;)+> +<!ATTLIST header %basic.atts;> + +<!ELEMENT footer (%body.elements;)+> +<!ATTLIST footer %basic.atts;> + +<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Structural Elements +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--> + +<!ELEMENT section + (title, subtitle?, info?, decoration?, %structure.model;)> +<!ATTLIST section %basic.atts;> + +<!ELEMENT topic (title?, (%body.elements;)+)> +<!ATTLIST topic %basic.atts;> + +<!ELEMENT sidebar (title, subtitle?, (%body.elements; | topic)+)> +<!ATTLIST sidebar %basic.atts;> + +<!ELEMENT transition EMPTY> +<!ATTLIST transition %basic.atts;> + +<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Body Elements +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--> + +<!ELEMENT paragraph %text.model;> +<!ATTLIST paragraph %basic.atts;> + +<!ELEMENT compound (%body.elements;)+> +<!ATTLIST compound %basic.atts;> + +<!ELEMENT container (%body.elements;)+> +<!ATTLIST container %basic.atts;> + +<!ELEMENT bullet_list (list_item+)> +<!ATTLIST bullet_list + %basic.atts; + bullet CDATA #IMPLIED> + +<!ELEMENT enumerated_list (list_item+)> +<!ATTLIST enumerated_list + %basic.atts; + enumtype (arabic | loweralpha | upperalpha + | lowerroman | upperroman) + #IMPLIED + prefix CDATA #IMPLIED + suffix CDATA #IMPLIED + start %number; #IMPLIED> + +<!ELEMENT list_item (%body.elements;)*> +<!ATTLIST list_item %basic.atts;> + +<!ELEMENT definition_list (definition_list_item+)> + +<!ATTLIST definition_list %basic.atts;> + +<!ELEMENT definition_list_item (term, classifier*, definition)> +<!ATTLIST definition_list_item %basic.atts;> + +<!ELEMENT term %text.model;> +<!ATTLIST term %basic.atts;> + +<!ELEMENT classifier %text.model;> +<!ATTLIST classifier %basic.atts;> + +<!ELEMENT definition (%body.elements;)+> +<!ATTLIST definition %basic.atts;> + +<!ELEMENT field_list (field+)> +<!ATTLIST field_list %basic.atts;> + +<!ELEMENT field (field_name, field_body)> +<!ATTLIST field %basic.atts;> + +<!ELEMENT field_name %text.model;> +<!ATTLIST field_name %basic.atts;> + +<!-- May be empty. --> +<!ELEMENT field_body (%body.elements;)*> +<!ATTLIST field_body %basic.atts;> + +<!ELEMENT option_list (option_list_item+)> +<!ATTLIST option_list %basic.atts;> + +<!ELEMENT option_list_item (option_group, description)> +<!ATTLIST option_list_item %basic.atts;> + +<!ELEMENT option_group (option+)> + +<!ATTLIST option_group %basic.atts;> + +<!ELEMENT option (option_string, option_argument*)> +<!ATTLIST option %basic.atts;> + +<!ELEMENT option_string (#PCDATA)> +<!ATTLIST option_string %basic.atts;> + +<!-- +`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 +" "). +--> +<!ELEMENT option_argument (#PCDATA)> +<!ATTLIST option_argument + %basic.atts; + delimiter CDATA #IMPLIED> + +<!ELEMENT description (%body.elements;)+> +<!ATTLIST description %basic.atts;> + +<!ELEMENT literal_block %text.model;> +<!ATTLIST literal_block + %basic.atts; + %fixedspace.att;> + +<!ELEMENT line_block (line | line_block)+> +<!ATTLIST line_block %basic.atts;> + +<!ELEMENT line %text.model;> +<!ATTLIST line %basic.atts;> + +<!ELEMENT block_quote ((%body.elements;)+, attribution?)> +<!ATTLIST block_quote %basic.atts;> + +<!ELEMENT attribution %text.model;> +<!ATTLIST attribution %basic.atts;> + +<!ELEMENT doctest_block %text.model;> +<!ATTLIST doctest_block + %basic.atts; + %fixedspace.att;> + +<!ELEMENT attention (%body.elements;)+> + +<!ATTLIST attention %basic.atts;> + +<!ELEMENT caution (%body.elements;)+> +<!ATTLIST caution %basic.atts;> + +<!ELEMENT danger (%body.elements;)+> +<!ATTLIST danger %basic.atts;> + +<!ELEMENT error (%body.elements;)+> +<!ATTLIST error %basic.atts;> + +<!ELEMENT hint (%body.elements;)+> +<!ATTLIST hint %basic.atts;> + +<!ELEMENT important (%body.elements;)+> +<!ATTLIST important %basic.atts;> + +<!ELEMENT note (%body.elements;)+> +<!ATTLIST note %basic.atts;> + +<!ELEMENT tip (%body.elements;)+> +<!ATTLIST tip %basic.atts;> + +<!ELEMENT warning (%body.elements;)+> +<!ATTLIST warning %basic.atts;> + +<!ELEMENT admonition (title, (%body.elements;)+)> +<!ATTLIST admonition %basic.atts;> + +<!ELEMENT footnote (label?, (%body.elements;)+)> +<!ATTLIST footnote + %basic.atts; + %backrefs.att; + %auto.att;> + +<!ELEMENT citation (label, (%body.elements;)+)> +<!ATTLIST citation + %basic.atts; + %backrefs.att;> + +<!ELEMENT label (#PCDATA)> +<!ATTLIST label %basic.atts;> + +<!ELEMENT rubric %text.model;> +<!ATTLIST rubric %basic.atts;> + +<!-- Empty except when used as an inline element. --> +<!ELEMENT target %text.model;> +<!ATTLIST target + %basic.atts; + %reference.atts; + %anonymous.att;> + +<!ELEMENT substitution_definition %text.model;> +<!ATTLIST substitution_definition + %basic.atts; + ltrim %yesorno; #IMPLIED + rtrim %yesorno; #IMPLIED> + +<!ELEMENT comment (#PCDATA)> +<!ATTLIST comment + %basic.atts; + %fixedspace.att;> + +<!ELEMENT pending EMPTY> +<!ATTLIST pending %basic.atts;> + +<!ELEMENT figure (image, ((caption, legend?) | legend)) > +<!ATTLIST figure + %basic.atts; + %align-h.att; + width %number; #IMPLIED> + +<!-- Also an inline element. --> +<!ELEMENT image EMPTY> +<!ATTLIST image + %basic.atts; + %align-hv.att; + uri CDATA #REQUIRED + alt CDATA #IMPLIED + height %measure; #IMPLIED + width %measure; #IMPLIED + scale %number; #IMPLIED> + +<!ELEMENT caption %text.model;> +<!ATTLIST caption %basic.atts;> + +<!ELEMENT legend (%body.elements;)+> +<!ATTLIST legend %basic.atts;> + +<!-- +Table elements: table, tgroup, colspec, thead, tbody, row, entry. +--> + +%calstblx; + +<!-- Used to record processing information. --> +<!ELEMENT system_message (%body.elements;)+> +<!ATTLIST system_message + %basic.atts; + %backrefs.att; + level %number; #IMPLIED + line %number; #IMPLIED + type NMTOKEN #IMPLIED> + +<!-- Used to pass raw data through the system. Also inline. --> +<!ELEMENT raw %text.model;> +<!ATTLIST raw + %basic.atts; + %fixedspace.att; + format NMTOKENS #IMPLIED> + +<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Inline Elements +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Inline elements occur within the text contents of body elements. Some +nesting of inline elements is allowed by these definitions, with the +following caveats: + +- An inline element may not contain a nested element of the same type + (e.g. <strong> may not contain another <strong>). +- Nested inline elements may or may not be supported by individual + applications using this DTD. +- The inline elements <footnote_reference>, <citation_reference>, + <literal>, and <image> do not support nesting. +--> + +<!ELEMENT emphasis %text.model;> +<!ATTLIST emphasis %basic.atts;> + +<!ELEMENT strong %text.model;> +<!ATTLIST strong %basic.atts;> + +<!ELEMENT literal (#PCDATA)> +<!ATTLIST literal %basic.atts;> + +<!-- Can also be a body element, when it contains an "image" element. --> +<!ELEMENT reference %text.model;> +<!ATTLIST reference + name CDATA #IMPLIED + %basic.atts; + %reference.atts; + %anonymous.att;> + +<!ELEMENT footnote_reference (#PCDATA)> +<!ATTLIST footnote_reference + %basic.atts; + %refid.att; + %refname.att; + %auto.att;> + +<!ELEMENT citation_reference (#PCDATA)> +<!ATTLIST citation_reference + %basic.atts; + %refid.att; + %refname.att;> + +<!ELEMENT substitution_reference %text.model;> +<!ATTLIST substitution_reference + %basic.atts; + %refname.att;> + +<!ELEMENT title_reference %text.model;> + +<!ATTLIST title_reference %basic.atts;> + +<!ELEMENT abbreviation %text.model;> +<!ATTLIST abbreviation %basic.atts;> + +<!ELEMENT acronym %text.model;> +<!ATTLIST acronym %basic.atts;> + +<!ELEMENT superscript %text.model;> +<!ATTLIST superscript %basic.atts;> + +<!ELEMENT subscript %text.model;> +<!ATTLIST subscript %basic.atts;> + +<!ELEMENT inline %text.model;> +<!ATTLIST inline %basic.atts;> + +<!ELEMENT problematic %text.model;> +<!ATTLIST problematic + %basic.atts; + %refid.att;> + +<!ELEMENT generated %text.model;> +<!ATTLIST generated %basic.atts;> + +<!-- +Local Variables: +mode: sgml +indent-tabs-mode: nil +fill-column: 70 +End: +--> + + + diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/valid/docutils.rng b/sandbox/paultremblay/python_interface/docutilsToFo/valid/docutils.rng new file mode 100644 index 000000000..ee67f616a --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/valid/docutils.rng @@ -0,0 +1,1503 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ====================================================================== + Docutils Generic DTD + ====================================================================== + :Author: David Goodger + :Contact: goodger@python.org + :Revision: $Revision: 4564 $ + :Date: $Date: 2006-05-21 16:44:42 -0400 (Sun, 21 May 2006) $ + :Copyright: This DTD has been placed in the public domain. + :Filename: docutils.dtd + + More information about this DTD (document type definition) and the + Docutils project can be found at http://docutils.sourceforge.net/. + The latest version of this DTD is available from + http://docutils.sourceforge.net/docs/ref/docutils.dtd. + + The formal public identifier for this DTD is:: + + +//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML +--> +<!-- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Parameter Entities + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Parameter entities are used to simplify the DTD (reduce duplication) + and to allow the DTD to be customized by wrapper DTDs. Parameter + entities beginning with "additional" are meant to allow easy extension + by wrapper DTDs. +--> +<!-- + Attributes + ================================================================== +--> +<!-- Boolean: no if zero(s), yes if any other value. --> +<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <define name="yesorno"> + <data type="NMTOKEN"/> + </define> + <!-- Emphasize that the attribute value must be a number. --> + <define name="number"> + <data type="NMTOKEN"/> + </define> + <!-- A number which may be immediately followed by a unit. --> + <define name="measure"> + <data type="NMTOKEN"/> + </define> + <define name="additional.basic.atts"> + <empty/> + </define> + <!-- + Attributes shared by all elements in this DTD: + + - `id` is a unique identifier, typically assigned by the system. + - `name` is an identifier assigned in the markup. + - `dupname` is the same as `name`, used when it's a duplicate. + - `source` is the name of the source of this document or fragment. + - `class` is used to transmit individuality information forward. + --> + <define name="basic.atts"> + <optional> + <attribute name="ids"> + <data type="NMTOKENS"/> + </attribute> + </optional> + <optional> + <attribute name="names"/> + </optional> + <optional> + <attribute name="dupnames"/> + </optional> + <optional> + <attribute name="source"/> + </optional> + <optional> + <attribute name="classes"> + <data type="NMTOKENS"/> + </attribute> + </optional> + <ref name="additional.basic.atts"/> + </define> + <!-- External reference to a URI/URL. --> + <define name="refuri.att"> + <optional> + <attribute name="refuri"/> + </optional> + </define> + <!-- Internal reference to the `id` attribute of an element. --> + <define name="refid.att"> + <optional> + <attribute name="refid"> + <!-- + <data type="IDREF"/> + --> + </attribute> + </optional> + </define> + <!-- Space-separated list of id references, for backlinks. --> + <define name="backrefs.att"> + <optional> + <attribute name="backrefs"> + <!-- + <data type="IDREFS"/> + --> + </attribute> + </optional> + </define> + <!-- + Internal reference to the `name` attribute of an element. On a + 'target' element, 'refname' indicates an indirect target which may + resolve to either an internal or external reference. + --> + <define name="refname.att"> + <optional> + <attribute name="refname"> + <data type="NMTOKENS"/> + </attribute> + </optional> + </define> + <define name="additional.reference.atts"> + <empty/> + </define> + <!-- Collected hyperlink reference attributes. --> + <define name="reference.atts"> + <ref name="refuri.att"/> + <ref name="refid.att"/> + <ref name="refname.att"/> + <ref name="additional.reference.atts"/> + </define> + <!-- Unnamed hyperlink. --> + <define name="anonymous.att"> + <optional> + <attribute name="anonymous"> + <ref name="yesorno"/> + </attribute> + </optional> + </define> + <!-- Auto-numbered footnote or title. --> + <define name="auto.att"> + <optional> + <attribute name="auto"/> + </optional> + </define> + <!-- XML standard attribute for whitespace-preserving elements. --> + <define name="fixedspace.att"> + <optional> + <attribute name="xml:space" a:defaultValue="preserve"> + <value>preserve</value> + </attribute> + </optional> + </define> + <define name="align-h.att"> + <optional> + <attribute name="align"> + <choice> + <value>left</value> + <value>center</value> + <value>right</value> + </choice> + </attribute> + </optional> + </define> + <define name="align-hv.att"> + <optional> + <attribute name="align"> + <choice> + <value>top</value> + <value>middle</value> + <value>bottom</value> + <value>left</value> + <value>center</value> + <value>right</value> + </choice> + </attribute> + </optional> + </define> + <!-- + Element OR-Lists + ============================================================= + --> + <define name="additional.bibliographic.elements"> + <notAllowed/> + </define> + <define name="bibliographic.elements"> + <choice> + <ref name="author"/> + <ref name="authors"/> + <ref name="organization"/> + <ref name="address"/> + <ref name="contact"/> + <ref name="version"/> + <ref name="revision"/> + <ref name="status"/> + <ref name="date"/> + <ref name="copyright"/> + <ref name="field"/> + <ref name="additional.bibliographic.elements"/> + </choice> + </define> + <define name="additional.section.elements"> + <notAllowed/> + </define> + <define name="section.elements"> + <choice> + <ref name="section"/> + <ref name="additional.section.elements"/> + </choice> + </define> + <define name="additional.body.elements"> + <notAllowed/> + </define> + <define name="body.elements"> + <choice> + <ref name="paragraph"/> + <ref name="compound"/> + <ref name="container"/> + <ref name="literal_block"/> + <ref name="doctest_block"/> + <ref name="line_block"/> + <ref name="block_quote"/> + <ref name="table"/> + <ref name="figure"/> + <ref name="image"/> + <ref name="footnote"/> + <ref name="citation"/> + <ref name="rubric"/> + <ref name="bullet_list"/> + <ref name="enumerated_list"/> + <ref name="definition_list"/> + <ref name="field_list"/> + <ref name="option_list"/> + <ref name="attention"/> + <ref name="caution"/> + <ref name="danger"/> + <ref name="error"/> + <ref name="hint"/> + <ref name="important"/> + <ref name="note"/> + <ref name="tip"/> + <ref name="warning"/> + <ref name="admonition"/> + <ref name="reference"/> + <ref name="target"/> + <ref name="substitution_definition"/> + <ref name="comment"/> + <ref name="pending"/> + <ref name="system_message"/> + <ref name="raw"/> + <ref name="additional.body.elements"/> + </choice> + </define> + <define name="additional.inline.elements"> + <notAllowed/> + </define> + <define name="inline.elements"> + <choice> + <ref name="emphasis"/> + <ref name="strong"/> + <ref name="literal"/> + <ref name="reference"/> + <ref name="footnote_reference"/> + <ref name="citation_reference"/> + <ref name="substitution_reference"/> + <ref name="title_reference"/> + <ref name="abbreviation"/> + <ref name="acronym"/> + <ref name="subscript"/> + <ref name="superscript"/> + <ref name="inline"/> + <ref name="problematic"/> + <ref name="generated"/> + <ref name="target"/> + <ref name="image"/> + <ref name="raw"/> + <ref name="additional.inline.elements"/> + </choice> + </define> + <!-- + Element Content Models + ================================================================== + --> + <!-- The structure model may not end with a transition. --> + <define name="structure.model"> + <zeroOrMore> + <oneOrMore> + <choice> + <ref name="body.elements"/> + <ref name="topic"/> + <ref name="sidebar"/> + </choice> + </oneOrMore> + <optional> + <ref name="transition"/> + </optional> + </zeroOrMore> + <optional> + <ref name="section.elements"/> + <zeroOrMore> + <optional> + <ref name="transition"/> + </optional> + <ref name="section.elements"/> + </zeroOrMore> + </optional> + </define> + <define name="text.model"> + <zeroOrMore> + <choice> + <text/> + <ref name="inline.elements"/> + </choice> + </zeroOrMore> + </define> + <!-- + Table Model + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This DTD uses the Exchange subset of the CALS-table model (OASIS + Technical Memorandum 9901:1999 "XML Exchange Table Model DTD", + http://www.oasis-open.org/html/tm9901.htm). + --> + <!-- These parameter entities customize the table model DTD. --> + <define name="bodyatt"> + <ref name="basic.atts"/> + </define> + <!-- table elt --> + <define name="tbl.tgroup.att"> + <ref name="basic.atts"/> + </define> + <define name="tbl.thead.att"> + <ref name="basic.atts"/> + </define> + <define name="tbl.tbody.att"> + <ref name="basic.atts"/> + </define> + <define name="tbl.colspec.att"> + <ref name="basic.atts"/> + <optional> + <attribute name="stub"> + <ref name="yesorno"/> + </attribute> + </optional> + </define> + <define name="tbl.row.att"> + <ref name="basic.atts"/> + </define> + <define name="tbl.entry.mdl"> + <zeroOrMore> + <ref name="body.elements"/> + </zeroOrMore> + </define> + <define name="tbl.entry.att"> + <ref name="basic.atts"/> + <optional> + <attribute name="morecols"> + <ref name="number"/> + </attribute> + </optional> + </define> + <!-- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Root Element + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + --> + <!-- Optional elements may be generated by internal processing. --> + <define name="document"> + <element name="document"> + <ref name="document.attlist"/> + <optional> + <ref name="title"/> + <optional> + <ref name="subtitle"/> + </optional> + </optional> + <optional> + <ref name="decoration"/> + </optional> + <optional> + <ref name="docinfo"/> + <optional> + <ref name="transition"/> + </optional> + </optional> + <ref name="structure.model"/> + </element> + </define> + <define name="document.attlist" combine="interleave"> + <ref name="basic.atts"/> + <optional> + <attribute name="title"/> + </optional> + </define> + <!-- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Title Elements + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + --> + <define name="title"> + <element name="title"> + <ref name="title.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="title.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="refid.att"/> + <ref name="auto.att"/> + </define> + <define name="subtitle"> + <element name="subtitle"> + <ref name="subtitle.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="subtitle.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <!-- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Bibliographic Elements + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + --> + <!-- Container for bibliographic elements. May not be empty. --> + <define name="docinfo"> + <element name="docinfo"> + <ref name="docinfo.attlist"/> + <oneOrMore> + <ref name="bibliographic.elements"/> + </oneOrMore> + </element> + </define> + <define name="docinfo.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <!-- + Container for bibliographic elements. May not be empty. + Eventual replacement for docinfo? + --> + <define name="info"> + <element name="info"> + <ref name="info.attlist"/> + <oneOrMore> + <ref name="bibliographic.elements"/> + </oneOrMore> + </element> + </define> + <define name="info.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="author"> + <element name="author"> + <ref name="author.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="author.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="authors"> + <element name="authors"> + <ref name="authors.attlist"/> + <oneOrMore> + <ref name="author"/> + <optional> + <ref name="organization"/> + </optional> + <optional> + <ref name="address"/> + </optional> + <optional> + <ref name="contact"/> + </optional> + </oneOrMore> + </element> + </define> + <define name="authors.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="organization"> + <element name="organization"> + <ref name="organization.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="organization.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="address"> + <element name="address"> + <ref name="address.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="address.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="fixedspace.att"/> + </define> + <define name="contact"> + <element name="contact"> + <ref name="contact.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="contact.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="version"> + <element name="version"> + <ref name="version.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="version.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="revision"> + <element name="revision"> + <ref name="revision.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="revision.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="status"> + <element name="status"> + <ref name="status.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="status.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="date"> + <element name="date"> + <ref name="date.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="date.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="copyright"> + <element name="copyright"> + <ref name="copyright.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="copyright.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <!-- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Decoration Elements + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + --> + <define name="decoration"> + <element name="decoration"> + <ref name="decoration.attlist"/> + <optional> + <ref name="header"/> + </optional> + <optional> + <ref name="footer"/> + </optional> + </element> + </define> + <define name="decoration.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="header"> + <element name="header"> + <ref name="header.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="header.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="footer"> + <element name="footer"> + <ref name="footer.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="footer.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <!-- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Structural Elements + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + --> + <define name="section"> + <element name="section"> + <ref name="section.attlist"/> + <ref name="title"/> + <optional> + <ref name="subtitle"/> + </optional> + <optional> + <ref name="info"/> + </optional> + <optional> + <ref name="decoration"/> + </optional> + <ref name="structure.model"/> + </element> + </define> + <define name="section.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="topic"> + <element name="topic"> + <ref name="topic.attlist"/> + <optional> + <ref name="title"/> + </optional> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="topic.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="sidebar"> + <element name="sidebar"> + <ref name="sidebar.attlist"/> + <ref name="title"/> + <optional> + <ref name="subtitle"/> + </optional> + <oneOrMore> + <choice> + <ref name="body.elements"/> + <ref name="topic"/> + </choice> + </oneOrMore> + </element> + </define> + <define name="sidebar.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="transition"> + <element name="transition"> + <ref name="transition.attlist"/> + <empty/> + </element> + </define> + <define name="transition.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <!-- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Body Elements + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + --> + <define name="paragraph"> + <element name="paragraph"> + <ref name="paragraph.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="paragraph.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="compound"> + <element name="compound"> + <ref name="compound.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="compound.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="container"> + <element name="container"> + <ref name="container.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="container.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="bullet_list"> + <element name="bullet_list"> + <ref name="bullet_list.attlist"/> + <oneOrMore> + <ref name="list_item"/> + </oneOrMore> + </element> + </define> + <define name="bullet_list.attlist" combine="interleave"> + <ref name="basic.atts"/> + <optional> + <attribute name="bullet"/> + </optional> + </define> + <define name="enumerated_list"> + <element name="enumerated_list"> + <ref name="enumerated_list.attlist"/> + <oneOrMore> + <ref name="list_item"/> + </oneOrMore> + </element> + </define> + <define name="enumerated_list.attlist" combine="interleave"> + <ref name="basic.atts"/> + <optional> + <attribute name="enumtype"> + <choice> + <value>arabic</value> + <value>loweralpha</value> + <value>upperalpha</value> + <value>lowerroman</value> + <value>upperroman</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="prefix"/> + </optional> + <optional> + <attribute name="suffix"/> + </optional> + <optional> + <attribute name="start"> + <ref name="number"/> + </attribute> + </optional> + </define> + <define name="list_item"> + <element name="list_item"> + <ref name="list_item.attlist"/> + <zeroOrMore> + <ref name="body.elements"/> + </zeroOrMore> + </element> + </define> + <define name="list_item.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="definition_list"> + <element name="definition_list"> + <ref name="definition_list.attlist"/> + <oneOrMore> + <ref name="definition_list_item"/> + </oneOrMore> + </element> + </define> + <define name="definition_list.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="definition_list_item"> + <element name="definition_list_item"> + <ref name="definition_list_item.attlist"/> + <ref name="term"/> + <zeroOrMore> + <ref name="classifier"/> + </zeroOrMore> + <ref name="definition"/> + </element> + </define> + <define name="definition_list_item.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="term"> + <element name="term"> + <ref name="term.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="term.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="classifier"> + <element name="classifier"> + <ref name="classifier.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="classifier.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="definition"> + <element name="definition"> + <ref name="definition.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="definition.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="field_list"> + <element name="field_list"> + <ref name="field_list.attlist"/> + <oneOrMore> + <ref name="field"/> + </oneOrMore> + </element> + </define> + <define name="field_list.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="field"> + <element name="field"> + <ref name="field.attlist"/> + <ref name="field_name"/> + <ref name="field_body"/> + </element> + </define> + <define name="field.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="field_name"> + <element name="field_name"> + <ref name="field_name.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="field_name.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <!-- May be empty. --> + <define name="field_body"> + <element name="field_body"> + <ref name="field_body.attlist"/> + <zeroOrMore> + <ref name="body.elements"/> + </zeroOrMore> + </element> + </define> + <define name="field_body.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="option_list"> + <element name="option_list"> + <ref name="option_list.attlist"/> + <oneOrMore> + <ref name="option_list_item"/> + </oneOrMore> + </element> + </define> + <define name="option_list.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="option_list_item"> + <element name="option_list_item"> + <ref name="option_list_item.attlist"/> + <ref name="option_group"/> + <ref name="description"/> + </element> + </define> + <define name="option_list_item.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="option_group"> + <element name="option_group"> + <ref name="option_group.attlist"/> + <oneOrMore> + <ref name="option"/> + </oneOrMore> + </element> + </define> + <define name="option_group.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="option"> + <element name="option"> + <ref name="option.attlist"/> + <ref name="option_string"/> + <zeroOrMore> + <ref name="option_argument"/> + </zeroOrMore> + </element> + </define> + <define name="option.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="option_string"> + <element name="option_string"> + <ref name="option_string.attlist"/> + <text/> + </element> + </define> + <define name="option_string.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <!-- + `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 + " "). + --> + <define name="option_argument"> + <element name="option_argument"> + <ref name="option_argument.attlist"/> + <text/> + </element> + </define> + <define name="option_argument.attlist" combine="interleave"> + <ref name="basic.atts"/> + <optional> + <attribute name="delimiter"/> + </optional> + </define> + <define name="description"> + <element name="description"> + <ref name="description.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="description.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="literal_block"> + <element name="literal_block"> + <ref name="literal_block.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="literal_block.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="fixedspace.att"/> + </define> + <define name="line_block"> + <element name="line_block"> + <ref name="line_block.attlist"/> + <oneOrMore> + <choice> + <ref name="line"/> + <ref name="line_block"/> + </choice> + </oneOrMore> + </element> + </define> + <define name="line_block.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="line"> + <element name="line"> + <ref name="line.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="line.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="block_quote"> + <element name="block_quote"> + <ref name="block_quote.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + <optional> + <ref name="attribution"/> + </optional> + </element> + </define> + <define name="block_quote.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="attribution"> + <element name="attribution"> + <ref name="attribution.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="attribution.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="doctest_block"> + <element name="doctest_block"> + <ref name="doctest_block.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="doctest_block.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="fixedspace.att"/> + </define> + <define name="attention"> + <element name="attention"> + <ref name="attention.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="attention.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="caution"> + <element name="caution"> + <ref name="caution.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="caution.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="danger"> + <element name="danger"> + <ref name="danger.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="danger.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="error"> + <element name="error"> + <ref name="error.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="error.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="hint"> + <element name="hint"> + <ref name="hint.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="hint.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="important"> + <element name="important"> + <ref name="important.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="important.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="note"> + <element name="note"> + <ref name="note.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="note.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="tip"> + <element name="tip"> + <ref name="tip.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="tip.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="warning"> + <element name="warning"> + <ref name="warning.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="warning.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="admonition"> + <element name="admonition"> + <ref name="admonition.attlist"/> + <ref name="title"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="admonition.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="footnote"> + <element name="footnote"> + <ref name="footnote.attlist"/> + <optional> + <ref name="label"/> + </optional> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="footnote.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="backrefs.att"/> + <ref name="auto.att"/> + </define> + <define name="citation"> + <element name="citation"> + <ref name="citation.attlist"/> + <ref name="label"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="citation.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="backrefs.att"/> + </define> + <define name="label"> + <element name="label"> + <ref name="label.attlist"/> + <text/> + </element> + </define> + <define name="label.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="rubric"> + <element name="rubric"> + <ref name="rubric.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="rubric.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <!-- Empty except when used as an inline element. --> + <define name="target"> + <element name="target"> + <ref name="target.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="target.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="reference.atts"/> + <ref name="anonymous.att"/> + </define> + <define name="substitution_definition"> + <element name="substitution_definition"> + <ref name="substitution_definition.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="substitution_definition.attlist" combine="interleave"> + <ref name="basic.atts"/> + <optional> + <attribute name="ltrim"> + <ref name="yesorno"/> + </attribute> + </optional> + <optional> + <attribute name="rtrim"> + <ref name="yesorno"/> + </attribute> + </optional> + </define> + <define name="comment"> + <element name="comment"> + <ref name="comment.attlist"/> + <text/> + </element> + </define> + <define name="comment.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="fixedspace.att"/> + </define> + <define name="pending"> + <element name="pending"> + <ref name="pending.attlist"/> + <empty/> + </element> + </define> + <define name="pending.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="figure"> + <element name="figure"> + <ref name="figure.attlist"/> + <ref name="image"/> + <choice> + <group> + <ref name="caption"/> + <optional> + <ref name="legend"/> + </optional> + </group> + <ref name="legend"/> + </choice> + </element> + </define> + <define name="figure.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="align-h.att"/> + <optional> + <attribute name="width"> + <!-- + number or percent + <ref name="number"/> + --> + </attribute> + </optional> + </define> + <!-- Also an inline element. --> + <define name="image"> + <element name="image"> + <ref name="image.attlist"/> + <empty/> + </element> + </define> + <define name="image.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="align-hv.att"/> + <attribute name="uri"/> + <optional> + <attribute name="alt"/> + </optional> + <optional> + <attribute name="height"> + <ref name="measure"/> + </attribute> + </optional> + <optional> + <attribute name="width"> + <ref name="measure"/> + </attribute> + </optional> + <optional> + <attribute name="scale"> + <ref name="number"/> + </attribute> + </optional> + </define> + <define name="caption"> + <element name="caption"> + <ref name="caption.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="caption.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="legend"> + <element name="legend"> + <ref name="legend.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="legend.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <!-- Table elements: table, tgroup, colspec, thead, tbody, row, entry. --> + <include href="soextblx.rng"/> + <!-- Used to record processing information. --> + <define name="system_message"> + <element name="system_message"> + <ref name="system_message.attlist"/> + <oneOrMore> + <ref name="body.elements"/> + </oneOrMore> + </element> + </define> + <define name="system_message.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="backrefs.att"/> + <optional> + <attribute name="level"> + <ref name="number"/> + </attribute> + </optional> + <optional> + <attribute name="line"> + <ref name="number"/> + </attribute> + </optional> + <optional> + <attribute name="type"> + <data type="NMTOKEN"/> + </attribute> + </optional> + </define> + <!-- Used to pass raw data through the system. Also inline. --> + <define name="raw"> + <element name="raw"> + <ref name="raw.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="raw.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="fixedspace.att"/> + <optional> + <attribute name="format"> + <data type="NMTOKENS"/> + </attribute> + </optional> + </define> + <!-- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Inline Elements + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Inline elements occur within the text contents of body elements. Some + nesting of inline elements is allowed by these definitions, with the + following caveats: + + - An inline element may not contain a nested element of the same type + (e.g. <strong> may not contain another <strong>). + - Nested inline elements may or may not be supported by individual + applications using this DTD. + - The inline elements <footnote_reference>, <citation_reference>, + <literal>, and <image> do not support nesting. + --> + <define name="emphasis"> + <element name="emphasis"> + <ref name="emphasis.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="emphasis.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="strong"> + <element name="strong"> + <ref name="strong.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="strong.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="literal"> + <element name="literal"> + <ref name="literal.attlist"/> + <text/> + </element> + </define> + <define name="literal.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <!-- Can also be a body element, when it contains an "image" element. --> + <define name="reference"> + <element name="reference"> + <ref name="reference.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="reference.attlist" combine="interleave"> + <optional> + <attribute name="name"/> + </optional> + <ref name="basic.atts"/> + <ref name="reference.atts"/> + <ref name="anonymous.att"/> + </define> + <define name="footnote_reference"> + <element name="footnote_reference"> + <ref name="footnote_reference.attlist"/> + <text/> + </element> + </define> + <define name="footnote_reference.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="refid.att"/> + <ref name="refname.att"/> + <ref name="auto.att"/> + </define> + <define name="citation_reference"> + <element name="citation_reference"> + <ref name="citation_reference.attlist"/> + <text/> + </element> + </define> + <define name="citation_reference.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="refid.att"/> + <ref name="refname.att"/> + </define> + <define name="substitution_reference"> + <element name="substitution_reference"> + <ref name="substitution_reference.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="substitution_reference.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="refname.att"/> + </define> + <define name="title_reference"> + <element name="title_reference"> + <ref name="title_reference.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="title_reference.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="abbreviation"> + <element name="abbreviation"> + <ref name="abbreviation.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="abbreviation.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="acronym"> + <element name="acronym"> + <ref name="acronym.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="acronym.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="superscript"> + <element name="superscript"> + <ref name="superscript.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="superscript.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="subscript"> + <element name="subscript"> + <ref name="subscript.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="subscript.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="inline"> + <element name="inline"> + <ref name="inline.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="inline.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <define name="problematic"> + <element name="problematic"> + <ref name="problematic.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="problematic.attlist" combine="interleave"> + <ref name="basic.atts"/> + <ref name="refid.att"/> + </define> + <define name="generated"> + <element name="generated"> + <ref name="generated.attlist"/> + <ref name="text.model"/> + </element> + </define> + <define name="generated.attlist" combine="interleave"> + <ref name="basic.atts"/> + </define> + <start> + <choice> + <ref name="document"/> + </choice> + </start> +</grammar> +<!-- + Local Variables: + mode: sgml + indent-tabs-mode: nil + fill-column: 70 + End: +--> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/valid/elements.rng b/sandbox/paultremblay/python_interface/docutilsToFo/valid/elements.rng new file mode 100644 index 000000000..ebe0cb87e --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/valid/elements.rng @@ -0,0 +1,1143 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ========================================================= + + (c) 2004, RenderX + + Author: Alexander Peshkov <peshkov@renderx.com> + + Permission is granted to use this document, copy and + modify free of charge, provided that every derived work + bear a reference to the present document. + + This document contains a computer program written in + XSL Transformations Language. It is published with no + warranty of any kind about its usability, as a mere + example of XSL technology. RenderX shall not be + considered liable for any damage or loss of data caused + by use of this program. + + ========================================================= +--> +<grammar xmlns:rx="http://www.renderx.com/XSL/Extensions" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns="http://relaxng.org/ns/structure/1.0"> + <include href="properties.rng"/> + <!-- + **************************************************************************************** + Common content models used by content-bearing elements + **************************************************************************************** + --> + <define name="very-basic-inlines"> + <choice> + <ref name="character"/> + <ref name="external-graphic"/> + <ref name="instream-foreign-object"/> + <ref name="inline-container"/> + <ref name="leader"/> + <ref name="page-number"/> + <ref name="page-number-citation"/> + <ref name="multi-toggle"/> + <!-- MEMO: To be strict, we have to control that this element is a descendant of an fo:multi-case. --> + <ref name="page-index"/> + <ref name="begin-index-range"/> + <ref name="end-index-range"/> + </choice> + </define> + <!-- NOTE: An absolute-container can be treated both as block and as outline. --> + <define name="basic-blocks"> + <choice> + <ref name="block"/> + <ref name="block-container"/> + <ref name="table-and-caption"/> + <ref name="table"/> + <ref name="list-block"/> + </choice> + </define> + <!-- NOTE: Unlike other out-of-lines fo:footnote can be used only in the context where inlines are permitted --> + <define name="out-of-lines-block"> + <choice> + <ref name="before-float"/> + <ref name="side-float"/> + <ref name="absolute-container"/> + </choice> + </define> + <define name="out-of-lines"> + <choice> + <ref name="footnote"/> + <ref name="out-of-lines-block"/> + </choice> + </define> + <!-- + As a compromise for intricated inline content model prescribed by XSL FO spec + we define two types of inline content: + first as restrictive as required by spec for descendants of an fo:leader or of an fo:inline + child of an fo:footnote (and for some other cases where we believe it is reasonable), + it permits inline level elements only, except for descendants of fo:inline-container; + second as loose as prescribed by spec for the general cases + --> + <define name="basic-inlines-inline"> + <choice> + <ref name="very-basic-inlines"/> + <ref name="basic-link-inline"/> + <ref name="inline-inline"/> + <ref name="bidi-override-inline"/> + </choice> + </define> + <define name="basic-inlines"> + <choice> + <ref name="very-basic-inlines"/> + <ref name="basic-link"/> + <ref name="inline"/> + <ref name="bidi-override"/> + </choice> + </define> + <!-- + We have three content models for wrappers: + first one allows inline content only (based on basic-inlines-inline described above); + second one requires block-level elements to be at the top of it; + third one is for mixed content (general case); + --> + <define name="wrappers-inline"> + <choice> + <ref name="multi-switch-inline"/> + <ref name="multi-properties-inline"/> + <ref name="wrapper-inline"/> + <ref name="retrieve-marker"/> + </choice> + </define> + <define name="wrappers-block"> + <choice> + <ref name="multi-switch-block"/> + <ref name="multi-properties-block"/> + <ref name="wrapper-block"/> + <ref name="retrieve-marker"/> + </choice> + </define> + <define name="wrappers"> + <choice> + <ref name="multi-switch"/> + <ref name="multi-properties"/> + <ref name="wrapper"/> + <ref name="retrieve-marker"/> + </choice> + </define> + <!-- + We have two extended content models for inlines: + first one is stricter, with inline elements only (exception for fo:inline-container descendants) + and with no outlines (actually they are bared in main.rnc anyway); + second one is loose, with all possible inlines and outlines. + In general those content models corresponds very well with two possible contexts: + block context and inline context + --> + <define name="inlines-inline"> + <choice> + <text/> + <ref name="basic-inlines-inline"/> + <ref name="wrappers-inline"/> + </choice> + </define> + <define name="inlines"> + <choice> + <text/> + <ref name="basic-inlines"/> + <ref name="out-of-lines"/> + <ref name="wrappers"/> + </choice> + </define> + <!-- Content model for blocks including block-level outlines --> + <define name="blocks"> + <choice> + <ref name="basic-blocks"/> + <ref name="wrappers-block"/> + <ref name="out-of-lines-block"/> + </choice> + </define> + <!-- Mixed content model - broadest one --> + <define name="mix"> + <choice> + <ref name="inlines"/> + <ref name="basic-blocks"/> + </choice> + </define> + <!-- + **************************************************************************************** + Element structure for content-bearing elements + **************************************************************************************** + =============================================================== + Block is the base element for all content areas. + =============================================================== + --> + <define name="block"> + <element name="fo:block"> + <ref name="block.attlist"/> + <ref name="block.content"/> + </element> + </define> + <define name="block.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <choice> + <ref name="initial-property-set"/> + <ref name="mix"/> + </choice> + </zeroOrMore> + </define> + <!-- + =============================================================== + Block container + =============================================================== + MEMO: We are forced to create separate element 'absolute-container' in order + to satisfy XSL FO spec requirements. Note that this is the *only* place where + properties really interfer with element-level structure (well, actually fo:float is the second place). + A separate fo:absolute-container is clearly necessary. + Absolutely possitioned block-container cannot contain markers and and outlines. + It's behaviour is quite similar to the outline elements such as float. + 'Folint' do not control absolutely positioned container restriction + (due to expressions that can result in absolute position) + 'Folint' also permits empty block-containers, that is against the spec. + Spec defines fo:block-container content as (%block;)+ + --> + <define name="absolute-container"> + <notAllowed/> + </define> + <define name="absolute-container-real"> + <element name="fo:block-container"> + <ref name="absolute-container.attlist"/> + <ref name="absolute-container.content"/> + </element> + </define> + <define name="absolute-container.content"> + <oneOrMore> + <ref name="blocks"/> + </oneOrMore> + </define> + <define name="block-container"> + <element name="fo:block-container"> + <ref name="block-container.attlist"/> + <ref name="block-container.content"/> + </element> + </define> + <define name="block-container.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <oneOrMore> + <ref name="blocks"/> + </oneOrMore> + </define> + <!-- + **************************************************************************************** + Inline elements + **************************************************************************************** + =============================================================== + Unicode bidi-override + =============================================================== + MEMO: According to spec this element CAN have block level children except for the cases listed below: + XSL> An fo:bidi-override that is a descendant of an fo:leader or of an fo:inline child + XSL> of an fo:footnote may not have block-level children, unless it has a nearer ancestor + XSL> that is an fo:inline-container. + NOTE: This is contradictory to the description of fo:leader element (6.6.9. fo:leader) that + prohibits (some) block-level elements/outlines to be fo:leader descendants + no matter if they wrapped in any fo:inline-containers and fo:bidi-override. + We have two models: + first (restrictive) used by descendants of an fo:title, fo:leader or of an fo:inline child of an fo:footnote; + second (loose) as prescribed by spec for the general cases + 'Folint' believes that no block level elements should be allowed in this element in either way. + --> + <define name="bidi-override-inline"> + <element name="fo:bidi-override"> + <ref name="bidi-override.attlist"/> + <ref name="bidi-override-inline.content"/> + </element> + </define> + <define name="bidi-override-inline.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <ref name="inlines-inline"/> + </zeroOrMore> + </define> + <define name="bidi-override"> + <element name="fo:bidi-override"> + <ref name="bidi-override.attlist"/> + <ref name="bidi-override.content"/> + </element> + </define> + <define name="bidi-override.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <ref name="mix"/> + </zeroOrMore> + </define> + <!-- + =============================================================== + Single character + =============================================================== + --> + <define name="character"> + <element name="fo:character"> + <ref name="character.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + Initial property set specifies properties for one or more lines + =============================================================== + --> + <define name="initial-property-set"> + <element name="fo:initial-property-set"> + <ref name="initial-property-set.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + External graphic + =============================================================== + --> + <define name="external-graphic"> + <element name="fo:external-graphic"> + <ref name="external-graphic.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + In-stream graphic + =============================================================== + --> + <define name="instream-foreign-object"> + <element name="fo:instream-foreign-object"> + <ref name="instream-foreign-object.attlist"/> + <ref name="any"/> + </element> + </define> + <!-- + =============================================================== + Inline + =============================================================== + MEMO: This element used by content model that consists of inlines only + with exception for descendants of inline-container + --> + <define name="inline-inline"> + <element name="fo:inline"> + <ref name="inline.attlist"/> + <ref name="inline-inline.content"/> + </element> + </define> + <define name="inline-inline.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <ref name="inlines-inline"/> + </zeroOrMore> + </define> + <define name="inline"> + <element name="fo:inline"> + <ref name="inline.attlist"/> + <ref name="inline.content"/> + </element> + </define> + <define name="inline.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <ref name="mix"/> + </zeroOrMore> + </define> + <!-- + XSL> An fo:inline that is a child of an fo:footnote may not have block-level children. + XSL> An fo:inline that is a descendant of an fo:leader or of the fo:inline child of + XSL> an fo:footnote may not have block-level children, unless it has a nearer + XSL> ancestor that is an fo:inline-container. + NOTE: This definition is contradictory to the one of the fo:leader since latter prohibits + fo:inline-container as a descendant. But it's the definition of fo:leader that should be fixed + since content model described above is the only sane content model in the inline context. + It should be the same for fo:bidi-override. However definition must be adjasted + in order to mention fo:title since this element is a typical inline. + + 'Folint' believes that block elements are allowed here and thoroughly tests for + all those tricky exceptions. This behavior seems to be quite inconsisten with the + one regarding fo:bidi-override treatment. + --> + <!-- + =============================================================== + Inline container + =============================================================== + --> + <define name="inline-container"> + <element name="fo:inline-container"> + <ref name="inline-container.attlist"/> + <ref name="inline-container.content"/> + </element> + </define> + <define name="inline-container.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <ref name="blocks"/> + </zeroOrMore> + </define> + <!-- + =============================================================== + Leader + =============================================================== + --> + <define name="leader"> + <element name="fo:leader"> + <ref name="leader.attlist"/> + <ref name="leader.content"/> + </element> + </define> + <define name="leader.content"> + <zeroOrMore> + <ref name="inlines-inline"/> + </zeroOrMore> + </define> + <!-- + MEMO: Following two lines used together with tricky redefinition in main.rnc + in order to prevent fo:leader nesting. + leader.content = notAllowed + leader.content-real = inlines-inline* + --> + <!-- + MEMO: We use inline content model here which is consistent with + such elements as fo:inline child of fo:footnote. It allows blocks/outlines, but only as a + descendant of inline-container. XSL FO spec is quite uneven at this point (and should be fixed). + According to spec, this element can contain inline level elements and text, but + XSL> The content must not contain an fo:leader, fo:inline-container, fo:block-container, + XSL> fo:float, fo:footnote, or fo:marker either as a direct child or as a descendant. + NOTE: XSL FO spec DO NOT prohibit blocks or tables as descendants of fo:leader! + NOTE: fo:leader constraints are contradictory to those of fo:inline since section "6.6.7. fo:inline" + states implicitly that there could be an fo:inline-container that is a descendent of fo:leader. + + 'Folint' respects these constraints partially: it prohibits fo:block-container as a descendant, + but permits fo:marker, fo:leader, fo:inline-container, fo:float, fo:footnote. + It also prohibits use of fo:block as descendant. + --> + <!-- + =============================================================== + Page Number + =============================================================== + --> + <define name="page-number"> + <element name="fo:page-number"> + <ref name="page-number.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + Page number citation + =============================================================== + --> + <define name="page-number-citation"> + <element name="fo:page-number-citation"> + <ref name="page-number-citation.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + Atomic elements for index ranges markup + =============================================================== + --> + <define name="begin-index-range"> + <element name="rx:begin-index-range"> + <ref name="begin-index-range.attlist"/> + <empty/> + </element> + </define> + <define name="end-index-range"> + <element name="rx:end-index-range"> + <ref name="end-index-range.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + Page number list - index entry + =============================================================== + --> + <define name="page-index"> + <element name="rx:page-index"> + <ref name="page-index.attlist"/> + <ref name="page-index.content"/> + </element> + </define> + <!-- + MEMO: Currently page-index must contain at least one rx:index-item element, + empty content is allowed for backward compatibility. + --> + <define name="page-index.content"> + <zeroOrMore> + <ref name="index-item"/> + </zeroOrMore> + </define> + <define name="index-item"> + <element name="rx:index-item"> + <ref name="index-item.attlist"/> + <empty/> + </element> + </define> + <!-- + **************************************************************************************** + Formatting objects for tables. + **************************************************************************************** + --> + <!-- + =============================================================== + Table & Caption is a wrapper to all the stuff pertinent to a + given table. It generates a block consisting of two subblocks: + one for the caption, another one for the table itself. The + placement of these two blocks is controlled by the + 'caption-side' property: if caption-side="before"|"after" (or + their absolute orientation equivalents), the two blocks are + drawn one after another; if it is "start"|"end", then the + caption is displayed on the correspondent side of the table. + In this case, the relative alignment of the two blocks is given + by the 'relative-align'/'display-align' property. + + =============================================================== + --> + <define name="table-and-caption"> + <element name="fo:table-and-caption"> + <ref name="table-and-caption.attlist"/> + <ref name="table-and-caption.content"/> + </element> + </define> + <define name="table-and-caption.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <optional> + <ref name="table-caption"/> + </optional> + <ref name="table"/> + </define> + <!-- + =============================================================== + Table caption is an area container. + =============================================================== + --> + <define name="table-caption"> + <element name="fo:table-caption"> + <ref name="table-caption.attlist"/> + <ref name="table-caption.content"/> + </element> + </define> + <define name="table-caption.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <oneOrMore> + <ref name="blocks"/> + </oneOrMore> + </define> + <!-- + =============================================================== + fo:table is the basic element for all tables. All the contents + placed inside it is distributed over a single rectangular grid + of rows and columns. + =============================================================== + --> + <define name="table"> + <element name="fo:table"> + <ref name="table.attlist"/> + <ref name="table.content"/> + </element> + </define> + <define name="table.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <ref name="table-column"/> + </zeroOrMore> + <optional> + <ref name="table-header"/> + </optional> + <optional> + <ref name="table-footer"/> + </optional> + <oneOrMore> + <ref name="table-body"/> + </oneOrMore> + </define> + <!-- + =============================================================== + Table column specifies common properties to ascribe to all + cells in a column *or a group of columns*. Note that, if both + 'number-columns-repeated' and 'number-columns-spanned' exceed + 1, the column counter is increased by 'number-columns-spanned'. + it means that you only set properties for columns: + 'column-number' + 'column-number' + 'number-columns-spanned' + 'column-number' + 2 * 'number-columns-spanned' + and so on, leaving default properties for intermediate columns. + =============================================================== + --> + <define name="table-column"> + <element name="fo:table-column"> + <ref name="table-column.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + Table header, table footer, and table body are wrappers for + groups of rows. They contain either one or more fo:table-rows, + or one or more fo:table-cells; in the latter case, row breaks + are specified in the cells by 'starts-row'/'ends-row'. + All these elements are identical both in the content structure + and in the attributes. + =============================================================== + --> + <define name="row-group"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <choice> + <oneOrMore> + <ref name="table-row"/> + </oneOrMore> + <oneOrMore> + <ref name="table-cell"/> + </oneOrMore> + </choice> + </define> + <define name="table-header"> + <element name="fo:table-header"> + <ref name="table-header.attlist"/> + <ref name="table-header.content"/> + </element> + </define> + <define name="table-header.content"> + <ref name="row-group"/> + </define> + <define name="table-footer"> + <element name="fo:table-footer"> + <ref name="table-footer.attlist"/> + <ref name="table-footer.content"/> + </element> + </define> + <define name="table-footer.content"> + <ref name="row-group"/> + </define> + <define name="table-body"> + <element name="fo:table-body"> + <ref name="table-body.attlist"/> + <ref name="table-body.content"/> + </element> + </define> + <define name="table-body.content"> + <ref name="row-group"/> + </define> + <!-- + =============================================================== + Table row. + =============================================================== + --> + <define name="table-row"> + <element name="fo:table-row"> + <ref name="table-row.attlist"/> + <ref name="table-row.content"/> + </element> + </define> + <define name="table-row.content"> + <oneOrMore> + <ref name="table-cell"/> + </oneOrMore> + </define> + <!-- + MEMO: We are more strict here, so this note is about 'Folint': + 'Folint' permits empty fo:table-row, that is against the spec. + XSL FO spec defines fo:table-row content as (table-cell+) + --> + <!-- + =============================================================== + Table cell. + =============================================================== + --> + <define name="table-cell"> + <element name="fo:table-cell"> + <ref name="table-cell.attlist"/> + <ref name="table-cell.content"/> + </element> + </define> + <define name="table-cell.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <oneOrMore> + <ref name="blocks"/> + </oneOrMore> + </define> + <!-- + MEMO: We are more strict here, so this note is about 'Folint': + 'Folint' permits empty table-cells that is against the spec. Spec defines fo:table-cell + content as (%block;)+ + Note that 'Folint' is quite consistent regarding this matter - it simillary allows empty + block-containers and table-rows + --> + <!-- + **************************************************************************************** + Formatting objects for lists. + **************************************************************************************** + =============================================================== + List block is a block, with some extra features to control the + disposition of list items. + =============================================================== + --> + <define name="list-block"> + <element name="fo:list-block"> + <ref name="list-block.attlist"/> + <ref name="list-block.content"/> + </element> + </define> + <define name="list-block.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <oneOrMore> + <ref name="list-item"/> + </oneOrMore> + </define> + <!-- + =============================================================== + List item is a coupling of item label and item body. + =============================================================== + --> + <define name="list-item"> + <element name="fo:list-item"> + <ref name="list-item.attlist"/> + <ref name="list-item.content"/> + </element> + </define> + <define name="list-item.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <ref name="list-item-label"/> + <ref name="list-item-body"/> + </define> + <!-- + =============================================================== + List item label and list item body + =============================================================== + --> + <define name="list-item-label"> + <element name="fo:list-item-label"> + <ref name="list-item-label.attlist"/> + <ref name="list-item-label.content"/> + </element> + </define> + <define name="list-item-label.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <oneOrMore> + <ref name="blocks"/> + </oneOrMore> + </define> + <define name="list-item-body"> + <element name="fo:list-item-body"> + <ref name="list-item-body.attlist"/> + <ref name="list-item-body.content"/> + </element> + </define> + <define name="list-item-body.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <oneOrMore> + <ref name="blocks"/> + </oneOrMore> + </define> + <!-- + MEMO: We are more strict here, so this note is about 'Folint': + 'Folint' permits empty fo:list-item-label/body, that is clearly the spec. + Spec defines fo:list-item-label/body content as (%block;)+ + --> + <!-- + **************************************************************************************** + Out-of-lines. + **************************************************************************************** + =============================================================== + Floats and footnotes resemble containers. Accordingly, we treat + them as block sequences. + =============================================================== + MEMO: We do not allows absolutely positioned container as an outline descendant. + 'Folint' is loose here - it do not check this condition. + MEMO: We are forced to create two types of floats: side-floats and before-floats + because they have different restrictions (side-floats can appear in static content, + before-floats can't bear 'clear' property) + NOTE: 'Folint' does not allows any floats inside absolutely positioned containers too. + --> + <define name="side-float"> + <notAllowed/> + </define> + <define name="side-float-real"> + <element name="fo:float"> + <ref name="side-float.attlist"/> + <ref name="float.content"/> + </element> + </define> + <define name="before-float"> + <notAllowed/> + </define> + <define name="before-float-real"> + <element name="fo:float"> + <ref name="before-float.attlist"/> + <ref name="float.content"/> + </element> + </define> + <define name="float.content"> + <oneOrMore> + <ref name="blocks"/> + </oneOrMore> + </define> + <!-- + XSL> It is an error if the fo:footnote occurs as a descendant of a flow that is not assigned + XSL> to a region-body, or of an fo:block-container that generates absolutely positioned areas. + --> + <define name="footnote"> + <notAllowed/> + </define> + <define name="footnote-real"> + <element name="fo:footnote"> + <ref name="footnote.attlist"/> + <ref name="footnote.content"/> + </element> + </define> + <!-- + XSL> An fo:inline that is a child of an fo:footnote may not have block-level children. + XSL> An fo:inline that is a descendant of an fo:leader or of the fo:inline child of + XSL> an fo:footnote may not have block-level children, unless it has a nearer + XSL> ancestor that is an fo:inline-container. + We do check here that first inline have no block-level children/descendants unlless + they are wrapped into an inline-container. + 'Folint' does the same. + --> + <define name="footnote.content"> + <ref name="inline-inline"/> + <ref name="footnote-body"/> + </define> + <define name="footnote-body"> + <element name="fo:footnote-body"> + <ref name="footnote-body.attlist"/> + <ref name="footnote-body.content"/> + </element> + </define> + <define name="footnote-body.content"> + <oneOrMore> + <ref name="blocks"/> + </oneOrMore> + </define> + <!-- + =============================================================== + Simple link. From the formatting point of view, it's nothing + but a regular inline sequence. + =============================================================== + This elment is for separate 'inline' content model + --> + <define name="basic-link-inline"> + <element name="fo:basic-link"> + <ref name="basic-link.attlist"/> + <ref name="basic-link-inline.content"/> + </element> + </define> + <define name="basic-link-inline.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <ref name="inlines-inline"/> + </zeroOrMore> + </define> + <define name="basic-link"> + <element name="fo:basic-link"> + <ref name="basic-link.attlist"/> + <ref name="basic-link.content"/> + </element> + </define> + <define name="basic-link.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <ref name="mix"/> + </zeroOrMore> + </define> + <!-- + **************************************************************************************** + Wrappers and Markers. + **************************************************************************************** + =============================================================== + Wrapper. This may be useful but it seriously complicates validation of + content models for blocks and inlines. + =============================================================== + There are 3 different kind of wrappers for different contexts + --> + <define name="wrapper-inline"> + <element name="fo:wrapper"> + <ref name="wrapper.attlist"/> + <ref name="wrapper-inline.content"/> + </element> + </define> + <define name="wrapper-inline.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <ref name="inlines-inline"/> + </zeroOrMore> + </define> + <define name="wrapper-block"> + <element name="fo:wrapper"> + <ref name="wrapper.attlist"/> + <ref name="wrapper-block.content"/> + </element> + </define> + <define name="wrapper-block.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <ref name="blocks"/> + </zeroOrMore> + </define> + <define name="wrapper"> + <element name="fo:wrapper"> + <ref name="wrapper.attlist"/> + <ref name="wrapper.content"/> + </element> + </define> + <define name="wrapper.content"> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <zeroOrMore> + <ref name="mix"/> + </zeroOrMore> + </define> + <!-- + =============================================================== + Marker. + =============================================================== + --> + <define name="marker"> + <notAllowed/> + </define> + <define name="marker-real"> + <element name="fo:marker"> + <ref name="marker.attlist"/> + <ref name="marker.content"/> + </element> + </define> + <define name="marker.content"> + <zeroOrMore> + <ref name="mix"/> + </zeroOrMore> + </define> + <!-- + =============================================================== + Marker retrieval. + We are more strict here making retrieve-class-name attribute a mandatory, + but marker with no retrieve-class-name is meaningless. + =============================================================== + --> + <define name="retrieve-marker"> + <notAllowed/> + </define> + <define name="retrieve-marker-real"> + <element name="fo:retrieve-marker"> + <ref name="retrieve-marker.attlist"/> + <empty/> + </element> + </define> + <!-- + **************************************************************************************** + Multistate stuff. + All those elements are practically unused and XSL content model invloved is + intricated. Therefor validation is not absolutely strict here. + **************************************************************************************** + =============================================================== + Switch. This is a pure logical operator; no formatting may be + conveyed through it. + =============================================================== + Thera are 3 different kind of multi-switch (because there are 3 kinds of multi-case) + --> + <define name="multi-switch-inline"> + <element name="fo:multi-switch"> + <ref name="multi-switch.attlist"/> + <ref name="multi-switch-inline.content"/> + </element> + </define> + <define name="multi-switch-inline.content"> + <oneOrMore> + <ref name="multi-case-inline"/> + </oneOrMore> + </define> + <define name="multi-switch-block"> + <element name="fo:multi-switch"> + <ref name="multi-switch.attlist"/> + <ref name="multi-switch-block.content"/> + </element> + </define> + <define name="multi-switch-block.content"> + <oneOrMore> + <ref name="multi-case-block"/> + </oneOrMore> + </define> + <define name="multi-switch"> + <element name="fo:multi-switch"> + <ref name="multi-switch.attlist"/> + <ref name="multi-switch.content"/> + </element> + </define> + <define name="multi-switch.content"> + <oneOrMore> + <ref name="multi-case"/> + </oneOrMore> + </define> + <!-- + =============================================================== + Single case. Block-level formatting may be conveyed. + =============================================================== + Thera are 3 different kind of multi-case (similar to fo:wrapper) + --> + <define name="multi-case-inline"> + <element name="fo:multi-case"> + <ref name="multi-case.attlist"/> + <ref name="multi-case-inline.content"/> + </element> + </define> + <define name="multi-case-inline.content"> + <zeroOrMore> + <ref name="inlines-inline"/> + </zeroOrMore> + </define> + <define name="multi-case-block"> + <element name="fo:multi-case"> + <ref name="multi-case.attlist"/> + <ref name="multi-case-block.content"/> + </element> + </define> + <define name="multi-case-block.content"> + <zeroOrMore> + <ref name="blocks"/> + </zeroOrMore> + </define> + <define name="multi-case"> + <element name="fo:multi-case"> + <ref name="multi-case.attlist"/> + <ref name="multi-case.content"/> + </element> + </define> + <define name="multi-case.content"> + <zeroOrMore> + <ref name="mix"/> + </zeroOrMore> + </define> + <!-- + =============================================================== + Toggle. This is a typical inline. + =============================================================== + MEMO: This element is only permitted as a descendant of an fo:multi-case. + --> + <define name="multi-toggle"> + <element name="fo:multi-toggle"> + <ref name="multi-toggle.attlist"/> + <ref name="multi-toggle.content"/> + </element> + </define> + <define name="multi-toggle.content"> + <zeroOrMore> + <ref name="mix"/> + </zeroOrMore> + </define> + <!-- + =============================================================== + Multi-properties. + =============================================================== + Thera are 3 different kind of multi-properties (similar to fo:wrapper) + --> + <define name="multi-properties-inline"> + <element name="fo:multi-properties"> + <ref name="multi-properties.attlist"/> + <ref name="multi-properties-inline.content"/> + </element> + </define> + <define name="multi-properties-inline.content"> + <oneOrMore> + <ref name="multi-property-set"/> + </oneOrMore> + <ref name="wrapper-inline"/> + </define> + <define name="multi-properties-block"> + <element name="fo:multi-properties"> + <ref name="multi-properties.attlist"/> + <ref name="multi-properties-block.content"/> + </element> + </define> + <define name="multi-properties-block.content"> + <oneOrMore> + <ref name="multi-property-set"/> + </oneOrMore> + <ref name="wrapper-block"/> + </define> + <define name="multi-properties"> + <element name="fo:multi-properties"> + <ref name="multi-properties.attlist"/> + <ref name="multi-properties.content"/> + </element> + </define> + <define name="multi-properties.content"> + <oneOrMore> + <ref name="multi-property-set"/> + </oneOrMore> + <ref name="wrapper"/> + </define> + <!-- + =============================================================== + Multi property set. + =============================================================== + --> + <define name="multi-property-set"> + <element name="fo:multi-property-set"> + <ref name="multi-property-set.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + "Match anything" definition, used by fo:instream-foreign-object + =============================================================== + MEMO: Should we exclude elements which belongs to fo: namespace? + --> + <define name="any"> + <zeroOrMore> + <choice> + <element> + <anyName/> + <zeroOrMore> + <attribute> + <anyName/> + </attribute> + </zeroOrMore> + <ref name="any"/> + </element> + <text/> + </choice> + </zeroOrMore> + </define> +</grammar> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/valid/folint.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/valid/folint.xsl new file mode 100644 index 000000000..30e2a1414 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/valid/folint.xsl @@ -0,0 +1,3554 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> + +<!-- =================================================================== + +This stylesheet is meant as a replacement to a DTD for XSL Formatting +objects. It checks structural validity of an XSL FO document, issuing +messages at inconsistencies found. As compared to DTD, stylesheet +validation offers the following advantages: + +1. More flexibility in controlling the document structure. For example, +the stylesheet can control the following aspects of the document +structure that a DTD cannot handle: + + - check for block-level content through intermediate fo:wrapper elements; + - exclude contents of fo:instream-foreign-object from validation; + - check mutual exclusion of @internal-destination and @external-destination; + - check fo:marker/fo:initial-property-set position in a mixed content model; + - check that fo:marker is a descendant of fo:flow; + - check that a footnote may not contain other footnotes or floats; + - etc. + +2. Improved readability of validation error messages. Frequent errors can get +a separate message that explains the problem and eventually offers a hint +to fix it. (In many respects, this is still a TODO :-)). + +3. Namespace awareness. The namespace prefix need not be fixed anymore +(as it was the case with DTD validation). + +4. Smart handling of attribute values - "partial" validation. This stylesheet +catches misprints in predefined attribute values but passes expressions through. + +************************************************************************* + +IMPLEMENTATION NOTES + +1. Stylesheet structure and techniques. + +The structure of this stylesheet is trivial: we apply templates to each elements +and attributes, and issue an error message each time there is something suspicious +about the document structure. There is a dozen of named templates that assist us +in performing common tasks. + +1.1. Validating element names and content models + +Each element described in XSL 1.0 has a matching template, and all +incorrectly named or missplaced elements are catched by a default rule +(redefined to complain about invalid elements). Inside each template, +there is a number of checks for obligatory attributes and content model. +The document-node template checks namespace correctness and presence +of fo:root as the top node. + +1.2. Validating attribute occurrency + +By design of XSL, almost every property may be in principle specified +anywhere. Attribute occurrence can be reliably limited only in the +following places: + + - fo:layout-master-set and its descendants; + - terminal inline elements - fo:character, fo:page-number, + fo:page-number-citation, fo:initial-property-set; + - graphics - fo:external-graphics, fo:instream-foreign-object. + +I used the following approach to achieve this: the default rule +for @* complains about incorrect attribute. However, the priority +for this default rule differs across the element tree: + + * -2 for fo:root, fo:page-sequence and all descendants + of fo:page-sequence; + + * 2 for fo:simple-page-master and its descendants; + + * 4 for fo:layout-master-set and its descendants other than + fo:simple-master/fo:region-*. + +For each correct attribute, the stylesheet contains an enabling template. +Attributes that can occur only inside fo:page-sequence get enabling +templates with default priority; attributes permitted on region +descriptors get priority="3"; attributes of other fo:layout-master-set +children will have priority="5". + +To limit attribute occurrence on atomic inlines and graphics, there are +two disabling named templates defined. They are added inside enabling +templates. + +1.3. Validating attribute values. + +Validation of attribute values is hard in XSL FO because of expressions: +even properties with a closed list of possible values can be specified +as expressions. This stylesheet validates attributes "partially": + + - attributes that can get only fixed values are validated only if their value + does not contain a pair of parentheses (because any expression inside them + should inevitably contain a function call); + + - attributes that can get numeric values are validated if their value + does not contain any of the following: + + * parentheses; + * math operators; + * digits. + +This gives a reliable method of catching mistyped values of attributes. + +There are three cases where additional processing is necessary: + + A. Validation of URIs. Attributes that may get URI values are checked + to be of the form 'url(...)'. + + B. Validation of 'content-type' attribute. It is checked to start + with either 'content-type:' or 'namespace:'. + + C. Validation of 'text-align' attribute. This attribute may have an + arbitrary string as its value; therefore, its correct validation + is impossible - a mistype in any of the fixed values turns it + into a 'string'. Because 'string' alignment is rare, and fixed + values for text-align are ubiquitous, I felt necessary to introduce + some heuristics to distinguish between table-alignment strings + and mistyped predefined tokens. The heuristics is as follows: + if a value contains only alphabetic characters, it's a keyword + and should match one of the predefined tokens. Otherwise, it's + a string and should not be spellchecked. + + (Frankly speaking, a 'string' value of "left" cannot be distinguished + from a token 'left'. The property is really poorly designed.) + +2. This stylesheet also contains checks for some RenderX extensions to XSL FO. +They are placed into a separate namespace, and should not interfere +with the correct validation of conformant XSL FO documents. + +==================================================================== --> + +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:rx="http://www.renderx.com/XSL/Extensions" + exclude-result-prefixes="fo rx"> + +<xsl:output method="xml" omit-xml-declaration="yes"/> + +<!-- Strictness level. Currently used levels: 0 (loose), 1 (normal), 2 (pedantic) --> +<xsl:param name="strictness">1</xsl:param> + +<!-- =================================== --> +<!-- Match topmost node - must be <root> --> + +<xsl:template match="/"> + <xsl:if test="not(fo:root)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg"> + <xsl:choose> + <xsl:when test="local-name(*[1]) = 'root'"> + <xsl:text>Incorrect namespace at top element - should be 'http://www.w3.org/1999/XSL/Format'</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>Incorrect top element - should be 'root'</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="fo:root"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Root --> + +<xsl:template match="fo:root"> + <xsl:if test="@*[.='inherit']"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">Attributes with value of 'inherit' are meaningless on '<xsl:value-of select="name()"/>'.</xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::rx:meta-info + or self::fo:layout-master-set + or self::fo:declarations + or self::rx:outline + or self::fo:page-sequence)]" + mode="report-intrusive-elements"/> + + <xsl:if test="not(fo:layout-master-set)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element 'layout-master-set' is required as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:layout-master-set) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:layout-master-set[1])"/>' element as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:declarations) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:declarations[1])"/>' element as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="not(fo:page-sequence)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There should be at least one 'page-sequence' element as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:layout-master-set[preceding-sibling::fo:declarations]"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:layout-master-set[1])"/>' shall precede '<xsl:value-of select="name(fo:declarations[1])"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:declarations[preceding-sibling::fo:page-sequence]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:declarations[1])"/>' shall be placed before the first '<xsl:value-of select="name(fo:page-sequence[1])"/>' element. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:layout-master-set[preceding-sibling::fo:page-sequence]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:layout-master-set[1])"/>' shall be placed before the first '<xsl:value-of select="name(fo:page-sequence[1])"/>' element. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <!-- Tests of RenderX extension elements --> + <xsl:if test="count(rx:meta-info) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(rx:meta-info[1])"/>' element as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(rx:outline) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(rx:outline[1])"/>' element as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="rx:meta-info[preceding-sibling::*]"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(rx:meta-info[1])"/>' should be the first child of '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="rx:outline[preceding-sibling::fo:page-sequence]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(rx:outline[1])"/>' shall be placed before the first '<xsl:value-of select="name(fo:page-sequence[1])"/>' element. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> + +</xsl:template> + + +<!-- =================================== --> +<!-- Layout-master-set --> + +<xsl:template match="fo:layout-master-set"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:simple-page-master + or self::fo:page-sequence-master)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'simple-page-master' and 'page-sequence-master' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not(fo:simple-page-master)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There should be at least one 'simple-page-master' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Simple-page-master --> + +<xsl:template match="fo:simple-page-master"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:region-body + or self::fo:region-before + or self::fo:region-after + or self::fo:region-start + or self::fo:region-end)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only region descriptors are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not(@master-name)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'master-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:variable name="master-name" select="@master-name"/> + <xsl:if test="ancestor::fo:layout-master-set + and (following-sibling::*[@master-name = $master-name] + or preceding-sibling::*[@master-name = $master-name])"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg"> + Duplicate identifier: master-name="<xsl:value-of select="$master-name"/>". + Property 'master-name' should be unique within '<xsl:value-of select="name(ancestor::fo:layout-master-set[1])"/>'. + </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="not(fo:region-body)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element 'region-body' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:region-body) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:region-body[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:region-before) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:region-before[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:region-after) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:region-after[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:region-start) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:region-start[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:region-end) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:region-end[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <!-- I didn't want to control the ordering of regions; --> + <!-- but they convinced me... --> + + <xsl:if test="$strictness > 0"> + <xsl:if test="fo:region-body/preceding-sibling::*[self::fo:region-before + or self::fo:region-after + or self::fo:region-start + or self::fo:region-end] + or fo:region-before/preceding-sibling::*[self::fo:region-after + or self::fo:region-start + or self::fo:region-end] + or fo:region-after/preceding-sibling::*[self::fo:region-start + or self::fo:region-end] + or fo:region-start/preceding-sibling::fo:region-end"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">Incorrect order of region descriptors inside '<xsl:value-of select="name()"/>'. Regions shall be ordered according to the following content model: fo:region-body, fo:region-before?, fo:region-after?, fo:region-start?, fo:region-end?</xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + +<!-- =================================== --> +<!-- Regions --> + +<xsl:template match="fo:region-body + | fo:region-before + | fo:region-after + | fo:region-start + | fo:region-end"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + <xsl:if test="not(@extent) and not (self::fo:region-body)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'extent' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:variable name="region-name"> + <xsl:choose> + <xsl:when test="@region-name"> + <xsl:value-of select="@region-name"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat('xsl-', local-name())"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:if test="ancestor::fo:simple-page-master + and (preceding-sibling::*[@region-name = $region-name] + or following-sibling::*[@region-name = $region-name])"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg"> + Duplicate identifier: region-name="<xsl:value-of select="$region-name"/>". + Property 'region-name' shall be unique within '<xsl:value-of select="name(ancestor::fo:simple-page-master[1])"/>'. + </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="$strictness > 1"> + <xsl:if test="@*[starts-with(local-name(), 'padding')] + [normalize-space(.) != '0' + and normalize-space(.) != '0pt' + and normalize-space(.) != '0px' + and normalize-space(.) != '0mm' + and normalize-space(.) != '0em' + and normalize-space(.) != '0cm' + and normalize-space(.) != '0pc' + and normalize-space(.) != '0in']"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg"> + Padding on '<xsl:value-of select="name()"/>' is a RenderX extension. + </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="@*[starts-with(local-name(), 'border')]"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg"> + Border on '<xsl:value-of select="name()"/>' is a RenderX extension. + </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:if> + +</xsl:template> + + +<!-- =================================== --> +<!-- Page-sequence-master --> + +<xsl:template match="fo:page-sequence-master"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:if test="not(@master-name)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'master-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:variable name="master-name" select="@master-name"/> + <xsl:if test="ancestor::fo:layout-master-set + and (following-sibling::*[@master-name = $master-name] + or preceding-sibling::*[@master-name = $master-name])"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg"> + Duplicate identifier: master-name="<xsl:value-of select="$master-name"/>". + Property 'master-name' should be unique within '<xsl:value-of select="name(ancestor::fo:layout-master-set[1])"/>'. + </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*[not(self::fo:single-page-master-reference + or self::fo:repeatable-page-master-reference + or self::fo:repeatable-page-master-alternatives)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only page sequence specifiers are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not (fo:single-page-master-reference + or fo:repeatable-page-master-reference + or fo:repeatable-page-master-alternatives)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">At least one page sequence specifier is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Page master references --> + +<xsl:template match="fo:single-page-master-reference + | fo:repeatable-page-master-reference + | fo:conditional-page-master-reference"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + <xsl:if test="not(@master-reference)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'master-reference' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + + +<!-- =================================== --> +<!-- Repeatable-page-master-alternatives --> + +<xsl:template match="fo:repeatable-page-master-alternatives"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:conditional-page-master-reference)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'conditional-page-master-reference' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not(fo:conditional-page-master-reference)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">At least one 'conditional-page-master-reference' element should be present inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + +<!-- =================================== --> +<!-- Rx:meta-info --> + +<xsl:template match="rx:meta-info"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::rx:meta-field)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'meta-field' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not (rx:meta-field)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">At least one 'meta-field' element should be present inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Rx:meta-field --> + +<xsl:template match="rx:meta-field"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + <xsl:if test="not(@name)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + <xsl:if test="not(@value)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'value' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<!-- =================================== --> +<!-- Rx:page-device --> + +<xsl:template match="rx:page-device" mode="report-intrusive-elements"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element 'page-device' is obsolete; use <?xep-postscript-* ?> processing instructions instead.</xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- =================================== --> +<!-- Declarations --> + +<xsl:template match="fo:declarations"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:color-profile)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'color-profile' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Color-profile --> + +<xsl:template match="fo:color-profile"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + <xsl:if test="not(@color-profile-name)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'color-profile-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + <xsl:if test="not(@src)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'src' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + + +<!-- =================================== --> +<!-- Rx:outline --> + +<xsl:template match="rx:outline"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::rx:bookmark)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'bookmark' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not (rx:bookmark)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">At least one 'bookmark' element should be present inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Rx:bookmark --> + +<xsl:template match="rx:bookmark"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:if test="not(@internal-destination or @external-destination)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Either 'internal-destination' or 'external-destination' attribute must be present on '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="@internal-destination and @external-destination"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Only one of 'internal-destination' or 'external-destination' attributes can be present on '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*[not(self::rx:bookmark + or self::rx:bookmark-label)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'bookmark-label' and/or nested 'boormark' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not (rx:bookmark-label)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element 'bookmark-label' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count (rx:bookmark-label) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There should be exactly one '<xsl:value-of select="name(rx:bookmark-label[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="rx:bookmark-label[preceding-sibling::*]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(rx:bookmark-label[1])"/>' should be the first child of '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Rx:bookmark-label --> + +<xsl:template match="rx:bookmark-label"> + <xsl:apply-templates select="@*"/> + + <xsl:apply-templates select="*" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only plain text is permitted in this context.</xsl:with-param> + </xsl:apply-templates> +</xsl:template> + + +<!-- =================================== --> +<!-- Page-sequence --> + +<xsl:template match="fo:page-sequence"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:if test="not(@master-reference)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'master-reference' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*[not(self::fo:title + or self::fo:static-content + or self::fo:flow)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'flow', 'static-content', and 'title' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not(fo:flow)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element 'flow' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:flow) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:flow[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:title) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be at most one '<xsl:value-of select="name(fo:title[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:title[preceding-sibling::*]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:title[1])"/>' should be the first child of its parent '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:flow[following-sibling::*]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:flow[1])"/>' should be the last child of its parent '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Title --> + +<xsl:template match="fo:title"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="inline-level"/> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Flow and static-content --> + +<xsl:template match="fo:flow | fo:static-content"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="block-level"/> + + <xsl:if test="not(@flow-name)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'flow-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:variable name="flow-name" select="@flow-name"/> + <xsl:if test="ancestor::fo:page-sequence + and (following-sibling::*[self::fo:flow or self::fo:static-content][@flow-name = $flow-name] + or preceding-sibling::*[self::fo:flow or self::fo:static-content][@flow-name = $flow-name])"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg"> + Duplicate identifier: flow-name="<xsl:value-of select="$flow-name"/>". + Property 'flow-name' should be unique within '<xsl:value-of select="name(ancestor::fo:page-sequence[1])"/>'. + </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Rx:flow-section --> + +<xsl:template match="rx:flow-section"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="block-level"/> + + <xsl:if test="not(parent::fo:flow)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' must be a direct descendant of 'flow'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Block --> + +<xsl:template match="fo:block"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="mixed-level"/> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Containers --> + +<xsl:template match="fo:block-container | fo:inline-container"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="block-level"/> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Bidi-override --> + +<xsl:template match="fo:bidi-override"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="inline-level"/> + + <xsl:if test="not(@direction)"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">Attribute 'direction' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Character --> + +<xsl:template match="fo:character"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:if test="not(@character)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'character' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + + +<!-- =================================== --> +<!-- Initial-property-set --> + +<xsl:template match="fo:initial-property-set"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:choose> + <xsl:when test="parent::fo:block"> + <xsl:if test="preceding-sibling::*"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be the first child of '<xsl:value-of select="name(parent::fo:block)"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="preceding-sibling::text()[normalize-space() != '']"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be preceded by non-space characters in '<xsl:value-of select="name(parent::fo:block)"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="preceding-sibling::fo:initial-property-set"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Only one '<xsl:value-of select="name()"/>' element is permitted in 'xsl:value-of select="name(parent::fo:block)"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:when> + + <xsl:otherwise> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' can only occur inside 'block'. </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + + +<!-- =================================== --> +<!-- Line-numerator --> + +<xsl:template match="rx:ruler"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:choose> + <xsl:when test="parent::fo:block-container"> + <xsl:if test="preceding-sibling::*"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be the first child of '<xsl:value-of select="name(parent::fo:block-container)"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="preceding-sibling::text()[normalize-space() != '']"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be preceded by non-space characters in '<xsl:value-of select="name(parent::fo:block-container)"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="preceding-sibling::rx:ruler"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Only one '<xsl:value-of select="name()"/>' element is permitted in 'xsl:value-of select="name(parent::fo:block-container)"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:when> + + <xsl:otherwise> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' can only occur inside 'block-container'. </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + + +<!-- =================================== --> +<!-- External-graphic --> + +<xsl:template match="fo:external-graphic"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:if test="not(@src)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'src' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + + +<!-- =================================== --> +<!-- Instream-foreign-object --> + +<xsl:template match="fo:instream-foreign-object"> + <xsl:apply-templates select="@*"/> + <!-- only the attributes are checked --> +</xsl:template> + + +<!-- =================================== --> +<!-- Inline --> + +<xsl:template match="fo:inline"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="mixed-level"/> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Leader --> + +<xsl:template match="fo:leader"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="inline-level"/> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Page-number --> + +<xsl:template match="fo:page-number"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Page-number-citation --> + +<xsl:template match="fo:page-number-citation"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:if test="not(@ref-id)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'ref-id' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<!-- ========================================================== --> +<!-- Rx:page-number-citation-last (actually an XSL 1.1 element) --> + +<xsl:template match="rx:page-number-citation-last"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:if test="not(@ref-id)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'ref-id' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + + +<!-- =================================== --> +<!-- Rx:pinpoint --> + +<xsl:template match="rx:pinpoint"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:if test="not(@value)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'value' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + + +<!-- =================================== --> +<!-- Rx:page-index --> + +<xsl:template match="rx:page-index"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::rx:index-item)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'rx:index-item' elements are permitted in this context</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not(@ref-key) and not (rx:index-item)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' must have either 'ref-key' attribute, or 'rx:index-item' descendant elements.</xsl:with-param> + </xsl:call-template> + </xsl:if> + <xsl:if test="@ref-key and rx:index-item"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' can have either 'ref-key' attribute or '<xsl:value-of select="name(rx:index-item[1])"/>' descendant elements, but not both.</xsl:with-param> + </xsl:call-template> + </xsl:if> + <xsl:apply-templates select="*"/> +</xsl:template> + +<!-- =================================== --> +<!-- Rx:index-item --> + +<xsl:template match="rx:index-item"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:if test="not(@ref-key)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'ref-key' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + + +<!-- =================================== --> +<!-- Rx:begin-index-range --> + +<xsl:template match="rx:begin-index-range"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:if test="not(@rx:key)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'rx:key' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:choose> + <xsl:when test="not(@id)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'id' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="id" select="@id"/> + + <xsl:if test="count(preceding::rx:begin-index-range[@id=$id]) = 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Two or more '<xsl:value-of select="name()"/>' elements with id='<xsl:value-of select="@id"/>'; 'id' should be unique within the document.</xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:choose> + <xsl:when test="following::rx:end-index-range[@ref-id=$id]"/> + <xsl:when test="preceding::rx:end-index-range[@ref-id=$id]"/> + <xsl:otherwise> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Unmatched '<xsl:value-of select="name()"/>' element with id='<xsl:value-of select="@id"/>': no correspondent 'rx:end-index-range' found. </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- =================================== --> +<!-- Rx:end-index-range --> + +<xsl:template match="rx:end-index-range"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:choose> + <xsl:when test="not(@ref-id)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'ref-id' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="refid" select="@ref-id"/> + + <xsl:if test="count(preceding::rx:end-index-range[@ref-id=$refid]) = 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Two or more '<xsl:value-of select="name()"/>' elements with ref-id='<xsl:value-of select="@ref-id"/>'.</xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:choose> + <xsl:when test="following::rx:begin-index-range[@id=$refid]"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' with ref-id='<xsl:value-of select="@ref-id"/>' precedes its matching '<xsl:value-of select="name(following::rx:begin-index-range[@id=$refid][1])"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="preceding::rx:begin-index-range[@id=$refid]"/> + <xsl:otherwise> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Unmatched '<xsl:value-of select="name()"/>' element with ref-id='<xsl:value-of select="@ref-id"/>': no correspondent 'rx:begin-index-range' found. </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + + +<!-- =================================== --> +<!-- Table-and-caption --> + +<xsl:template match="fo:table-and-caption"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:table-caption + or self::fo:table + or self::fo:marker)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'table-caption' and 'table' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not(fo:table)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element 'table' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:table) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:table[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:table-caption) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:table-caption[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:table-caption[preceding-sibling::fo:table]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:table-caption[1])"/>' must precede '<xsl:value-of select="name(fo:table[1])"/>' inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Table-caption --> + +<xsl:template match="fo:table-caption"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="block-level"/> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Table --> + +<xsl:template match="fo:table"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:table-column + or self::fo:table-header + or self::fo:table-footer + or self::fo:table-body + or self::fo:marker)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'table-column' elements, row group elements, and markers are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not(fo:table-body)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">At least one 'table-body' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:table-header) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:table-header[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:table-footer) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:table-footer[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:table-column[preceding-sibling::*[not(self::fo:table-column or self::fo:marker)]]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">'<xsl:value-of select="name(fo:table-column[1])"/>' elements should be located before any other element in '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:table-header[preceding-sibling::fo:table-footer]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:table-header[1])"/>' should be located before '<xsl:value-of select="name(fo:table-footer[1])"/>' in '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:table-header[preceding-sibling::fo:table-body]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:table-header[1])"/>' should be located before '<xsl:value-of select="name(fo:table-body[1])"/>' in '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:table-body[following-sibling::*[not(self::fo:table-body)]]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">'<xsl:value-of select="name(fo:table-body[1])"/>' elements should be located last in '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Row group elements --> + +<xsl:template match="fo:table-body | fo:table-header | fo:table-footer"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:table-row + or self::fo:table-cell + or self::fo:marker)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'table-row', 'table-cell', or 'marker' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="$strictness > 0"> + <xsl:if test="not (*)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Empty '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:if> + + <xsl:if test="fo:table-row and fo:table-cell"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">'<xsl:value-of select="name(fo:table-row[1])"/>' and '<xsl:value-of select="name(fo:table-cell[1])"/>' elements should not be mixed inside '<xsl:value-of select="name()"/>' element. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Table-row --> + +<xsl:template match="fo:table-row"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:table-cell)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'table-cell' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not(parent::fo:table-body or parent::fo:table-header or parent::fo:table-footer)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be wrapped in 'table-body', 'table-header', or 'table-footer'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + +<!-- =================================== --> +<!-- Table-cell --> + +<xsl:template match="fo:table-cell"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="block-level"/> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- List-block --> + +<xsl:template match="fo:list-block"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:list-item or self::fo:marker)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'list-item' or 'marker' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- List-item --> + +<xsl:template match="fo:list-item"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:list-item-label + or self::fo:list-item-body + or self::fo:marker)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Element '<xsl:value-of select="name()"/>' shall consist of one 'list-item-label' and one 'list-item-body'.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not(parent::fo:list-block)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a child of 'list-block'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="not(fo:list-item-label)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element 'list-item-label' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="not(fo:list-item-body)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element 'list-item-body' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:list-item-label) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:list-item-label[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:list-item-body) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:list-item-body[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:list-item-body[following-sibling::fo:list-item-label]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:list-item-label[1])"/>' must precede '<xsl:value-of select="name(fo:list-item-body[1])"/>' inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:list-item-label and not (fo:list-item-label/@start-indent) + and not (fo:list-item-label/@margin) + and not (fo:list-item-label/@margin-left) + and not (fo:list-item-label/@margin-right) + and not (fo:list-item-label/@margin-top) + and not (fo:list-item-label/@margin-bottom) + and fo:list-item-body and not (fo:list-item-body/@start-indent) + and not (fo:list-item-body/@margin) + and not (fo:list-item-body/@margin-left) + and not (fo:list-item-body/@margin-right) + and not (fo:list-item-body/@margin-top) + and not (fo:list-item-body/@margin-bottom)"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">Start-indent is not specified neither on '<xsl:value-of select="name(fo:list-item-label[1])"/>' nor on '<xsl:value-of select="name(fo:list-item-body[1])"/>': list subcomponents will overlap</xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:list-item-label and not (fo:list-item-label/@end-indent) + and not (fo:list-item-label/@margin) + and not (fo:list-item-label/@margin-left) + and not (fo:list-item-label/@margin-right) + and not (fo:list-item-label/@margin-top) + and not (fo:list-item-label/@margin-bottom) + and fo:list-item-body and not (fo:list-item-body/@end-indent) + and not (fo:list-item-body/@margin) + and not (fo:list-item-body/@margin-left) + and not (fo:list-item-body/@margin-right) + and not (fo:list-item-body/@margin-top) + and not (fo:list-item-body/@margin-bottom)"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">End-indent is not specified neither on '<xsl:value-of select="name(fo:list-item-label[1])"/>' nor on '<xsl:value-of select="name(fo:list-item-body[1])"/>': list subcomponents will overlap</xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- List item subcomponents --> + +<xsl:template match="fo:list-item-label | fo:list-item-body"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="block-level"/> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Footnote --> + +<xsl:template match="fo:footnote"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + <xsl:call-template name="out-of-line"/> + + <xsl:apply-templates select="*[not(self::fo:inline + or self::fo:footnote-body)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Element '<xsl:value-of select="name()"/>' shall consist of one 'inline' and one 'footnote-body'.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not(fo:inline)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element 'inline' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="not(fo:footnote-body)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element 'footnote-body' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:inline) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:inline[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:footnote-body) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:footnote-body[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:footnote-body[following-sibling::fo:inline]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:inline[1])"/>' must precede '<xsl:value-of select="name(fo:footnote-body[1])"/>' inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:for-each select="fo:inline"> + <xsl:call-template name="inline-level"/> + </xsl:for-each> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Footnote-body --> + +<xsl:template match="fo:footnote-body"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="block-level"/> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Float --> + +<xsl:template match="fo:float"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="block-level"/> + <xsl:call-template name="out-of-line"/> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Wrapper --> + +<xsl:template match="fo:wrapper"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="mixed-level"/> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- === =============================== --> +<!-- Marker --> + +<xsl:template match="fo:marker"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="mixed-level"/> + + <xsl:choose> + <xsl:when test="not(@marker-class-name)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'marker-class-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="marker-class-name" select="@marker-class-name"/> + <xsl:if test="preceding-sibling::fo:marker[@marker-class-name=$marker-class-name]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Sibling <xsl:value-of select="name()"/> elements have the same value of 'marker-class-name' attribute ("<xsl:value-of select="@marker-class-name"/>"). </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:otherwise> + </xsl:choose> + + <xsl:if test="preceding-sibling::*[not(self::fo:marker)]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">'<xsl:value-of select="name()"/>' elements should be initial children of their parents. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="preceding-sibling::text()[normalize-space() != '']"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be preceded by non-space text nodes. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="not(ancestor::fo:flow)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a descendant of 'flow'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="ancestor::fo:multi-case"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be used inside '<xsl:value-of select="name(ancestor::fo:multi-case[1])"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="ancestor::fo:float"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be used inside '<xsl:value-of select="name(ancestor::fo:float[1])"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="ancestor::fo:footnote"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be used inside '<xsl:value-of select="name(ancestor::fo:footnote[1])"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + +<!-- === =============================== --> +<!-- Retrieve-marker --> + +<xsl:template match="fo:retrieve-marker"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:if test="not(@retrieve-class-name)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'retrieve-class-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="not(ancestor::fo:static-content)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a descendant of 'static-content'. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + + +<!-- === =============================== --> +<!-- Basic-link --> + +<xsl:template match="fo:basic-link"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="mixed-level"/> + + <xsl:if test="not(@internal-destination or @external-destination)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Either 'internal-destination' or 'external-destination' attribute must be present on '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="@internal-destination and @external-destination"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Only one of 'internal-destination' or 'external-destination' attributes can be present on '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Multi-switch --> + +<xsl:template match="fo:multi-switch"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:multi-case)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Only 'multi-case' elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- =================================== --> +<!-- Multi-case --> + +<xsl:template match="fo:multi-case"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="mixed-level"/> + <xsl:if test="not(parent::fo:multi-switch)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a child of 'multi-switch'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- ===================================== --> +<!-- Multi-toggle --> + +<xsl:template match="fo:multi-toggle"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="mixed-level"/> + + <xsl:if test="not(ancestor::fo:multi-case)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' can be used only inside 'multi-case'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- ===================================== --> +<!-- Multi-properties --> + +<xsl:template match="fo:multi-properties"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="no-text"/> + + <xsl:apply-templates select="*[not(self::fo:multi-property-set + or self::fo:wrapper)]" + mode="report-intrusive-elements"> + <xsl:with-param name="reason">Element '<xsl:value-of select="name()"/>' shall consist of one or more 'multi-property-set' elements, followed by a 'wrapper'.</xsl:with-param> + </xsl:apply-templates> + + <xsl:if test="not(fo:multi-property-set)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">At least one 'multi-property-set' element should be specified in '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="not(fo:wrapper)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element 'wrapper' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="count(fo:wrapper) > 1"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:wrapper[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="fo:wrapper[following-sibling::fo:multi-property-set]"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:wrapper[1])"/>' must be located after all '<xsl:value-of select="name(fo:multi-property-set[1])"/>' elements inside '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:apply-templates select="*"/> +</xsl:template> + + +<!-- ===================================== --> +<!-- Multi-property-set --> + +<xsl:template match="fo:multi-property-set"> + <xsl:apply-templates select="@*"/> + <xsl:call-template name="empty-element"/> + + <xsl:if test="not(@active-state)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'active-state' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="not(parent::fo:multi-properties)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a child of 'multi-properties'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + +</xsl:template> + + +<!-- =================================== --> +<!-- Common structure-checking templates --> + +<!-- Check for block-level elements --> + +<xsl:template name="block-level"> + <xsl:call-template name="no-text"> + <xsl:with-param name="reason">Only block-level elements are permitted in this context.</xsl:with-param> + </xsl:call-template> + + <xsl:apply-templates select="*[not(self::fo:block + or self::fo:block-container + or self::fo:list-block + or self::fo:table + or self::fo:table-and-caption + or self::fo:float + or self::fo:wrapper + or self::fo:marker + or self::fo:retrieve-marker + or self::fo:multi-switch + or self::fo:multi-properties + or self::rx:ruler + or self::rx:begin-index-range + or self::rx:end-index-range + or self::rx:flow-section)]" + mode="report-intrusive-elements-block"> + <xsl:with-param name="reason">Only block-level elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + <xsl:for-each select="fo:wrapper | fo:multi-switch/fo:multi-case | fo:multi-properties"> + <xsl:call-template name="block-level"/> + </xsl:for-each> +</xsl:template> + + +<!-- Check for inline-level elements --> + +<xsl:template name="inline-level"> + <xsl:apply-templates select="*[not(self::fo:bidi-override + or self::fo:character + or self::fo:external-graphic + or self::fo:instream-foreign-object + or self::fo:inline + or self::fo:inline-container + or self::fo:leader + or self::fo:page-number + or self::fo:page-number-citation + or self::fo:basic-link + or self::fo:multi-toggle + or self::fo:footnote + or self::fo:float + or self::fo:wrapper + or self::fo:marker + or self::fo:retrieve-marker + or self::fo:multi-switch + or self::fo:multi-properties or self::rx:page-index + or self::rx:page-number-citation-last + or self::rx:page-index + or self::rx:begin-index-range + or self::rx:end-index-range + or self::rx:pinpoint)]" + mode="report-intrusive-elements-inline"> + <xsl:with-param name="reason">Only inline-level elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + <xsl:for-each select="fo:wrapper | fo:multi-switch/fo:multi-case | fo:multi-properties | fo:multi-toggle | fo:inline | fo:basic-link | fo:bidi-override"> + <xsl:call-template name="inline-level"/> + </xsl:for-each> +</xsl:template> + + +<!-- Check for mixed-level elements --> + +<xsl:template name="mixed-level"> + <xsl:apply-templates select="*[not(self::fo:block + or self::fo:block-container + or self::fo:list-block + or self::fo:table + or self::fo:table-and-caption + or self::fo:bidi-override + or self::fo:character + or self::fo:external-graphic + or self::fo:initial-property-set + or self::fo:instream-foreign-object + or self::fo:inline + or self::fo:inline-container + or self::fo:leader + or self::fo:page-number + or self::fo:page-number-citation + or self::fo:basic-link + or self::fo:multi-toggle + or self::fo:footnote + or self::fo:float + or self::fo:wrapper + or self::fo:marker + or self::fo:retrieve-marker + or self::fo:multi-switch + or self::fo:multi-properties + or self::rx:page-number-citation-last + or self::rx:page-index + or self::rx:begin-index-range + or self::rx:end-index-range + or self::rx:pinpoint)]" + mode="report-intrusive-elements-block"> + <xsl:with-param name="reason">Only block-level or inline-level elements are permitted in this context.</xsl:with-param> + </xsl:apply-templates> + <xsl:for-each select="fo:wrapper | fo:multi-switch/fo:multi-case | fo:multi-properties"> + <xsl:call-template name="mixed-level"/> + </xsl:for-each> +</xsl:template> + + +<!-- Check constraints applicable to out-of-line elements --> + +<xsl:template name="out-of-line"> + <xsl:if test="not(ancestor::fo:flow)"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a descendant of 'flow'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="ancestor::fo:float"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be a descendant of '<xsl:value-of select="name(ancestor::fo:float[1])"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="ancestor::fo:footnote-body"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be a descendant of '<xsl:value-of select="name(ancestor::fo:footnote-body[1])"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="ancestor::fo:marker"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be a descendant of '<xsl:value-of select="name(ancestor::fo:marker[1])"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="ancestor::*[@position='absolute' or @absolute-position='absolute' + or @position='fixed' or @absolute-position='fixed']"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be a descendant of an absolutely positioned + '<xsl:value-of select="name(ancestor::*[@position='absolute' or @absolute-position='absolute' + or @position='fixed' or @absolute-position='fixed'][1])"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<!-- =================================== --> +<!-- Auxiliary templates --> + + +<!-- Check for non-blank #PCDATA --> + +<xsl:template name="no-text"> + <xsl:param name="reason" select="''"/> + + <xsl:if test="text()[normalize-space(.) != '']"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg"> + Element '<xsl:value-of select="name()"/>' cannot have non-empty text descendants here. + <xsl:if test="$reason != ''"> + <xsl:value-of select="$reason"/> + </xsl:if> + </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + + +<!-- Check for element being EMPTY --> + +<xsl:template name="empty-element"> + <xsl:if test="* | text()"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' must be empty. </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + + + +<!-- Report an element that may not be present in a given point --> + +<xsl:template match="*" + mode="report-intrusive-elements" + priority="-1"> + <xsl:param name="reason" select="''"/> + <xsl:variable name="uri" select="namespace-uri()"/> + + <xsl:choose> + <xsl:when test="$uri='http://www.w3.org/1999/XSL/Format' + or $uri='http://www.renderx.com/XSL/Extensions'"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg"> + Element '<xsl:value-of select="name()"/>' cannot be a child of '<xsl:value-of select="name(..)"/>'. + <xsl:if test="$reason != ''"> + <xsl:value-of select="$reason"/> + </xsl:if> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="$uri = ''"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg"> + Element '<xsl:value-of select="name()"/>' belonging to the anonymous namespace cannot occur in an XSL-FO document outside 'instream-foreign-object' elements. + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="$uri = 'http://www.w3.org/2000/svg'"> + <xsl:if test="$strictness > 0"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg"> + SVG element '<xsl:value-of select="name()"/>' is located outside 'instream-foreign-object' element. + </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:if test="$strictness > 1"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg"> + Element '<xsl:value-of select="name()"/>' belongs to an unknown namespace <xsl:value-of select="$uri"/> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="*" + mode="report-intrusive-elements-block" + priority="-1"> + <xsl:param name="reason"/> + + <xsl:apply-templates select="." mode="report-intrusive-elements"> + <xsl:with-param name="reason" select="$reason"/> + </xsl:apply-templates> +</xsl:template> + +<xsl:template match="*" + mode="report-intrusive-elements-inline" + priority="-1"> + <xsl:param name="reason"/> + + <xsl:apply-templates select="." mode="report-intrusive-elements"> + <xsl:with-param name="reason" select="$reason"/> + </xsl:apply-templates> +</xsl:template> + + +<!-- Special case: report an invalid element contained in a wrapper --> + +<xsl:template match="fo:wrapper/* + | fo:multi-properties/* + | fo:multi-case/*" + mode="report-intrusive-elements-block"> + <xsl:param name="reason" select="''"/> + + <xsl:call-template name="print-error"> + <xsl:with-param name="msg"> + Element '<xsl:value-of select="name()"/>' cannot be a descendant of '<xsl:value-of select="name(ancestor::*[not(self::fo:wrapper or self::fo:multi-switch or self::fo:multi-case or self::fo:multi-properties)][1])"/>' through wrapper elements. + <xsl:if test="$reason != ''"> + <xsl:value-of select="$reason"/> + </xsl:if> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:wrapper/* + | fo:inline/* + | fo:basic-link/* + | fo:bidi-override/* + | fo:multi-toggle/* + | fo:multi-properties/* + | fo:multi-case/*" + mode="report-intrusive-elements-inline"> + <xsl:param name="reason" select="''"/> + + <xsl:call-template name="print-error"> + <xsl:with-param name="msg"> + Element '<xsl:value-of select="name()"/>' cannot be a descendant of '<xsl:value-of select="name(ancestor::*[not(self::fo:wrapper or self::fo:multi-switch or self::fo:multi-case or self::fo:multi-toggle or self::fo:multi-properties or self::fo:inline)][1])"/>' through wrapper or inline elements. + <xsl:if test="$reason != ''"> + <xsl:value-of select="$reason"/> + </xsl:if> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- Default rules --> + +<xsl:template match="*" priority="-1"/> +<xsl:template match="text()"/> + + +<!-- ##################################################################### --> +<!-- Processing of attributes. --> +<!-- ##################################################################### --> + +<!-- Report any attribute not covered by enabling templates --> + +<xsl:template match="@*" priority="-2"> + <xsl:call-template name="complain-attribute"/> +</xsl:template> + +<!-- Report any attribute in fo:layout-master-set etc. as invalid. --> +<!-- This is overridden by a rule with higher priority for those (few) --> +<!-- properties that actually may occur in these special positions --> + +<xsl:template match="@*[not (parent::fo:root) + and not (ancestor::fo:page-sequence) + and not (parent::*/parent::fo:simple-page-master)]" + priority="4"> + <xsl:call-template name="complain-attribute"/> +</xsl:template> + +<xsl:template match="fo:simple-page-master/*/@*" priority="2"> + <xsl:call-template name="complain-attribute"/> +</xsl:template> + +<xsl:template name="complain-attribute"> + <xsl:variable name="uri" select="namespace-uri()"/> + + <xsl:choose> + <!-- Ignore attributes from XML namespace - xml:space, xml:base, etc. --> + <xsl:when test="$uri='http://www.w3.org/XML/1998/namespace'"/> + <xsl:when test="$uri='' + or $uri='http://www.w3.org/1999/XSL/Format' + or $uri='http://www.renderx.com/XSL/Extensions'"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot occur at element '<xsl:value-of select="name(..)"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:if test="$strictness > 1"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' at element '<xsl:value-of select="name(..)"/>' belongs to an unknown namespace <xsl:value-of select="$uri"/> </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="disable-on-atomic-inlines"> + <xsl:if test="parent::fo:character + or parent::fo:page-number + or parent::fo:page-number-citation + or parent::rx:page-number-citation-last + or parent::fo:initial-property-set"> + <xsl:call-template name="complain-attribute"/> + </xsl:if> +</xsl:template> + + +<xsl:template name="disable-on-graphics"> + <xsl:if test="parent::fo:external-graphic + or parent::fo:instream-foreign-object"> + <xsl:call-template name="complain-attribute"/> + </xsl:if> +</xsl:template> + +<!-- Report a value not in a list. Expressions (recognized by the presence --> +<!-- of parentheses or operators) are excluded from validation. --> + +<xsl:template name="enumerated-values"> + <xsl:param name="valuelist"/> + <xsl:variable name="value" select="normalize-space(.)"/> + <xsl:choose> + <xsl:when test="contains($valuelist, concat(' ', $value, ' '))"/> + <xsl:when test="contains($value, '(') and contains ($value, ')')"/> + <xsl:otherwise> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot have a value of "<xsl:value-of select="$value"/>". </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- Report a value that is not a valid number or length. Skips validation --> +<!-- of attributes containing digits, parentheses, and math operators. --> + +<xsl:template name="quantitative-values"> + <xsl:param name="valuelist"/> + <xsl:variable name="value" select="normalize-space(.)"/> + <xsl:choose> + <xsl:when test="contains($valuelist, concat(' ', $value, ' '))"/> + <xsl:when test="contains($value, '(') and contains ($value, ')')"/> + <xsl:when test="contains($value, '0')"/> + <xsl:when test="contains($value, '1')"/> + <xsl:when test="contains($value, '2')"/> + <xsl:when test="contains($value, '3')"/> + <xsl:when test="contains($value, '4')"/> + <xsl:when test="contains($value, '5')"/> + <xsl:when test="contains($value, '6')"/> + <xsl:when test="contains($value, '7')"/> + <xsl:when test="contains($value, '8')"/> + <xsl:when test="contains($value, '9')"/> + <xsl:when test="contains($value, '+')"/> + <xsl:when test="contains($value, ' - ')"/> + <xsl:when test="contains($value, '*')"/> + <xsl:when test="contains($value, ' div ')"/> + <xsl:when test="contains($value, ' mod ')"/> + <xsl:otherwise> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot have a value of "<xsl:value-of select="$value"/>". </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- Check if a value is valid as a URL specifier --> +<xsl:template name="check-url"> + <xsl:variable name="val" select="normalize-space()"/> + <xsl:choose> + <xsl:when test="$val = 'inherit'"/> + <xsl:when test="starts-with($val, 'url(') + and substring ($val, string-length($val)) = ')'"/> + <xsl:otherwise> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot have a value of "<xsl:value-of select="."/>": should be either 'inherit' or a URI: <xsl:value-of select="name()"/>="url(...)".</xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- 7.3. Accessibility properties - ubiquitous; not validated --> +<xsl:template match="@source-document" priority="5"> + <xsl:variable name="val" select="normalize-space()"/> + <xsl:choose> + <xsl:when test="$val = 'inherit'"/> + <xsl:when test="$val = 'none'"/> + <xsl:when test="starts-with($val, 'url(') + and substring ($val, string-length($val)) = ')'"/> + <xsl:otherwise> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot have a value of "<xsl:value-of select="."/>": should be 'inherit', 'none', or one or more URIs: source="url(...) [url(...) ...]".</xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + + +<xsl:template match="@role" priority="5"/> + +<!-- 7.4. Absolute position --> +<xsl:template match="fo:block-container/@absolute-position"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto absolute fixed inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@top | @bottom | @left | @right"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 7.5. Aural properties. May happen everywhere in the flows. Not validated. --> +<xsl:template match="@azimuth"/> +<xsl:template match="@cue-after"/> +<xsl:template match="@cue-before"/> + +<xsl:template match="@elevation"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> below level above higher lower inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@pause-after | @pause-before"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@pitch"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> x-low low medium high x-high inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@pitch-range"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@play-during"/> + +<xsl:template match="@richness"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@speak"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> normal none spell-out inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@speak-header"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> once always inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@speak-numeral"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> digits continuous inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@speak-punctuation"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> code none inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@speech-rate"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> x-slow slow medium fast x-fast faster slower inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@stress"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@voice-family"/> +<xsl:template match="@volume"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> silent x-soft soft medium loud x-loud inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- 7.6. Border, padding, and background --> +<xsl:template priority="3" match="@background-attachment"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> scroll fixed inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="3" match="@background-color"/> + +<xsl:template priority="3" match="@background-image"> + <xsl:if test=". != 'none'"> + <xsl:call-template name="check-url"/> + </xsl:if> +</xsl:template> + +<xsl:template priority="3" match="@background-repeat"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> repeat repeat-x repeat-y no-repeat inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="3" match="@background-position-horizontal"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> left center right inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="3" match="@background-position-vertical"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> top center bottom inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="3" + match="@border-before-color + | @border-after-color + | @border-start-color + | @border-end-color + | @border-top-color + | @border-bottom-color + | @border-left-color + | @border-right-color"/> + +<xsl:template priority="3" + match="@border-before-style + | @border-after-style + | @border-start-style + | @border-end-style + | @border-top-style + | @border-bottom-style + | @border-left-style + | @border-right-style"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> none hidden dotted dashed solid double groove ridge inset outset inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="3" + match="@border-before-width + | @border-before-width.length + | @border-after-width + | @border-after-width.length + | @border-start-width + | @border-start-width.length + | @border-end-width + | @border-end-width.length + | @border-top-width + | @border-bottom-width + | @border-left-width + | @border-right-width"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> thin medium thick inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@border-before-width.conditionality + | @border-after-width.conditionality + | @border-start-width.conditionality + | @border-end-width.conditionality"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> discard retain </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="3" + match="@padding-before + | @padding-before.length + | @padding-after + | @padding-after.length + | @padding-start + | @padding-start.length + | @padding-end + | @padding-end.length + | @padding-top + | @padding-bottom + | @padding-left + | @padding-right"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@padding-before.conditionality + | @padding-after.conditionality + | @padding-start.conditionality + | @padding-end.conditionality"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> discard retain </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 7.7. Font properties --> +<xsl:template match="@font-family"> + <xsl:call-template name="disable-on-graphics"/> +</xsl:template> + +<xsl:template match="@font-selection-strategy"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto character-by-character inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@font-size"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> xx-small x-small small medium large x-large xx-large larger smaller inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@font-stretch"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> <!-- this is kinda sorta extension --> + <xsl:with-param name="valuelist"> normal wider narrower ultra-condensed extra-condensed condensed semi-condensed semi-expanded expanded extra-expanded ultra-expanded inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@font-size-adjust"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> none inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@font-style"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> normal italic oblique backslant inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@font-variant"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> normal small-caps inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@font-weight"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> normal bold bolder lighter inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 7.8. Hyphenation --> +<xsl:template match="@country"> + <xsl:call-template name="disable-on-graphics"/> +</xsl:template> + +<xsl:template match="@language"> + <xsl:call-template name="disable-on-graphics"/> +</xsl:template> + +<xsl:template match="@script"> + <xsl:call-template name="disable-on-graphics"/> +</xsl:template> + +<xsl:template match="@hyphenate"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> false true inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@hyphenation-character"> + <xsl:call-template name="disable-on-graphics"/> +</xsl:template> + +<xsl:template match="@hyphenation-push-character-count + | @hyphenation-remain-character-count"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- 7.9 - 7.10. Margin properties - block and inline --> +<xsl:template match="@margin-top + | @margin-bottom + | @margin-left + | @margin-right"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="5" + match="fo:region-body/@margin-top + | fo:region-body/@margin-bottom + | fo:region-body/@margin-left + | fo:region-body/@margin-right + | fo:simple-page-master/@margin-top + | fo:simple-page-master/@margin-bottom + | fo:simple-page-master/@margin-left + | fo:simple-page-master/@margin-right"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template match="@space-before + | @space-before.minimum + | @space-before.optimum + | @space-before.maximum + | @space-after + | @space-after.minimum + | @space-after.optimum + | @space-after.maximum + | @space-start + | @space-start.minimum + | @space-start.optimum + | @space-start.maximum + | @space-end + | @space-end.minimum + | @space-end.optimum + | @space-end.maximum"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<xsl:template match="@space-before.conditionality + | @space-after.conditionality + | @space-start.conditionality + | @space-end.conditionality"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> discard retain </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@space-before.precedence + | @space-after.precedence + | @space-start.precedence + | @space-end.precedence"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> force </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<xsl:template match="@start-indent | @end-indent"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- 7.11. Relative position --> +<xsl:template match="@relative-position"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> static relative inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 7.12. Area alignment --> +<xsl:template match="@alignment-adjust"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto baseline before-edge text-before-edge middle central after-edge text-after-edge ideographic alphabetic hanging mathematical top bottom text-top text-bottom inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@alignment-baseline"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto baseline before-edge text-before-edge middle central after-edge text-after-edge ideographic alphabetic hanging mathematical top bottom text-top text-bottom inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@baseline-shift"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> baseline sub super inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="3" match="@display-align"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto before center after inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@dominant-baseline"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto use-script no-change reset-size ideographic alphabetic hanging mathematical central middle text-after-edge text-before-edge inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@relative-align"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> before baseline inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 7.13. Area dimensions --> +<xsl:template match="@block-progression-dimension + | @block-progression-dimension.minimum + | @block-progression-dimension.optimum + | @block-progression-dimension.maximum + | @inline-progression-dimension + | @inline-progression-dimension.minimum + | @inline-progression-dimension.optimum + | @inline-progression-dimension.maximum + | @height + | @width"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@max-height | @max-width"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> none inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@min-height | @min-width"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@content-height | @content-width"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto scale-to-fit inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@scaling"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> uniform non-uniform inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@scaling-method"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto integer-pixels resample-any-method inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- 7.14. Block and line-related properties --> +<xsl:template match="@hyphenation-keep"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto column page inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@hyphenation-ladder-count"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> no-limit inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@text-indent | @last-line-end-indent"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@line-height"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> normal inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@line-height.minimum + | @line-height.optimum + | @line-height.maximum"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@line-height.conditionality"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> discard retain </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@line-height.precedence"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> force </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@line-height-shift-adjustment"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> consider-shifts disregard-shifts inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@line-stacking-strategy"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> line-height font-height max-height inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@linefeed-treatment"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> ignore preserve treat-as-space treat-as-zero-width-space inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@white-space-treatment"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> ignore preserve ignore-if-before-linefeed ignore-if-after-linefeed ignore-if-surrounding-linefeed inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@text-align"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:variable name="keyword-charset" + select="'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'"/> + <xsl:variable name="token" select="normalize-space()"/> + <xsl:if test="string-length($token) != 0 and + string-length(translate($token, $keyword-charset, '')) = 0"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> start center end justify inside outside left right inherit </xsl:with-param> + </xsl:call-template> + </xsl:if> +</xsl:template> + + +<xsl:template match="@text-align-last"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> relative start center end justify inside outside left right inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@white-space-collapse"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> false true inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@wrap-option"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> no-wrap wrap inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- 7.15. Character properties --> +<xsl:template match="fo:character/@character"/> + +<xsl:template match="@letter-spacing.minimum + | @letter-spacing.optimum + | @letter-spacing.maximum + | @letter-spacing + | @word-spacing.minimum + | @word-spacing.optimum + | @word-spacing.maximum + | @word-spacing"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> normal inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@word-spacing.conditionality + | @letter-spacing.conditionality"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> discard retain </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@word-spacing.precedence + | @letter-spacing.precedence"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> force </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<xsl:template match="@suppress-at-line-break"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto suppress retain inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@text-decoration"> + <xsl:call-template name="disable-on-graphics"/> +</xsl:template> + +<xsl:template match="@text-shadow"> + <xsl:call-template name="disable-on-graphics"/> +</xsl:template> + +<xsl:template match="@text-transform"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> capitalize uppercase lowercase none inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@treat-as-word-space"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto false true inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 7.16. Color properties --> +<xsl:template match="@color"/> + +<xsl:template match="fo:color-profile/@color-profile-name" priority="5"/> + +<xsl:template match="fo:color-profile/@rendering-intent + | fo:declarations/@rendering-intent + | fo:root/@rendering-intent" priority="5"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto perceptual relative-colorimetric saturation absolute-colorimetric inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- 7.17. Float properties --> +<xsl:template match="@clear"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> start end left right both none inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@float"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> before start end left right inside outside none inherit </xsl:with-param> + </xsl:call-template> + + <xsl:if test="$strictness > 1"> + <xsl:if test=".='inside' or .='outside'"> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">Value "<xsl:value-of select="."/>" for 'float' attribute is a RenderX extension.</xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:if> +</xsl:template> + +<xsl:template match="@intrusion-displace"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto none line indent block inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 7.18. Keeps and breaks --> +<xsl:template match="@break-after | @break-before"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto column page even-page odd-page inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@keep-together + | @keep-together.within-line + | @keep-together.within-column + | @keep-together.within-page + | @keep-with-next + | @keep-with-next.within-line + | @keep-with-next.within-column + | @keep-with-next.within-page + | @keep-with-previous + | @keep-with-previous.within-line + | @keep-with-previous.within-column + | @keep-with-previous.within-page"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto always inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@orphans | @widows"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- 7.19. Layout-related properties --> +<xsl:template priority="3" match="@clip"/> + +<xsl:template priority="3" match="@overflow"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> visible hidden scroll error-if-overflow auto inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="3" match="@reference-orientation"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> 0 90 180 270 -90 -180 -270 inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="5" match="fo:simple-page-master/@reference-orientation"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> 0 90 180 270 -90 -180 -270 inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@span"> + <xsl:if test="ancestor::fo:static-content"> + <xsl:call-template name="print-error"> + <xsl:with-param name="msg">Attribute 'span' cannot be used inside '<xsl:value-of select="name(ancestor::fo:static-content[1])"/>'. </xsl:with-param> + </xsl:call-template> + </xsl:if> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> none all inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 7.20. Leader properties --> +<xsl:template match="@leader-alignment"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> none reference-area page inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@leader-pattern"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> space rule dots use-content inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@leader-pattern-width"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> use-font-metrics inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@leader-length + | @leader-length.minimum + | @leader-length.optimum + | @leader-length.maximum"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@rule-style"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> none dotted dashed solid double groove ridge inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@rule-thickness"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 7.21. Dynamic effects and hyperrefs --> +<xsl:template match="fo:multi-property-set/@active-state"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> link visited active hover focus </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@auto-restore"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> false true </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:multi-case/@case-name"/> +<xsl:template match="fo:multi-case/@case-title"/> + +<xsl:template match="fo:basic-link/@destination-placement-offset"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template match="fo:basic-link/@external-destination"> + <xsl:call-template name="check-url"/> +</xsl:template> +<xsl:template match="rx:bookmark/@external-destination" priority="5"> + <xsl:call-template name="check-url"/> +</xsl:template> + +<xsl:template match="fo:basic-link/@internal-destination"/> +<xsl:template match="rx:bookmark/@internal-destination" priority="5"/> + +<xsl:template match="rx:bookmark/@collapse-subtree" priority="5"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> true false </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:root/@rx:initial-destination"/> + +<xsl:template match="fo:basic-link/@indicate-destination"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> true false </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:basic-link/@show-destination"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> replace new </xsl:with-param> + </xsl:call-template> +</xsl:template> +<xsl:template match="rx:bookmark/@show-destination" priority="5"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> replace new </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<xsl:template match="fo:multi-case/@starting-state"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> show hide </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:multi-toggle/@switch-to"/> +<xsl:template match="fo:basic-link/@target-presentation-context"/> +<xsl:template match="fo:basic-link/@target-processing-context"/> +<xsl:template match="fo:basic-link/@target-stylesheet"/> + +<!-- 7.22. Marker properties --> +<xsl:template match="fo:marker/@marker-class-name"/> +<xsl:template match="fo:retrieve-marker/@retrieve-class-name"/> + +<xsl:template match="fo:retrieve-marker/@retrieve-position"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> first-starting-within-page first-including-carryover last-starting-within-page last-ending-within-page </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:retrieve-marker/@retrieve-boundary"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> page page-sequence document </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- 7.23. Number format properties --> +<xsl:template match="fo:page-sequence/@format | rx:ruler/@format"/> +<xsl:template match="fo:page-sequence/@grouping-separator | rx:ruler/@grouping-separator"/> + +<xsl:template match="fo:page-sequence/@grouping-size | rx:ruler/@grouping-size"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template match="fo:page-sequence/@letter-value | rx:ruler/@letter-value"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto alphabetic traditional </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 7.24. Pagination --> +<xsl:template priority="5" + match="fo:conditional-page-master-reference/@blank-or-not-blank"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> blank not-blank any </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="5" + match="fo:conditional-page-master-reference/@odd-or-even"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> even odd any </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="5" + match="fo:conditional-page-master-reference/@page-position"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> first last rest any </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="5" match="fo:region-body/@column-count"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template priority="5" match="fo:region-body/@column-gap"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template match="rx:flow-section/@column-count"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template match="rx:flow-section/@column-gap"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template priority="5" + match="fo:region-before/@extent + | fo:region-after/@extent + | fo:region-start/@extent + | fo:region-end/@extent"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template match="fo:flow/@flow-name | fo:static-content/@flow-name"/> + +<xsl:template match="fo:page-sequence/@force-page-count"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto even odd end-on-even end-on-odd no-force </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:page-sequence/@initial-page-number"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto auto-odd auto-even </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="5" + match="fo:simple-page-master/@master-name + | fo:page-sequence-master/@master-name"/> + +<xsl:template priority="5" + match="fo:page-sequence/@master-reference + | fo:single-page-master-reference/@master-reference + | fo:repeatable-page-master-reference/@master-reference + | fo:conditional-page-master-reference/@master-reference"/> + +<xsl:template priority="5" + match="fo:repeatable-page-master-reference/@maximum-repeats + | fo:repeatable-page-master-alternatives/@maximum-repeats"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> no-limit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<xsl:template match="fo:root/@media-usage"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto paginate bounded-in-one-dimension unbounded </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="5" + match="fo:simple-page-master/@page-height + | fo:simple-page-master/@page-width"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto indefinite </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="5" + match="fo:region-before/@precedence + | fo:region-after/@precedence + | fo:region-start/@precedence + | fo:region-end/@precedence"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> true false </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="5" + match="fo:region-body/@region-name + | fo:region-before/@region-name + | fo:region-after/@region-name + | fo:region-start/@region-name + | fo:region-end/@region-name"/> + +<!-- 7.25. Table properties --> +<xsl:template match="@border-after-precedence + | @border-before-precedence + | @border-end-precedence + | @border-start-precedence"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> force inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@border-collapse"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> collapse collapse-with-precedence separate inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@border-separation + | @border-separation.block-progression-direction + | @border-separation.inline-progression-direction"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<xsl:template match="@caption-side"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> before after start end top bottom left right inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:table-column/@column-number + | fo:table-cell/@column-number"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template match="fo:table-column/@column-width"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template match="@empty-cells"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> show hide inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:table-cell/@ends-row + | fo:table-cell/@starts-row"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> true false </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:table-column/@number-columns-repeated"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template match="fo:table-column/@number-columns-spanned + | fo:table-cell/@number-columns-spanned"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template match="fo:table-cell/@number-rows-spanned"> + <xsl:call-template name="quantitative-values"/> +</xsl:template> + +<xsl:template match="@table-layout"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto fixed inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:table/@table-omit-footer-at-break + | fo:table/@table-omit-header-at-break + | fo:table/@rx:table-omit-initial-header + | fo:table/@rx:table-omit-final-footer"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> true false </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- 7.26. Writing mode --> +<xsl:template match="@direction"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> ltr rtl inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@glyph-orientation-horizontal"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@glyph-orientation-vertical"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@text-altitude | @text-depth"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> use-font-metrics inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<xsl:template match="@unicode-bidi"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> normal embed bidi-override inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="3" match="@writing-mode"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> lr-tb rl-tb tb-rl tb-lr lr-alternating-rl-tb lr-inverting-rl-tb lr-bt rl-bt bt-rl bt-lr lr-alternating-rl-bt lr-inverting-rl-bt tb-lr-in-lr-pairs lr rl tb inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="5" match="fo:simple-page-master/@writing-mode"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> lr-tb rl-tb tb-rl tb-lr lr-alternating-rl-tb lr-inverting-rl-tb lr-bt rl-bt bt-rl bt-lr lr-alternating-rl-bt lr-inverting-rl-bt tb-lr-in-lr-pairs lr rl tb inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- 7.27. Miscellaneous properties --> +<xsl:template match="fo:external-graphic/@content-type + | fo:instream-foreign-object/@content-type + | rx:background-content-type" + priority="3"> + <xsl:variable name="val" select="normalize-space()"/> + <xsl:choose> + <xsl:when test="$val = 'auto'"/> + <xsl:when test="starts-with($val, 'content-type:')"/> + <xsl:when test="starts-with($val, 'namespace:')"/> + <xsl:otherwise> + <xsl:call-template name="print-warning"> + <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot have a value of "<xsl:value-of select="."/>": if not 'auto', it should be prefixed by either 'namespace:' or 'content-type:'.</xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + + +<xsl:template match="@id"/> +<xsl:template match="fo:page-number-citation/@ref-id"/> +<xsl:template match="rx:page-number-citation-last/@ref-id"/> +<xsl:template match="rx:end-index-range/@ref-id"/> + +<xsl:template match="@provisional-label-separation + | @provisional-distance-between-starts"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@score-spaces"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> true false inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="fo:external-graphic/@src"> + <xsl:call-template name="check-url"/> +</xsl:template> + + +<xsl:template priority="5" match="fo:color-profile/@src"> + <xsl:call-template name="check-url"/> +</xsl:template> + +<xsl:template match="@visibility"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> visible hidden collapse inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@z-index"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + + +<!-- 7.28. Shorthands --> +<xsl:template priority="3" match="@background"/> +<xsl:template priority="3" match="@background-position"/> +<xsl:template priority="3" match="@border"/> +<xsl:template priority="3" + match="@border-top + | @border-bottom + | @border-left + | @border-right"/> +<xsl:template priority="3" match="@border-color"/> +<xsl:template priority="3" match="@border-style"/> +<xsl:template match="@border-spacing"/> +<xsl:template priority="3" match="@border-width"/> +<xsl:template match="@cue"/> +<xsl:template match="@font"> + <xsl:call-template name="disable-on-graphics"/> +</xsl:template> +<xsl:template match="@margin"/> +<xsl:template priority="5" + match="fo:simple-page-master/@margin + | fo:region-body/@margin"/> + +<xsl:template priority="3" match="@padding"/> + +<xsl:template match="@page-break-after | @page-break-before"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto always avoid left right inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@page-break-inside"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> auto avoid inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@pause"/> + +<xsl:template match="@position"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> static relative absolute fixed inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template priority="5" + match="fo:simple-page-master/@size"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto landscape portrait </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@vertical-align"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> baseline middle sub super text-top text-bottom top bottom inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@white-space"> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> normal pre nowrap inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@xml:lang"> + <xsl:call-template name="disable-on-graphics"/> +</xsl:template> + + +<!-- RenderX extensions --> + +<xsl:template match="@rx:background-content-width + | @rx:background-content-height" + priority="3"> + <xsl:call-template name="quantitative-values"> + <xsl:with-param name="valuelist"> auto scale-to-fit inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@rx:background-scaling" priority="3"> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> uniform non-uniform inherit </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="rx:meta-field/@name" priority="5"/> +<xsl:template match="rx:meta-field/@value" priority="5"/> + +<xsl:template match="@rx:key | rx:begin-index-range/@key"/> + +<xsl:template match="rx:pinpoint/@value"/> + +<xsl:template match="rx:page-index/@ref-key | rx:index-item/@ref-key"/> + +<xsl:template match="@rx:list-separator | rx:page-index/@list-separator"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> +</xsl:template> + +<xsl:template match="@rx:range-separator | rx:page-index/@range-separator | rx:index-item/@range-separator"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> +</xsl:template> + +<xsl:template match="@rx:merge-subsequent-page-numbers | rx:page-index/@merge-subsequent-page-numbers | rx:index-item/@merge-subsequent-page-numbers"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> false true </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="@rx:link-back | rx:page-index/@link-back | rx:index-item/@link-back"> + <xsl:call-template name="disable-on-atomic-inlines"/> + <xsl:call-template name="disable-on-graphics"/> + <xsl:call-template name="enumerated-values"> + <xsl:with-param name="valuelist"> false true </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- =================================== --> +<!-- Print an error message --> + +<xsl:template name="print-error"> + <xsl:param name="msg"/> + <xsl:message>[error] <xsl:value-of select="normalize-space($msg)"/></xsl:message> +</xsl:template> + +<!-- =================================== --> +<!-- Print a warning message --> + +<xsl:template name="print-warning"> + <xsl:param name="msg"/> + <xsl:message>[warning] <xsl:value-of select="normalize-space($msg)"/></xsl:message> +</xsl:template> + +</xsl:stylesheet> + diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/valid/main.rng b/sandbox/paultremblay/python_interface/docutilsToFo/valid/main.rng new file mode 100644 index 000000000..a1db914e1 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/valid/main.rng @@ -0,0 +1,474 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ========================================================= + + (c) 2004, RenderX + + Author: Alexander Peshkov <peshkov@renderx.com> + + Permission is granted to use this document, copy and + modify free of charge, provided that every derived work + bear a reference to the present document. + + This document contains a computer program written in + XSL Transformations Language. It is published with no + warranty of any kind about its usability, as a mere + example of XSL technology. RenderX shall not be + considered liable for any damage or loss of data caused + by use of this program. + + ========================================================= +--> +<grammar xmlns:rx="http://www.renderx.com/XSL/Extensions" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns="http://relaxng.org/ns/structure/1.0"> + <include href="elements.rng"/> + <start> + <ref name="root"/> + </start> + <!-- + **************************************************************************************** + Element structure for top-level elements + **************************************************************************************** + =============================================================== + Root element. Contains everything, generates nothing. It has an + id, a FO namespace prefix declaration, and other namespace + declarations if used. + =============================================================== + --> + <define name="root"> + <element name="fo:root"> + <ref name="root.attlist"/> + <ref name="root.content"/> + </element> + </define> + <define name="root.content"> + <optional> + <ref name="meta-info"/> + </optional> + <ref name="layout-master-set"/> + <optional> + <ref name="declarations"/> + </optional> + <optional> + <ref name="outline"/> + </optional> + <oneOrMore> + <ref name="page-sequence"/> + </oneOrMore> + </define> + <!-- + =============================================================== + Document meta information - RenderX extension + =============================================================== + --> + <define name="meta-info"> + <element name="rx:meta-info"> + <ref name="meta-info.attlist"/> + <ref name="meta-info.content"/> + </element> + </define> + <define name="meta-info.content"> + <oneOrMore> + <ref name="meta-field"/> + </oneOrMore> + </define> + <define name="meta-field"> + <element name="rx:meta-field"> + <ref name="meta-field.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + Color profile declarations + =============================================================== + --> + <define name="declarations"> + <element name="fo:declarations"> + <ref name="declarations.attlist"/> + <ref name="declarations.content"/> + </element> + </define> + <define name="declarations.content"> + <oneOrMore> + <ref name="color-profile"/> + </oneOrMore> + </define> + <define name="color-profile"> + <element name="fo:color-profile"> + <ref name="color-profile.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + Bookmarks - RenderX extension + =============================================================== + --> + <define name="outline"> + <element name="rx:outline"> + <ref name="outline.attlist"/> + <ref name="outline.content"/> + </element> + </define> + <define name="outline.content"> + <oneOrMore> + <ref name="bookmark"/> + </oneOrMore> + </define> + <define name="bookmark"> + <element name="rx:bookmark"> + <ref name="bookmark.attlist"/> + <ref name="bookmark.content"/> + </element> + </define> + <define name="bookmark.content"> + <ref name="bookmark-label"/> + <zeroOrMore> + <ref name="bookmark"/> + </zeroOrMore> + </define> + <define name="bookmark-label"> + <element name="rx:bookmark-label"> + <ref name="bookmark-label.attlist"/> + <ref name="bookmark-label.content"/> + </element> + </define> + <define name="bookmark-label.content"> + <text/> + </define> + <!-- + =============================================================== + Layout-master-set. Contains a set of page-masters. + Content model made more strict than in the spec, to enforce + that a page-sequence-master be always accompanied by at least + one simple-page-master. + =============================================================== + --> + <define name="layout-master-set"> + <element name="fo:layout-master-set"> + <ref name="layout-master-set.attlist"/> + <ref name="layout-master-set.content"/> + </element> + </define> + <define name="layout-master-set.content"> + <interleave> + <zeroOrMore> + <ref name="page-sequence-master"/> + </zeroOrMore> + <oneOrMore> + <ref name="simple-page-master"/> + </oneOrMore> + </interleave> + </define> + <!-- + =============================================================== + Page sequence master + =============================================================== + --> + <define name="page-sequence-master"> + <element name="fo:page-sequence-master"> + <ref name="page-sequence-master.attlist"/> + <ref name="page-sequence-master.content"/> + </element> + </define> + <define name="page-sequence-master.content"> + <oneOrMore> + <choice> + <ref name="single-page-master-reference"/> + <ref name="repeatable-page-master-reference"/> + <ref name="repeatable-page-master-alternatives"/> + </choice> + </oneOrMore> + </define> + <!-- + =============================================================== + Sequence specifiers are predefined sequences of page masters + that are used by page sequence master to construct a desired + page collection. + =============================================================== + --> + <define name="single-page-master-reference"> + <element name="fo:single-page-master-reference"> + <ref name="single-page-master-reference.attlist"/> + <empty/> + </element> + </define> + <define name="repeatable-page-master-reference"> + <element name="fo:repeatable-page-master-reference"> + <ref name="repeatable-page-master-reference.attlist"/> + <empty/> + </element> + </define> + <define name="repeatable-page-master-alternatives"> + <element name="fo:repeatable-page-master-alternatives"> + <ref name="repeatable-page-master-alternatives.attlist"/> + <ref name="repeatable-page-master-alternatives.content"/> + </element> + </define> + <define name="repeatable-page-master-alternatives.content"> + <oneOrMore> + <ref name="conditional-page-master-reference"/> + </oneOrMore> + </define> + <define name="conditional-page-master-reference"> + <element name="fo:conditional-page-master-reference"> + <ref name="conditional-page-master-reference.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + Simple page master defines a page layout. It does not + explicitly generate any content. + =============================================================== + --> + <define name="simple-page-master"> + <element name="fo:simple-page-master"> + <ref name="simple-page-master.attlist"/> + <ref name="simple-page-master.content"/> + </element> + </define> + <define name="simple-page-master.content"> + <ref name="region-body"/> + <optional> + <ref name="region-before"/> + </optional> + <optional> + <ref name="region-after"/> + </optional> + <optional> + <ref name="region-start"/> + </optional> + <optional> + <ref name="region-end"/> + </optional> + </define> + <!-- + =============================================================== + Regions. The page instance is divided into subareas, whose + properties are described by the five region-* elements. These + elements by themselves do not generate any content. + =============================================================== + --> + <!-- + =============================================================== + Body region: middle of the page. + =============================================================== + --> + <define name="region-body"> + <element name="fo:region-body"> + <ref name="region-body.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + Side regions: page edges. + =============================================================== + --> + <define name="region-before"> + <element name="fo:region-before"> + <ref name="region-before.attlist"/> + <empty/> + </element> + </define> + <define name="region-after"> + <element name="fo:region-after"> + <ref name="region-after.attlist"/> + <empty/> + </element> + </define> + <define name="region-start"> + <element name="fo:region-start"> + <ref name="region-start.attlist"/> + <empty/> + </element> + </define> + <define name="region-end"> + <element name="fo:region-end"> + <ref name="region-end.attlist"/> + <empty/> + </element> + </define> + <!-- + =============================================================== + Page sequence defines the order of choosing page masters to + accomodate all the contents generated by its fo:flow and + fo:static-content children, and the way of numbering them. + =============================================================== + --> + <define name="page-sequence"> + <element name="fo:page-sequence"> + <ref name="page-sequence.attlist"/> + <ref name="page-sequence.content"/> + </element> + </define> + <define name="page-sequence.content"> + <optional> + <ref name="title"/> + </optional> + <zeroOrMore> + <ref name="static-content"/> + </zeroOrMore> + <ref name="flow"/> + </define> + <!-- + =============================================================== + Title. May not contain out-of-lines. + =============================================================== + MEMO: Spec states: + XSL> Additionally, an fo:title is not permitted to have as a descendant an fo:block-container + XSL> that generates an absolutely positioned area. + We prohibit block-level descendants except for those descendats of fo:inline-container. + This content model shared by fo:leader and fo:inline child of an fo:footnote. + --> + <define name="title"> + <element name="fo:title"> + <ref name="title.attlist"/> + <ref name="title.content"/> + </element> + </define> + <define name="title.content"> + <zeroOrMore> + <ref name="inlines-inline"/> + </zeroOrMore> + </define> + <!-- + =============================================================== + Flows. They are just sequences of blocks. 'flow-name' feature + defines linkage of the flow to a region in the page master. + =============================================================== + =============================================================== + An extension element, rx:flow-section, has been added in order + to overcome limitations on multicolumn layout imposed by XSL FO + =============================================================== + NOTE: We use tricks with nested grammar in order control marker/retrieve-marker + and outlines appearance inside fo:static-content and fo:flow + MEMO: We forcedly prohibit side-floats as descendants of ablsoutely positioned + block-containers. This problem appears due to the 'half-outline' behavior of + an absolute-container - it cannot contain outlines except for side-float and it cannot + be nested into any other outlines. + NOTE: 'Folint' prohibits use of side-floats in static-content that is against the spec. + --> + <define name="static-content"> + <element name="fo:static-content"> + <ref name="static-content.attlist"/> + <ref name="static-content.content"/> + </element> + </define> + <define name="static-content.content"> + <grammar> + <start> + <oneOrMore> + <ref name="blocks"/> + </oneOrMore> + </start> + <include href="elements.rng"> + <define name="retrieve-marker"> + <ref name="retrieve-marker-real"/> + </define> + <define name="absolute-container"> + <ref name="absolute-container-real"/> + </define> + <define name="absolute-container.content"> + <parentRef name="absolute-container.content"/> + </define> + <define name="side-float"> + <ref name="side-float-real"/> + </define> + <define name="float.content"> + <parentRef name="float.content"/> + </define> + <define name="leader.content"> + <parentRef name="leader.content"/> + </define> + </include> + </grammar> + </define> + <define name="flow"> + <element name="fo:flow"> + <ref name="flow.attlist"/> + <ref name="flow.content"/> + </element> + </define> + <define name="flow.content"> + <grammar> + <start> + <zeroOrMore> + <ref name="marker"/> + </zeroOrMore> + <oneOrMore> + <choice> + <ref name="blocks"/> + <ref name="flow-section"/> + </choice> + </oneOrMore> + </start> + <include href="elements.rng"> + <define name="absolute-container"> + <ref name="absolute-container-real"/> + </define> + <!-- + MEMO: We have two options here: + * use parent content model which is too strict (side-floats descendants not allowed); + * use current content model which is too loose (all outline descendants are allowed). + We prefer stricter mode. + --> + <define name="absolute-container.content"> + <parentRef name="absolute-container.content"/> + </define> + <define name="marker"> + <ref name="marker-real"/> + </define> + <define name="marker.content"> + <parentRef name="marker.content"/> + </define> + <define name="side-float"> + <ref name="side-float-real"/> + </define> + <define name="before-float"> + <ref name="before-float-real"/> + </define> + <define name="float.content"> + <parentRef name="float.content"/> + </define> + <define name="footnote"> + <ref name="footnote-real"/> + </define> + <define name="footnote.content"> + <parentRef name="footnote.content"/> + </define> + <!-- NOTE: fo:leader can't have outlines and marker descendants --> + <define name="leader.content"> + <parentRef name="leader.content"/> + </define> + </include> + <!-- Extension element. Acts like a top-level block with multiple columns. --> + <define name="flow-section"> + <element name="rx:flow-section"> + <ref name="flow-section.attlist"/> + <ref name="flow-section.content"/> + </element> + </define> + <define name="flow-section.content"> + <oneOrMore> + <ref name="blocks"/> + </oneOrMore> + </define> + </grammar> + </define> +</grammar> +<!-- + MEMO: Spec prohibits use of fo:leader as a descendant of itself. + We find this constraint somewhat abusive so we do not enforce it. + 'Folint' also does not controll this constraint + However following trick can be used to prevent fo:leader to appear as it's own child. + (to make it work we have to set leader.content to be notAllowed and move + actual content into leader.content-real in elements.rnc) + leader.content |= grammar { + start = leader.content-real + include "elements.rnc" { + leader = notAllowed + } + } +--> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/valid/properties.rng b/sandbox/paultremblay/python_interface/docutilsToFo/valid/properties.rng new file mode 100644 index 000000000..847107996 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/valid/properties.rng @@ -0,0 +1,991 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ========================================================= + + (c) 2004, RenderX + + Author: Alexander Peshkov <peshkov@renderx.com> + + Permission is granted to use this document, copy and + modify free of charge, provided that every derived work + bear a reference to the present document. + + This document contains a computer program written in + XSL Transformations Language. It is published with no + warranty of any kind about its usability, as a mere + example of XSL technology. RenderX shall not be + considered liable for any damage or loss of data caused + by use of this program. + + ========================================================= +--> +<grammar xmlns="http://relaxng.org/ns/structure/1.0"> + <include href="properties_groups.rng"/> + <!-- + **************************************************************************************** + Properties used by top-level elements + **************************************************************************************** + =============================================================== + Root element can bear inheritable properties, passed further to + fo:flows/fo:static-contents. Inheritable properties from fo:layout-master-set + are banned in this version of schema. + =============================================================== + --> + <define name="root.attlist"> + <optional> + <ref name="media-usage.attr"/> + </optional> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Document meta information - RenderX extension + =============================================================== + --> + <define name="meta-info.attlist"> + <empty/> + </define> + <define name="meta-field.attlist"> + <ref name="name.attr"/> + <ref name="value.attr"/> + </define> + <!-- + =============================================================== + Color profile declarations + =============================================================== + --> + <define name="declarations.attlist"> + <empty/> + </define> + <define name="color-profile.attlist"> + <ref name="src.attr"/> + <ref name="color-profile-name.attr"/> + <optional> + <ref name="rendering-intent.attr"/> + </optional> + </define> + <!-- + =============================================================== + Bookmarks - RenderX extension + =============================================================== + --> + <define name="outline.attlist"> + <empty/> + </define> + <define name="bookmark.attlist"> + <choice> + <ref name="internal-destination.attr"/> + <ref name="external-destination.attr"/> + </choice> + <optional> + <ref name="collapse-subtree.attr"/> + </optional> + </define> + <define name="bookmark-label.attlist"> + <empty/> + </define> + <!-- + =============================================================== + Layout-master-set contains a set of page-masters. Neither of + its descendants generates any area, so no inherited elements + can be specified on it or on its children. + =============================================================== + --> + <define name="layout-master-set.attlist"> + <empty/> + </define> + <!-- + =============================================================== + Page sequence master + =============================================================== + --> + <define name="page-sequence-master.attlist"> + <ref name="master-name.attr"/> + </define> + <!-- + =============================================================== + Sequence specifiers. + =============================================================== + --> + <define name="single-page-master-reference.attlist"> + <ref name="master-reference.attr"/> + </define> + <define name="repeatable-page-master-reference.attlist"> + <ref name="master-reference.attr"/> + <optional> + <ref name="maximum-repeats.attr"/> + </optional> + </define> + <define name="repeatable-page-master-alternatives.attlist"> + <optional> + <ref name="maximum-repeats.attr"/> + </optional> + </define> + <define name="conditional-page-master-reference.attlist"> + <ref name="master-reference.attr"/> + <optional> + <ref name="page-position.attr"/> + </optional> + <optional> + <ref name="odd-or-even.attr"/> + </optional> + <optional> + <ref name="blank-or-not-blank.attr"/> + </optional> + </define> + <!-- + =============================================================== + Simple page master defines a page layout. It does not + explicitly generate any content. Most of its properties are + local except for writing-mode and reference-orientation that + are inherited by the underlying region-* objects. + =============================================================== + NOTE. We could think about a common background/padding/border + for every page instance generated by the page master. For such + a scope, we may add borders/padding/background to its features. + However, in the current version this is ruled out explicitly by the XSL specs. + --> + <define name="simple-page-master.attlist"> + <ref name="margin-properties-CSS"/> + <ref name="master-name.attr"/> + <optional> + <ref name="page-height.attr"/> + </optional> + <optional> + <ref name="page-width.attr"/> + </optional> + <optional> + <ref name="reference-orientation.attr"/> + </optional> + <optional> + <ref name="size.attr"/> + </optional> + <optional> + <ref name="writing-mode.attr"/> + </optional> + </define> + <!-- + =============================================================== + Region elements by themselves do not generate any content. + Reference-orientation and writing-mode may be inherited from + the page master; all other features are local. + =============================================================== + --> + <define name="region-properties"> + <ref name="border-padding-background-properties"/> + <ref name="area-properties"/> + <optional> + <ref name="region-name.attr"/> + </optional> + </define> + <!-- + =============================================================== + Body region: middle of the page. Unlike side regions, this one + may have multiple columns. + =============================================================== + NOTE: We have restricted margin properties to be margin-only, + allowing no spaces. This is done because no clear semantics + can be ascribed to single components of a space vector. + --> + <define name="region-body.attlist"> + <ref name="region-properties"/> + <ref name="margin-properties-CSS"/> + <optional> + <ref name="column-count.attr"/> + </optional> + <optional> + <ref name="column-gap.attr"/> + </optional> + </define> + <!-- + =============================================================== + Side regions: page edges. These regions have extent and + precedence that is used to arbitrate corner conflicts. Side + regions are viewed as frames, and may not have margins. + =============================================================== + NOTE: Extent made obligatory: its default value of 0.0pt does not + make much sense. + --> + <define name="region-before.attlist"> + <ref name="region-properties"/> + <ref name="extent.attr"/> + <optional> + <ref name="precedence.attr"/> + </optional> + </define> + <define name="region-after.attlist"> + <ref name="region-properties"/> + <ref name="extent.attr"/> + <optional> + <ref name="precedence.attr"/> + </optional> + </define> + <define name="region-start.attlist"> + <ref name="region-properties"/> + <ref name="extent.attr"/> + </define> + <define name="region-end.attlist"> + <ref name="region-properties"/> + <ref name="extent.attr"/> + </define> + <!-- + =============================================================== + Page sequence. + =============================================================== + --> + <define name="page-sequence.attlist"> + <optional> + <ref name="format.attr"/> + </optional> + <optional> + <ref name="letter-value.attr"/> + </optional> + <optional> + <ref name="grouping-separator.attr"/> + </optional> + <optional> + <ref name="grouping-size.attr"/> + </optional> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <optional> + <ref name="initial-page-number.attr"/> + </optional> + <optional> + <ref name="force-page-count.attr"/> + </optional> + <ref name="master-reference.attr"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Title + =============================================================== + MEMO: Why 'id' attribute is not allowed here? + MEMO: Does it makes sence to add relative-position here? + According to Section 7.12.1. "relative-position" it is allowed everywhere except fo:block-container + Should we allow all inline properties here?? + --> + <define name="title.attlist"> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="border-padding-background-properties"/> + <ref name="margin-properties-inline"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Flows. 'flow-name' feature defines linkage of the flow to a region in the page master. + =============================================================== + --> + <define name="flow-properties"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="flow-name.attr"/> + <ref name="inheritable-properties"/> + </define> + <define name="flow.attlist"> + <ref name="flow-properties"/> + </define> + <define name="static-content.attlist"> + <ref name="flow-properties"/> + </define> + <!-- + =============================================================== + An extension element, rx:flow-section. + Acts like a top-level block with multiple columns. + =============================================================== + --> + <define name="flow-section.attlist"> + <optional> + <ref name="column-count.attr"/> + </optional> + <optional> + <ref name="column-gap.attr"/> + </optional> + <ref name="border-padding-background-properties"/> + <ref name="margin-properties-block"/> + <ref name="inheritable-properties"/> + </define> + <!-- + **************************************************************************************** + Properties used by content-bearing elements + **************************************************************************************** + --> + <!-- + =============================================================== + Properties of block formatting objects. + =============================================================== + =============================================================== + Besides properties used to format the block itself, it also conveys + formatting information to its inline-level children. + =============================================================== + --> + <define name="block.attlist"> + <ref name="block-properties"/> + <ref name="character-properties-unheritable"/> + <optional> + <ref name="text-altitude.attr"/> + </optional> + <optional> + <ref name="text-depth.attr"/> + </optional> + </define> + <!-- + =============================================================== + Block container + =============================================================== + --> + <!-- + MEMO: We are forced to create separate element 'absolute-container' in order + to satisfy XSL FO spec requirements. + --> + <define name="absolute-container.attlist"> + <ref name="absolute-position-properties"/> + <ref name="area-properties-unheritable"/> + <ref name="box-size-properties"/> + <ref name="common-block-properties"/> + <optional> + <ref name="z-index.attr"/> + </optional> + </define> + <!-- + 'Usual' container element + MEMO: XSLFO spec prohibits use of 'relative-position' for fo:block-container, + but we believe that it should be allowed for non-absolutely positioned containers. + --> + <define name="block-container.attlist"> + <ref name="area-properties-unheritable"/> + <ref name="box-size-properties"/> + <ref name="block-properties"/> + <optional> + <ref name="container-position.attr"/> + </optional> + <optional> + <ref name="z-index.attr"/> + </optional> + </define> + <!-- + =============================================================== + Properties of inline formatting objects. + =============================================================== + =============================================================== + Unicode bidi-override + =============================================================== + MEMO: This element is 'half-inline' accroding to spec, since it's exhibits the same + bahavior and used in the same context but yet cannot carry some of inline-level + properties such as margins and border. + We use the same set of properties as for inline here (except for unicode-bidi and + width properties) since we believe that this is a typical inline element. + Moreover fo:bidi-override is redundant from semantic point of view since it do not + carry any additional information compared to regular fo:inline - just add + 'unicode-bidi' to fo:inline and you do not need fo:bidi-override anymore. + --> + <define name="bidi-override.attlist"> + <ref name="inline-properties"/> + <optional> + <ref name="unicode-bidi.attr"/> + </optional> + </define> + <!-- + MEMO: 'Folint' believes that direction property is required for fo:bidi-override, + but this is against the spec since this property can be inherited. + --> + <!-- + =============================================================== + Single character + =============================================================== + --> + <define name="character.attlist"> + <ref name="character.attr"/> + <optional> + <ref name="suppress-at-line-break.attr"/> + </optional> + <optional> + <ref name="treat-as-word-space.attr"/> + </optional> + <ref name="common-inline-properties"/> + </define> + <!-- + =============================================================== + Initial property set specifies properties for one or more lines + =============================================================== + MEMO: Spec is contradictory here. It states that use of this object is equivalent to + the fo:wrapper around the first line. At the same time spec allows on this element + such properties as 'Common Border, Padding, and Background Properties' + - fo:wrapper can't have border/padding/etc and can bear inheritable properties only. + We believe that this element should be treated as inline and thus should have + appropriate properties set. + --> + <define name="initial-property-set.attlist"> + <ref name="common-inline-properties"/> + </define> + <!-- + =============================================================== + External graphic + =============================================================== + --> + <define name="external-graphic.attlist"> + <ref name="graphic-properties"/> + <optional> + <ref name="src.attr"/> + </optional> + </define> + <!-- + =============================================================== + In-stream graphic + =============================================================== + --> + <define name="instream-foreign-object.attlist"> + <ref name="graphic-properties"/> + </define> + <!-- + =============================================================== + Inline + =============================================================== + --> + <define name="inline.attlist"> + <ref name="height-properties"/> + <ref name="inline-properties"/> + </define> + <!-- + =============================================================== + Inline container + =============================================================== + FIXME! We believe that this element should not bear not-inheritable properties, + which applies to text since it can't have text children. + Therefor we do not use 'common-inline-properties' set. + --> + <define name="inline-container.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="area-alignment-properties"/> + <ref name="border-padding-background-properties"/> + <ref name="keeps-properties-atomic"/> + <ref name="margin-properties-inline"/> + <ref name="relative-position-properties"/> + <ref name="area-properties-unheritable"/> + <ref name="box-size-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Leader + =============================================================== + --> + <define name="leader.attlist"> + <ref name="inline-properties"/> + </define> + <!-- + MEMO: Note that 'inline-properties' includes block-level inheritable properties. + But it's OK in our content-model since it allows block-level descendants wrapped + into fo:inline-container. + At the same time block-level inheritable properties includes leader properties, + since they are inheritable... + --> + <!-- + =============================================================== + Page Number + =============================================================== + --> + <define name="page-number.attlist"> + <ref name="common-inline-properties"/> + <optional> + <ref name="wrap-option.attr"/> + </optional> + </define> + <!-- + =============================================================== + Page number citation + =============================================================== + --> + <define name="page-number-citation.attlist"> + <ref name="common-inline-properties"/> + <optional> + <ref name="wrap-option.attr"/> + </optional> + <ref name="ref-id.attr"/> + </define> + <!-- + =============================================================== + Atomic elements for index ranges markup + =============================================================== + --> + <define name="begin-index-range.attlist"> + <ref name="id.attr"/> + <ref name="rx-key.attr"/> + </define> + <define name="end-index-range.attlist"> + <ref name="ref-id.attr"/> + </define> + <!-- + =============================================================== + Page number list - index entry + =============================================================== + --> + <define name="page-index.attlist"> + <ref name="common-inline-properties"/> + <optional> + <ref name="wrap-option.attr"/> + </optional> + <optional> + <ref name="list-separator.attr"/> + </optional> + <optional> + <ref name="ref-key.attr"/> + </optional> + </define> + <!-- + MEMO: There is no 'ref-key' attribute on page-index now, but it is allowed for + backward compatibility. + MEMO: Actually it makes sense to exclude id/rx:key fom the set of availabe properties + for 'index-item', however we prefer no to do it just to avoid creation of yet another content + model (attribute set) for thid inline element. + --> + <define name="index-item.attlist"> + <ref name="common-inline-properties"/> + <optional> + <ref name="wrap-option.attr"/> + </optional> + <ref name="ref-key.attr"/> + <optional> + <ref name="link-back.attr"/> + </optional> + <optional> + <ref name="range-separator.attr"/> + </optional> + <optional> + <ref name="merge-subsequent-page-numbers.attr"/> + </optional> + </define> + <!-- + =============================================================== + Properties of table formatting objects. + =============================================================== + =============================================================== + Table & Caption. + =============================================================== + --> + <define name="table-and-caption.attlist"> + <ref name="common-block-properties"/> + <optional> + <ref name="clear.attr"/> + </optional> + <ref name="relative-position-properties"/> + <ref name="keeps-and-breaks-properties-atomic"/> + </define> + <!-- + MEMO: Spec do not allows margins on fo:table-caption that is against common sence + since this is a typical container. + We do allow margins (they are included in common-block-properties). + 'Folint' does the same. + --> + <define name="table-caption.attlist"> + <optional> + <ref name="clear.attr"/> + </optional> + <ref name="common-block-properties"/> + <ref name="relative-position-properties"/> + <ref name="box-size-properties"/> + </define> + <define name="table.attlist"> + <optional> + <ref name="clear.attr"/> + </optional> + <ref name="common-block-properties"/> + <ref name="box-size-properties"/> + <ref name="keeps-and-breaks-properties-atomic"/> + <ref name="table-properties-unheritable"/> + </define> + <!-- + =============================================================== + Table column specifies common properties to ascribe to all + cells in a column *or a group of columns*. Note that, if both + 'number-columns-repeated' and 'number-columns-spanned' exceed + 1, the column counter is increased by 'number-columns-spanned'. + it means that you only set properties for columns: + 'column-number' + 'column-number' + 'number-columns-spanned' + 'column-number' + 2 * 'number-columns-spanned' + and so on, leaving default properties for intermediate columns. + =============================================================== + --> + <define name="table-column.attlist"> + <optional> + <ref name="column-number.attr"/> + </optional> + <optional> + <ref name="column-width.attr"/> + </optional> + <optional> + <ref name="number-columns-repeated.attr"/> + </optional> + <optional> + <ref name="number-columns-spanned.attr"/> + </optional> + <ref name="background-properties"/> + <!-- + MEMO: Border properties applies to this formatting object only if the value of border-collapse + for the table is "collapse" or "collapse-with-precedence" + --> + <ref name="border-properties"/> + <ref name="border-precedence-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Table header, table footer, and table body. + =============================================================== + --> + <define name="row-group.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="background-properties"/> + <!-- + MEMO: Border properties applies to this formatting object only if the value of border-collapse + for the table is "collapse" or "collapse-with-precedence" + --> + <ref name="border-properties"/> + <ref name="border-precedence-properties"/> + <ref name="relative-position-properties"/> + <ref name="inheritable-properties"/> + </define> + <define name="table-header.attlist"> + <ref name="row-group.attlist"/> + </define> + <define name="table-footer.attlist"> + <ref name="row-group.attlist"/> + </define> + <!-- + MEMO: Spec do not list "Keep" properties almong applicable to fo:table-body that is a clear + case of errata. + --> + <define name="table-body.attlist"> + <ref name="row-group.attlist"/> + <ref name="keeps-and-breaks-properties-atomic"/> + </define> + <!-- + =============================================================== + Table row. + =============================================================== + MEMO: Should we create separate collection of properties in 'properties_groups.rnc' + based on row-group.attlist? + --> + <define name="table-row.attlist"> + <ref name="row-group.attlist"/> + <ref name="height-properties"/> + <ref name="keeps-and-breaks-properties-atomic"/> + </define> + <!-- + =============================================================== + Table cell. + =============================================================== + MEMO: Spec do not allows margins on fo:table-cell but 'Folint' does. + We excluded margins from this element and therefor don't use 'common-block-properties' + MEMO: Spec do not list "Keep" properties almong applicable to fo:table-cell that is a clear + case of errata. + --> + <define name="table-cell.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <optional> + <ref name="column-number.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="border-padding-background-properties"/> + <ref name="border-precedence-properties"/> + <ref name="box-size-properties"/> + <optional> + <ref name="ends-row.attr"/> + </optional> + <ref name="keeps-and-breaks-properties-atomic"/> + <optional> + <ref name="number-columns-spanned.attr"/> + </optional> + <optional> + <ref name="number-rows-spanned.attr"/> + </optional> + <optional> + <ref name="starts-row.attr"/> + </optional> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Properties of list formatting objects. + =============================================================== + =============================================================== + List block. + =============================================================== + --> + <define name="list-block.attlist"> + <optional> + <ref name="clear.attr"/> + </optional> + <ref name="common-block-properties"/> + <ref name="keeps-and-breaks-properties-atomic"/> + <ref name="relative-position-properties"/> + </define> + <!-- + =============================================================== + List item. + =============================================================== + --> + <define name="list-item.attlist"> + <ref name="common-block-properties"/> + <ref name="keeps-and-breaks-properties-atomic"/> + <ref name="relative-position-properties"/> + </define> + <!-- + =============================================================== + List item label and list item body + =============================================================== + --> + <define name="list-item-label.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <define name="list-item-body.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Floats and footnotes. + =============================================================== + MEMO: Outlines can't have id and therefor can't have rx:key properties so we are strict here. + 'Folint' is loose here - it allows use of these properties. + MEMO: We are forced to create two types of floats: side-floats and before-floats. + --> + <define name="side-float.attlist"> + <optional> + <ref name="side-float.attr"/> + </optional> + <optional> + <ref name="clear.attr"/> + </optional> + <ref name="inheritable-properties"/> + </define> + <!-- NOTE: before-float can't bear 'clear' property --> + <define name="before-float.attlist"> + <optional> + <ref name="before-float.attr"/> + </optional> + <ref name="inheritable-properties"/> + </define> + <define name="footnote.attlist"> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <define name="footnote-body.attlist"> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Simple link. + =============================================================== + --> + <define name="basic-link.attlist"> + <ref name="inline-properties"/> + <optional> + <ref name="external-destination.attr"/> + </optional> + <optional> + <ref name="internal-destination.attr"/> + </optional> + <optional> + <ref name="indicate-destination.attr"/> + </optional> + <optional> + <ref name="show-destination.attr"/> + </optional> + <optional> + <ref name="destination-placement-offset.attr"/> + </optional> + <optional> + <ref name="target-processing-context.attr"/> + </optional> + <optional> + <ref name="target-presentation-context.attr"/> + </optional> + <optional> + <ref name="target-stylesheet.attr"/> + </optional> + </define> + <!-- + =============================================================== + Wrappers. + =============================================================== + --> + <define name="wrapper.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Marker. This element may embrace any content but cannot pass + properties to its children; so, it may not have features other + than marker-class-name. + =============================================================== + MEMO: We are more strict here making marker-class-name attribute a mandatory, + but marker with no marker-class-name is meaningless. + --> + <define name="marker.attlist"> + <ref name="marker-class-name.attr"/> + </define> + <!-- + =============================================================== + Marker retrieval. + =============================================================== + FIXME! We are more strict here making retrieve-class-name attribute a mandatory, + but marker with no retrieve-class-name is meaningless. + --> + <define name="retrieve-marker.attlist"> + <ref name="retrieve-class-name.attr"/> + <optional> + <ref name="retrieve-position.attr"/> + </optional> + <optional> + <ref name="retrieve-boundary.attr"/> + </optional> + <!-- + MEMO: Is it OK to allow inheritable properties here? There are no explicit arguments + against it in the spec. + --> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Multistate stuff. + =============================================================== + =============================================================== + Switch. + =============================================================== + MEMO: Should we have Aural Properties here as well? + --> + <define name="multi-switch.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <optional> + <ref name="auto-restore.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Single case. + =============================================================== + --> + <define name="multi-case.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <optional> + <ref name="starting-state.attr"/> + </optional> + <optional> + <ref name="case-name.attr"/> + </optional> + <optional> + <ref name="case-title.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Toggle. + =============================================================== + MEMO: Should we have here inline-level properties only? + --> + <define name="multi-toggle.attlist"> + <optional> + <ref name="switch-to.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Multi-properties. + =============================================================== + Should we allow here any possible properties applicable to the objects inside of the flow? + --> + <define name="multi-properties.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Multi property set. + =============================================================== + Should we allow here any possible properties applicable to the objects inside of the flow? + --> + <define name="multi-property-set.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="active-state.attr"/> + <ref name="inheritable-properties"/> + </define> +</grammar> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/valid/properties_groups.rng b/sandbox/paultremblay/python_interface/docutilsToFo/valid/properties_groups.rng new file mode 100644 index 000000000..606c179b2 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/valid/properties_groups.rng @@ -0,0 +1,1209 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ========================================================= + + (c) 2004, RenderX + + Author: Alexander Peshkov <peshkov@renderx.com> + + Permission is granted to use this document, copy and + modify free of charge, provided that every derived work + bear a reference to the present document. + + This document contains a computer program written in + XSL Transformations Language. It is published with no + warranty of any kind about its usability, as a mere + example of XSL technology. RenderX shall not be + considered liable for any damage or loss of data caused + by use of this program. + + ========================================================= +--> +<grammar xmlns="http://relaxng.org/ns/structure/1.0"> + <include href="basic_properties.rng"/> + <!-- + =============================================================== + Properties grouping. Groups used by different elements classes + =============================================================== + --> + <!-- + =============================================================== + Entity definitions for common groups of properties + This grouping reflects properties co occurrence, rather than + property semantics. It does not correspond to grouping in the + spec. + =============================================================== + --> + <!-- Accessibility Properties --> + <define name="accessibility-properties"> + <optional> + <ref name="source-document.attr"/> + </optional> + <optional> + <ref name="role.attr"/> + </optional> + </define> + <!-- + MEMO: XSLFO is selfcontradictory: + Those properties allowed on all inline elements excep to for fo:character, fo:bidi-override and fo:inline-conteiner + At the same time spec says about those properties: + XSL> It is used by all formatting objects that can be contained in fo:flow or fo:static-content (all formatting + XSL> objects that can be directly created from an XML source element). + Thus they must be present on fo:character, fo:bidi-override, fo:inline-conteiner as well + (there are more elements missing these properties) + Note also, that comment in the round brackets seems to be meaningless. + --> + <!-- + Relative Position Properties + 'position' shorthand property also makes part of this group + --> + <define name="relative-position-properties"> + <optional> + <ref name="relative-position.attr"/> + </optional> + <optional> + <ref name="relative-position-shorthand.attr"/> + </optional> + </define> + <!-- Absolute Position Properties --> + <define name="absolute-position-properties"> + <ref name="absolute-position.attr"/> + <optional> + <ref name="absolute-position-shorthand.attr"/> + </optional> + <optional> + <ref name="top.attr"/> + </optional> + <optional> + <ref name="right.attr"/> + </optional> + <optional> + <ref name="bottom.attr"/> + </optional> + <optional> + <ref name="left.attr"/> + </optional> + </define> + <!-- + Aural Properties + 'cue' and 'pause' shorthand properties are also included + MEMO: XSLFO is selfcontradictory here in the same way + it is for Accessibility Properties - Aural properties allowed everywhere + but yet not specified on some elements, e.g. fo:block-container or fo:inline-container. + We believe this is an omission and therefor those properties are available everywhere. + --> + <define name="aural-properties-inheritable"> + <optional> + <ref name="azimuth.attr"/> + </optional> + <optional> + <ref name="elevation.attr"/> + </optional> + <optional> + <ref name="pitch.attr"/> + </optional> + <optional> + <ref name="pitch-range.attr"/> + </optional> + <optional> + <ref name="play-during.attr"/> + </optional> + <optional> + <ref name="richness.attr"/> + </optional> + <optional> + <ref name="speak.attr"/> + </optional> + <optional> + <ref name="speak-header.attr"/> + </optional> + <optional> + <ref name="speak-numeral.attr"/> + </optional> + <optional> + <ref name="speak-punctuation.attr"/> + </optional> + <optional> + <ref name="speech-rate.attr"/> + </optional> + <optional> + <ref name="stress.attr"/> + </optional> + <optional> + <ref name="voice-family.attr"/> + </optional> + <optional> + <ref name="volume.attr"/> + </optional> + </define> + <define name="aural-properties-unheritable"> + <optional> + <ref name="cue.attr"/> + </optional> + <optional> + <ref name="cue-after.attr"/> + </optional> + <optional> + <ref name="cue-before.attr"/> + </optional> + <optional> + <ref name="pause.attr"/> + </optional> + <optional> + <ref name="pause-after.attr"/> + </optional> + <optional> + <ref name="pause-before.attr"/> + </optional> + </define> + <define name="aural-properties"> + <ref name="aural-properties-inheritable"/> + <ref name="aural-properties-unheritable"/> + </define> + <!-- + Common Border, Padding, and Background Properties + Related shorthand properties are also included + --> + <define name="border-properties"> + <optional> + <ref name="border.attr"/> + </optional> + <optional> + <ref name="border-after-color.attr"/> + </optional> + <optional> + <ref name="border-after-style.attr"/> + </optional> + <optional> + <ref name="border-after-width.attr"/> + </optional> + <optional> + <ref name="border-after-width.length.attr"/> + </optional> + <optional> + <ref name="border-after-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-before-color.attr"/> + </optional> + <optional> + <ref name="border-before-style.attr"/> + </optional> + <optional> + <ref name="border-before-width.attr"/> + </optional> + <optional> + <ref name="border-before-width.length.attr"/> + </optional> + <optional> + <ref name="border-before-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-bottom.attr"/> + </optional> + <optional> + <ref name="border-bottom-color.attr"/> + </optional> + <optional> + <ref name="border-bottom-style.attr"/> + </optional> + <optional> + <ref name="border-bottom-width.attr"/> + </optional> + <optional> + <ref name="border-bottom-width.length.attr"/> + </optional> + <optional> + <ref name="border-bottom-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-color.attr"/> + </optional> + <optional> + <ref name="border-end-color.attr"/> + </optional> + <optional> + <ref name="border-end-style.attr"/> + </optional> + <optional> + <ref name="border-end-width.attr"/> + </optional> + <optional> + <ref name="border-end-width.length.attr"/> + </optional> + <optional> + <ref name="border-end-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-left.attr"/> + </optional> + <optional> + <ref name="border-left-color.attr"/> + </optional> + <optional> + <ref name="border-left-style.attr"/> + </optional> + <optional> + <ref name="border-left-width.attr"/> + </optional> + <optional> + <ref name="border-left-width.length.attr"/> + </optional> + <optional> + <ref name="border-left-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-right.attr"/> + </optional> + <optional> + <ref name="border-right-color.attr"/> + </optional> + <optional> + <ref name="border-right-style.attr"/> + </optional> + <optional> + <ref name="border-right-width.attr"/> + </optional> + <optional> + <ref name="border-right-width.length.attr"/> + </optional> + <optional> + <ref name="border-right-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-start-color.attr"/> + </optional> + <optional> + <ref name="border-start-style.attr"/> + </optional> + <optional> + <ref name="border-start-width.attr"/> + </optional> + <optional> + <ref name="border-start-width.length.attr"/> + </optional> + <optional> + <ref name="border-start-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-style.attr"/> + </optional> + <optional> + <ref name="border-top.attr"/> + </optional> + <optional> + <ref name="border-top-color.attr"/> + </optional> + <optional> + <ref name="border-top-style.attr"/> + </optional> + <optional> + <ref name="border-top-width.attr"/> + </optional> + <optional> + <ref name="border-top-width.length.attr"/> + </optional> + <optional> + <ref name="border-top-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-width.attr"/> + </optional> + </define> + <define name="padding-properties"> + <optional> + <ref name="padding.attr"/> + </optional> + <optional> + <ref name="padding-after.attr"/> + </optional> + <optional> + <ref name="padding-after.length.attr"/> + </optional> + <optional> + <ref name="padding-after.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-before.attr"/> + </optional> + <optional> + <ref name="padding-before.length.attr"/> + </optional> + <optional> + <ref name="padding-before.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-bottom.attr"/> + </optional> + <optional> + <ref name="padding-bottom.length.attr"/> + </optional> + <optional> + <ref name="padding-bottom.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-end.attr"/> + </optional> + <optional> + <ref name="padding-end.length.attr"/> + </optional> + <optional> + <ref name="padding-end.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-left.attr"/> + </optional> + <optional> + <ref name="padding-left.length.attr"/> + </optional> + <optional> + <ref name="padding-left.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-right.attr"/> + </optional> + <optional> + <ref name="padding-right.length.attr"/> + </optional> + <optional> + <ref name="padding-right.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-start.attr"/> + </optional> + <optional> + <ref name="padding-start.length.attr"/> + </optional> + <optional> + <ref name="padding-start.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-top.attr"/> + </optional> + <optional> + <ref name="padding-top.length.attr"/> + </optional> + <optional> + <ref name="padding-top.conditionality.attr"/> + </optional> + </define> + <define name="background-properties"> + <optional> + <ref name="background.attr"/> + </optional> + <optional> + <ref name="background-attachment.attr"/> + </optional> + <optional> + <ref name="background-color.attr"/> + </optional> + <optional> + <ref name="background-image.attr"/> + </optional> + <optional> + <ref name="background-position.attr"/> + </optional> + <optional> + <ref name="background-position-vertical.attr"/> + </optional> + <optional> + <ref name="background-position-horizontal.attr"/> + </optional> + <optional> + <ref name="background-repeat.attr"/> + </optional> + <optional> + <ref name="rx-background-content-type.attr"/> + </optional> + <optional> + <ref name="rx-background-content-height.attr"/> + </optional> + <optional> + <ref name="rx-background-content-width.attr"/> + </optional> + <optional> + <ref name="rx-background-scaling.attr"/> + </optional> + </define> + <define name="border-padding-background-properties"> + <ref name="border-properties"/> + <ref name="padding-properties"/> + <ref name="background-properties"/> + </define> + <!-- Border Precedence Properties for tables --> + <define name="border-precedence-properties"> + <optional> + <ref name="border-after-precedence.attr"/> + </optional> + <optional> + <ref name="border-before-precedence.attr"/> + </optional> + <optional> + <ref name="border-end-precedence.attr"/> + </optional> + <optional> + <ref name="border-start-precedence.attr"/> + </optional> + </define> + <!-- Box Size Properties --> + <define name="height-properties"> + <optional> + <ref name="height.attr"/> + </optional> + <optional> + <ref name="min-height.attr"/> + </optional> + <optional> + <ref name="max-height.attr"/> + </optional> + <optional> + <ref name="block-progression-dimension.attr"/> + </optional> + <optional> + <ref name="block-progression-dimension.minimum.attr"/> + </optional> + <optional> + <ref name="block-progression-dimension.optimum.attr"/> + </optional> + <optional> + <ref name="block-progression-dimension.maximum.attr"/> + </optional> + </define> + <define name="width-properties"> + <optional> + <ref name="width.attr"/> + </optional> + <optional> + <ref name="min-width.attr"/> + </optional> + <optional> + <ref name="max-width.attr"/> + </optional> + <optional> + <ref name="inline-progression-dimension.attr"/> + </optional> + <optional> + <ref name="inline-progression-dimension.minimum.attr"/> + </optional> + <optional> + <ref name="inline-progression-dimension.optimum.attr"/> + </optional> + <optional> + <ref name="inline-progression-dimension.maximum.attr"/> + </optional> + </define> + <define name="box-size-properties"> + <ref name="height-properties"/> + <ref name="width-properties"/> + </define> + <!-- Common Area Properties --> + <define name="area-properties-inheritable"> + <optional> + <ref name="display-align.attr"/> + </optional> + <optional> + <ref name="reference-orientation.attr"/> + </optional> + <optional> + <ref name="writing-mode.attr"/> + </optional> + </define> + <define name="area-properties-unheritable"> + <optional> + <ref name="clip.attr"/> + </optional> + <optional> + <ref name="overflow.attr"/> + </optional> + </define> + <define name="area-properties"> + <ref name="area-properties-inheritable"/> + <ref name="area-properties-unheritable"/> + </define> + <!-- + Common Font Properties + 'font' shorthand property is also included + --> + <define name="font-properties"> + <optional> + <ref name="font.attr"/> + </optional> + <optional> + <ref name="font-selection-strategy.attr"/> + </optional> + <optional> + <ref name="font-family.attr"/> + </optional> + <optional> + <ref name="font-size.attr"/> + </optional> + <optional> + <ref name="font-size-adjust.attr"/> + </optional> + <optional> + <ref name="font-stretch.attr"/> + </optional> + <optional> + <ref name="font-style.attr"/> + </optional> + <optional> + <ref name="font-variant.attr"/> + </optional> + <optional> + <ref name="font-weight.attr"/> + </optional> + </define> + <!-- + Common Hyphenation Properties - Inline + 'xml:lang' shorthand property is also included + --> + <define name="hyphenation-properties-inline"> + <optional> + <ref name="country.attr"/> + </optional> + <optional> + <ref name="language.attr"/> + </optional> + <optional> + <ref name="script.attr"/> + </optional> + <optional> + <attribute name="xml:lang"/> + </optional> + <optional> + <ref name="hyphenate.attr"/> + </optional> + <optional> + <ref name="hyphenation-character.attr"/> + </optional> + <optional> + <ref name="hyphenation-push-character-count.attr"/> + </optional> + <optional> + <ref name="hyphenation-remain-character-count.attr"/> + </optional> + </define> + <!-- Common Hyphenation Properties - Block --> + <define name="hyphenation-properties-block"> + <optional> + <ref name="hyphenation-keep.attr"/> + </optional> + <optional> + <ref name="hyphenation-ladder-count.attr"/> + </optional> + </define> + <define name="hyphenation-properties"> + <ref name="hyphenation-properties-inline"/> + <ref name="hyphenation-properties-block"/> + </define> + <!-- + Common CSS Margin Properties + 'margin' shorthand property is also included + --> + <define name="margin-properties-CSS"> + <optional> + <ref name="margin.attr"/> + </optional> + <optional> + <ref name="margin-bottom.attr"/> + </optional> + <optional> + <ref name="margin-left.attr"/> + </optional> + <optional> + <ref name="margin-right.attr"/> + </optional> + <optional> + <ref name="margin-top.attr"/> + </optional> + </define> + <!-- Common Margin Properties - Block --> + <define name="margin-properties-inheritable"> + <optional> + <ref name="start-indent.attr"/> + </optional> + <optional> + <ref name="end-indent.attr"/> + </optional> + </define> + <define name="margin-properties-block"> + <ref name="margin-properties-CSS"/> + <optional> + <ref name="space-after.attr"/> + </optional> + <optional> + <ref name="space-after.minimum.attr"/> + </optional> + <optional> + <ref name="space-after.optimum.attr"/> + </optional> + <optional> + <ref name="space-after.maximum.attr"/> + </optional> + <optional> + <ref name="space-after.precedence.attr"/> + </optional> + <optional> + <ref name="space-after.conditionality.attr"/> + </optional> + <optional> + <ref name="space-before.attr"/> + </optional> + <optional> + <ref name="space-before.minimum.attr"/> + </optional> + <optional> + <ref name="space-before.optimum.attr"/> + </optional> + <optional> + <ref name="space-before.maximum.attr"/> + </optional> + <optional> + <ref name="space-before.precedence.attr"/> + </optional> + <optional> + <ref name="space-before.conditionality.attr"/> + </optional> + </define> + <!-- Common Margin Properties - Inline --> + <define name="margin-properties-inline"> + <ref name="margin-properties-CSS"/> + <optional> + <ref name="space-start.attr"/> + </optional> + <optional> + <ref name="space-start.minimum.attr"/> + </optional> + <optional> + <ref name="space-start.optimum.attr"/> + </optional> + <optional> + <ref name="space-start.maximum.attr"/> + </optional> + <optional> + <ref name="space-start.precedence.attr"/> + </optional> + <optional> + <ref name="space-start.conditionality.attr"/> + </optional> + <optional> + <ref name="space-end.attr"/> + </optional> + <optional> + <ref name="space-end.minimum.attr"/> + </optional> + <optional> + <ref name="space-end.optimum.attr"/> + </optional> + <optional> + <ref name="space-end.maximum.attr"/> + </optional> + <optional> + <ref name="space-end.precedence.attr"/> + </optional> + <optional> + <ref name="space-end.conditionality.attr"/> + </optional> + </define> + <!-- + Area Alignment Properties + 'vertical-align' shorthand is added + 'relative-align' - excluded + --> + <define name="area-alignment-properties"> + <optional> + <ref name="alignment-adjust.attr"/> + </optional> + <optional> + <ref name="alignment-baseline.attr"/> + </optional> + <optional> + <ref name="baseline-shift.attr"/> + </optional> + <optional> + <ref name="dominant-baseline.attr"/> + </optional> + <optional> + <ref name="vertical-align.attr"/> + </optional> + </define> + <!-- Line Height Properties --> + <define name="line-height-properties"> + <optional> + <ref name="line-height.attr"/> + </optional> + <optional> + <ref name="line-height.minimum.attr"/> + </optional> + <optional> + <ref name="line-height.optimum.attr"/> + </optional> + <optional> + <ref name="line-height.maximum.attr"/> + </optional> + <optional> + <ref name="line-height.precedence.attr"/> + </optional> + <optional> + <ref name="line-height.conditionality.attr"/> + </optional> + <optional> + <ref name="line-height-shift-adjustment.attr"/> + </optional> + </define> + <!-- Line Related Properties --> + <define name="line-related-properties"> + <optional> + <ref name="text-align.attr"/> + </optional> + <optional> + <ref name="text-align-last.attr"/> + </optional> + <optional> + <ref name="text-indent.attr"/> + </optional> + <optional> + <ref name="last-line-end-indent.attr"/> + </optional> + <optional> + <ref name="line-stacking-strategy.attr"/> + </optional> + <optional> + <ref name="linefeed-treatment.attr"/> + </optional> + <optional> + <ref name="white-space.attr"/> + </optional> + <optional> + <ref name="white-space-treatment.attr"/> + </optional> + <optional> + <ref name="white-space-collapse.attr"/> + </optional> + <optional> + <ref name="wrap-option.attr"/> + </optional> + <optional> + <ref name="direction.attr"/> + </optional> + </define> + <!-- Character Properties --> + <define name="character-properties-inheritable"> + <optional> + <ref name="letter-spacing.attr"/> + </optional> + <optional> + <ref name="letter-spacing.minimum.attr"/> + </optional> + <optional> + <ref name="letter-spacing.optimum.attr"/> + </optional> + <optional> + <ref name="letter-spacing.maximum.attr"/> + </optional> + <optional> + <ref name="letter-spacing.precedence.attr"/> + </optional> + <optional> + <ref name="letter-spacing.conditionality.attr"/> + </optional> + <optional> + <ref name="word-spacing.attr"/> + </optional> + <optional> + <ref name="word-spacing.minimum.attr"/> + </optional> + <optional> + <ref name="word-spacing.optimum.attr"/> + </optional> + <optional> + <ref name="word-spacing.maximum.attr"/> + </optional> + <optional> + <ref name="word-spacing.precedence.attr"/> + </optional> + <optional> + <ref name="word-spacing.conditionality.attr"/> + </optional> + <optional> + <ref name="glyph-orientation-horizontal.attr"/> + </optional> + <optional> + <ref name="glyph-orientation-vertical.attr"/> + </optional> + <optional> + <ref name="score-spaces.attr"/> + </optional> + <optional> + <ref name="text-transform.attr"/> + </optional> + </define> + <define name="character-properties-unheritable"> + <optional> + <!-- + MEMO: There is a problem with these two properties in XSL FO spec. + They are assumed to be allowed everywhere but somehow on of them + missing on fo:inline, another on fo:leader and both absent on fo:bidi-override. + They are not present on fo:block also. + We suppose that those omissions are erratic. and allow them on all elements that can cotain text. + It makes sence to allow text-decoration on the graphical inlines also. + --> + <ref name="text-decoration.attr"/> + </optional> + <optional> + <ref name="text-shadow.attr"/> + </optional> + </define> + <!-- + NOTE: Those properties apllies to char elements but they are already included into 'inheritable-properties' set + font-properties, + line-height-properties + --> + <define name="character-properties"> + <ref name="character-properties-inheritable"/> + <ref name="character-properties-unheritable"/> + </define> + <!-- + Common Keeps and Breaks Properties - Atomic objects + Keeps only + --> + <define name="keeps-properties-atomic"> + <optional> + <ref name="keep-with-next.attr"/> + </optional> + <optional> + <ref name="keep-with-next.within-line.attr"/> + </optional> + <optional> + <ref name="keep-with-next.within-column.attr"/> + </optional> + <optional> + <ref name="keep-with-next.within-page.attr"/> + </optional> + <optional> + <ref name="keep-with-previous.attr"/> + </optional> + <optional> + <ref name="keep-with-previous.within-line.attr"/> + </optional> + <optional> + <ref name="keep-with-previous.within-column.attr"/> + </optional> + <optional> + <ref name="keep-with-previous.within-page.attr"/> + </optional> + </define> + <!-- + Common Keeps and Breaks Properties - Atomic objects + Keeps and Breaks + 'page-break-*' shorthand properties are also included + --> + <define name="keeps-and-breaks-properties-atomic"> + <ref name="keeps-properties-atomic"/> + <optional> + <ref name="break-after.attr"/> + </optional> + <optional> + <ref name="break-before.attr"/> + </optional> + <optional> + <ref name="page-break-after.attr"/> + </optional> + <optional> + <ref name="page-break-before.attr"/> + </optional> + </define> + <!-- + Common Keeps and Breaks Properties - Inline + 'page-break-inside' shorthand property is also included + --> + <define name="keeps-and-breaks-properties-inline-inheritable"> + <optional> + <ref name="keep-together.attr"/> + </optional> + <optional> + <ref name="keep-together.within-line.attr"/> + </optional> + <optional> + <ref name="keep-together.within-column.attr"/> + </optional> + <optional> + <ref name="keep-together.within-page.attr"/> + </optional> + <optional> + <ref name="page-break-inside.attr"/> + </optional> + </define> + <!-- MEMO: Do we really need separate block and inline groups here --> + <!-- Common Keeps and Breaks Properties - Block --> + <define name="keeps-and-breaks-properties-block-inheritable"> + <optional> + <ref name="orphans.attr"/> + </optional> + <optional> + <ref name="widows.attr"/> + </optional> + </define> + <!-- Leader and Rule Properties --> + <define name="leader-properties"> + <optional> + <ref name="leader-alignment.attr"/> + </optional> + <optional> + <ref name="leader-pattern.attr"/> + </optional> + <optional> + <ref name="leader-pattern-width.attr"/> + </optional> + <optional> + <ref name="leader-length.attr"/> + </optional> + <optional> + <ref name="leader-length.minimum.attr"/> + </optional> + <optional> + <ref name="leader-length.optimum.attr"/> + </optional> + <optional> + <ref name="leader-length.maximum.attr"/> + </optional> + <optional> + <ref name="rule-style.attr"/> + </optional> + <optional> + <ref name="rule-thickness.attr"/> + </optional> + </define> + <!-- + Table Properties + 'border-spacing' shorthand property is also included + 'inherit' property added to table-omit-...er-at-break + --> + <define name="table-properties-inheritable"> + <optional> + <ref name="border-collapse.attr"/> + </optional> + <optional> + <ref name="border-spacing.attr"/> + </optional> + <optional> + <ref name="border-separation.attr"/> + </optional> + <optional> + <ref name="border-separation.inline-progression-direction.attr"/> + </optional> + <optional> + <ref name="border-separation.block-progression-direction.attr"/> + </optional> + <optional> + <ref name="caption-side.attr"/> + </optional> + <optional> + <ref name="empty-cells.attr"/> + </optional> + </define> + <define name="table-properties-unheritable"> + <optional> + <ref name="table-layout.attr"/> + </optional> + <optional> + <ref name="table-omit-header-at-break.attr"/> + </optional> + <optional> + <ref name="table-omit-footer-at-break.attr"/> + </optional> + <optional> + <ref name="rx-table-omit-initial-header.attr"/> + </optional> + </define> + <define name="table-properties"> + <ref name="table-properties-inheritable"/> + <ref name="table-properties-unheritable"/> + </define> + <!-- List Properties --> + <define name="list-properties"> + <optional> + <ref name="provisional-distance-between-starts.attr"/> + </optional> + <optional> + <ref name="provisional-label-separation.attr"/> + </optional> + </define> + <!-- + Visibility Properties + NOTE: 'visibility' is inheritable, but 'z-index' is not. + --> + <define name="visibility-properties"> + <optional> + <ref name="visibility.attr"/> + </optional> + <optional> + <ref name="z-index.attr"/> + </optional> + </define> + <!-- + =============================================================== + Set of 'explicitly' inheritable properties. This includes attributes + marked as inheritable in the spec only! + We define two sets of inheritable properties: + 1. Basic properties applicable to inline-level elements with character-only content + 2. Full set of inheritable properties + =============================================================== + --> + <define name="inheritable-properties-inline"> + <ref name="aural-properties-inheritable"/> + <optional> + <ref name="color.attr"/> + </optional> + <ref name="character-properties-inheritable"/> + <ref name="font-properties"/> + <ref name="hyphenation-properties-inline"/> + <ref name="line-height-properties"/> + <optional> + <ref name="visibility.attr"/> + </optional> + </define> + <define name="inheritable-properties-block"> + <ref name="table-properties-inheritable"/> + <ref name="area-properties-inheritable"/> + <ref name="hyphenation-properties-block"/> + <ref name="margin-properties-inheritable"/> + <optional> + <ref name="intrusion-displace.attr"/> + </optional> + <!-- 'intrusion-displace' applies to: fo:block, fo:block-container, fo:table-and-caption, fo:table, fo:table-caption, fo:list-block, fo:list-item. --> + <ref name="keeps-and-breaks-properties-inline-inheritable"/> + <ref name="keeps-and-breaks-properties-block-inheritable"/> + <ref name="leader-properties"/> + <!-- MEMO: Should we move this one to inheritable-properties-inline? --> + <ref name="line-related-properties"/> + <ref name="list-properties"/> + <optional> + <ref name="relative-align.attr"/> + </optional> + </define> + <!-- NOTE: Property 'relative-align' applies to fo:list-item and fo:table-cell only. --> + <define name="inheritable-properties"> + <ref name="inheritable-properties-inline"/> + <ref name="inheritable-properties-block"/> + </define> + <!-- + =============================================================== + Common property subsets. + =============================================================== + Common block properties (those properties applies to any type of block-container as well + --> + <define name="common-block-properties"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="border-padding-background-properties"/> + <ref name="margin-properties-block"/> + <ref name="inheritable-properties"/> + </define> + <!-- Properties for fo:block and fo:block-container --> + <define name="block-properties"> + <ref name="common-block-properties"/> + <optional> + <ref name="clear.attr"/> + </optional> + <optional> + <ref name="span.attr"/> + </optional> + <ref name="keeps-and-breaks-properties-atomic"/> + <ref name="relative-position-properties"/> + </define> + <!-- + Common inline properties + MEMO: Spec says that text-altitude/text-depth applicable only to + fo:block, fo:character, fo:leader, fo:page-number, fo:page-number-citation + We believe this is an omission and they must be allowed on all elements + that can have text children. + --> + <define name="common-inline-properties"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="area-alignment-properties"/> + <ref name="border-padding-background-properties"/> + <ref name="character-properties-unheritable"/> + <ref name="keeps-properties-atomic"/> + <ref name="margin-properties-inline"/> + <ref name="relative-position-properties"/> + <optional> + <ref name="text-altitude.attr"/> + </optional> + <optional> + <ref name="text-depth.attr"/> + </optional> + <ref name="inheritable-properties-inline"/> + </define> + <!-- Properties for nonempty inline elements --> + <define name="inline-properties"> + <ref name="common-inline-properties"/> + <ref name="inheritable-properties-block"/> + </define> + <!-- + Properties for graphical inline elements + NOTE: src attribute exclueded since it's not applicable to fo:instream-foreign-object + --> + <define name="graphic-properties"> + <optional> + <!-- + MEMO: We can replace part of the definition here with 'common-inline-properties' set + - it will be formaly rightfil since the only difference made by text-shadow, text-altitude, + text-depth and inheritable-properties-inline and both of them are allowed here. + At the same time those properties do not make any sense being specified on those + elements since they will be never applied. + --> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties"/> + <ref name="area-properties-unheritable"/> + <ref name="border-padding-background-properties"/> + <ref name="margin-properties-inline"/> + <ref name="relative-position-properties"/> + <ref name="area-alignment-properties"/> + <ref name="box-size-properties"/> + <ref name="keeps-properties-atomic"/> + <ref name="line-height-properties"/> + <optional> + <ref name="display-align.attr"/> + </optional> + <optional> + <ref name="content-type.attr"/> + </optional> + <optional> + <ref name="content-height.attr"/> + </optional> + <optional> + <ref name="content-width.attr"/> + </optional> + <optional> + <ref name="scaling.attr"/> + </optional> + <optional> + <ref name="scaling-method.attr"/> + </optional> + <optional> + <ref name="text-align.attr"/> + </optional> + <optional> + <ref name="text-decoration.attr"/> + </optional> + </define> +</grammar> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/valid/soextblx.dtd b/sandbox/paultremblay/python_interface/docutilsToFo/valid/soextblx.dtd new file mode 100644 index 000000000..23bb45892 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/valid/soextblx.dtd @@ -0,0 +1,309 @@ +<!-- XML EXCHANGE TABLE MODEL DECLARATION MODULE --> + +<!-- This set of declarations defines the XML version of the Exchange + Table Model as of the date shown in the Formal Public Identifier + (FPI) for this entity. + + This set of declarations may be referred to using a public external + entity declaration and reference as shown in the following three + lines: + + <!ENTITY % calstblx + PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN"> + %calstblx; + + If various parameter entities used within this set of declarations + are to be given non-default values, the appropriate declarations + should be given before calling in this package (i.e., before the + "%calstblx;" reference). +--> + +<!-- The motivation for this XML version of the Exchange Table Model + is simply to create an XML version of the SGML Exchange Table + Model. By design, no effort has been made to "improve" the model. + + This XML version incorporates the logical bare minimum changes + necessary to make the Exchange Table Model a valid XML DTD. +--> + +<!-- The XML version of the Exchange Table Model differs from + the SGML version in the following ways: + + The following parameter entities have been removed: + + - tbl.table.excep, tbl.hdft.excep, tbl.row.excep, tbl.entry.excep + There are no exceptions in XML. The following normative statement + is made in lieu of exceptions: the exchange table model explicitly + forbids a table from occurring within another table. If the + content model of an entry includes a table element, then this + cannot be enforced by the DTD, but it is a deviation from the + exchange table model to include a table within a table. + + - tbl.hdft.name, tbl.hdft.mdl, tbl.hdft.excep, tbl.hdft.att + The motivation for these elements was to change the table + header/footer elements. Since XML does not allow element declarations + to contain name groups, and the exchange table model does not + allow a table to contain footers, the continued presence of these + attributes seems unnecessary. + + The following parameter entity has been added: + + - tbl.thead.att + This entity parameterizes the attributes on thead. It replaces + the tbl.hdft.att parameter entity. + + Other miscellaneous changes: + + - Tag ommission indicators have been removed + - Comments have been removed from declarations + - NUMBER attributes have been changed to NMTOKEN + - NUTOKEN attributes have been to changed to NMTOKEN + - Removed the grouping characters around the content model + parameter entry for the 'entry' element. This is necessary + so that an entry can contain #PCDATA and be defined as an + optional, repeatable OR group beginning with #PCDATA. +--> + +<!-- This entity includes a set of element and attribute declarations + that partially defines the Exchange table model. However, the model + is not well-defined without the accompanying natural language + description of the semantics (meanings) of these various elements, + attributes, and attribute values. The semantic writeup, also available + from SGML Open, should be used in conjunction with this entity. +--> + +<!-- In order to use the Exchange table model, various parameter entity + declarations are required. A brief description is as follows: + + ENTITY NAME WHERE USED WHAT IT IS + + %yesorno In ATTLIST of: An attribute declared value + almost all elements for a "boolean" attribute + + %paracon In content model of: The "text" (logical content) + <entry> of the model group for <entry> + + %titles In content model of: The "title" part of the model + table element group for the table element + + %tbl.table.name In declaration of: The name of the "table" + table element element + + %tbl.table-titles.mdl In content model of: The model group for the title + table elements part of the content model for + table element + + %tbl.table.mdl In content model of: The model group for the content + table elements model for table element, + often (and by default) defined + in terms of %tbl.table-titles.mdl + and tgroup + + %tbl.table.att In ATTLIST of: Additional attributes on the + table element table element + + %bodyatt In ATTLIST of: Additional attributes on the + table element table element (for backward + compatibility with the SGML + model) + + %tbl.tgroup.mdl In content model of: The model group for the content + <tgroup> model for <tgroup> + + %tbl.tgroup.att In ATTLIST of: Additional attributes on the + <tgroup> <tgroup> element + + %tbl.thead.att In ATTLIST of: Additional attributes on the + <thead> <thead> element + + %tbl.tbody.att In ATTLIST of: Additional attributes on the + <tbody> <tbody> element + + %tbl.colspec.att In ATTLIST of: Additional attributes on the + <colspec> <colspec> element + + %tbl.row.mdl In content model of: The model group for the content + <row> model for <row> + + %tbl.row.att In ATTLIST of: Additional attributes on the + <row> <row> element + + %tbl.entry.mdl In content model of: The model group for the content + <entry> model for <entry> + + %tbl.entry.att In ATTLIST of: Additional attributes on the + <entry> <entry> element + + This set of declarations will use the default definitions shown below + for any of these parameter entities that are not declared before this + set of declarations is referenced. +--> + +<!-- These definitions are not directly related to the table model, but are + used in the default CALS table model and may be defined elsewhere (and + prior to the inclusion of this table module) in the referencing DTD. --> + +<!ENTITY % yesorno 'NMTOKEN'> <!-- no if zero(s), yes if any other value --> +<!ENTITY % titles 'title?'> +<!ENTITY % pcd "#PCDATA"> +<!ENTITY % paracon '%pcd;'> <!-- default for use in entry content --> + +<!-- +The parameter entities as defined below change and simplify the CALS table +model as published (as part of the Example DTD) in MIL-HDBK-28001. The +resulting simplified DTD has support from the SGML Open vendors and is +therefore more interoperable among different systems. + +These following declarations provide the Exchange default definitions +for these entities. However, these entities can be redefined (by giving +the appropriate parameter entity declaration(s) prior to the reference +to this Table Model declaration set entity) to fit the needs of the +current application. + +Note, however, that changes may have significant effect on the ability to +interchange table information. These changes may manifest themselves +in useability, presentation, and possible structure information degradation. +--> + +<!ENTITY % tbl.table.name "table"> +<!ENTITY % tbl.table-titles.mdl "%titles;,"> +<!ENTITY % tbl.table-main.mdl "tgroup+"> +<!ENTITY % tbl.table.mdl "%tbl.table-titles.mdl; %tbl.table-main.mdl;"> +<!ENTITY % tbl.table.att " + pgwide %yesorno; #IMPLIED "> +<!ENTITY % bodyatt ""> +<!ENTITY % tbl.tgroup.mdl "colspec*,thead?,tbody"> +<!ENTITY % tbl.tgroup.att ""> +<!ENTITY % tbl.thead.att ""> +<!ENTITY % tbl.tbody.att ""> +<!ENTITY % tbl.colspec.att ""> +<!ENTITY % tbl.row.mdl "entry+"> +<!ENTITY % tbl.row.att ""> +<!ENTITY % tbl.entry.mdl "(%paracon;)*"> +<!ENTITY % tbl.entry.att ""> + +<!-- ===== Element and attribute declarations follow. ===== --> + +<!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.table.name "table" + ENTITY % tbl.table-titles.mdl "%titles;," + ENTITY % tbl.table.mdl "%tbl.table-titles; tgroup+" + ENTITY % tbl.table.att " + pgwide %yesorno; #IMPLIED " +--> + +<!ELEMENT %tbl.table.name; (%tbl.table.mdl;)> + +<!ATTLIST %tbl.table.name; + frame (top|bottom|topbot|all|sides|none) #IMPLIED + colsep %yesorno; #IMPLIED + rowsep %yesorno; #IMPLIED + %tbl.table.att; + %bodyatt; +> + +<!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.tgroup.mdl "colspec*,thead?,tbody" + ENTITY % tbl.tgroup.att "" +--> + +<!ELEMENT tgroup (%tbl.tgroup.mdl;) > + +<!ATTLIST tgroup + cols NMTOKEN #REQUIRED + colsep %yesorno; #IMPLIED + rowsep %yesorno; #IMPLIED + align (left|right|center|justify|char) #IMPLIED + %tbl.tgroup.att; +> + +<!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.colspec.att "" +--> + +<!ELEMENT colspec EMPTY > + +<!ATTLIST colspec + colnum NMTOKEN #IMPLIED + colname NMTOKEN #IMPLIED + colwidth CDATA #IMPLIED + colsep %yesorno; #IMPLIED + rowsep %yesorno; #IMPLIED + align (left|right|center|justify|char) #IMPLIED + char CDATA #IMPLIED + charoff NMTOKEN #IMPLIED + %tbl.colspec.att; +> + +<!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.thead.att "" +--> + +<!ELEMENT thead (row+)> + +<!ATTLIST thead + valign (top|middle|bottom) #IMPLIED + %tbl.thead.att; +> + +<!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.tbody.att "" +--> + +<!ELEMENT tbody (row+)> + +<!ATTLIST tbody + valign (top|middle|bottom) #IMPLIED + %tbl.tbody.att; +> + +<!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.row.mdl "entry+" + ENTITY % tbl.row.att "" +--> + +<!ELEMENT row (%tbl.row.mdl;)> + +<!ATTLIST row + rowsep %yesorno; #IMPLIED + valign (top|middle|bottom) #IMPLIED + %tbl.row.att; +> + + +<!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % paracon "#PCDATA" + ENTITY % tbl.entry.mdl "(%paracon;)*" + ENTITY % tbl.entry.att "" +--> + +<!ELEMENT entry %tbl.entry.mdl;> + +<!ATTLIST entry + colname NMTOKEN #IMPLIED + namest NMTOKEN #IMPLIED + nameend NMTOKEN #IMPLIED + morerows NMTOKEN #IMPLIED + colsep %yesorno; #IMPLIED + rowsep %yesorno; #IMPLIED + align (left|right|center|justify|char) #IMPLIED + char CDATA #IMPLIED + charoff NMTOKEN #IMPLIED + valign (top|middle|bottom) #IMPLIED + %tbl.entry.att; +> + diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/valid/soextblx.rng b/sandbox/paultremblay/python_interface/docutilsToFo/valid/soextblx.rng new file mode 100644 index 000000000..881f9006a --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/valid/soextblx.rng @@ -0,0 +1,518 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- XML EXCHANGE TABLE MODEL DECLARATION MODULE --> +<!-- + This set of declarations defines the XML version of the Exchange + Table Model as of the date shown in the Formal Public Identifier + (FPI) for this entity. + + This set of declarations may be referred to using a public external + entity declaration and reference as shown in the following three + lines: + + <!ENTITY % calstblx + PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN"> + %calstblx; + + If various parameter entities used within this set of declarations + are to be given non-default values, the appropriate declarations + should be given before calling in this package (i.e., before the + "%calstblx;" reference). +--> +<!-- + The motivation for this XML version of the Exchange Table Model + is simply to create an XML version of the SGML Exchange Table + Model. By design, no effort has been made to "improve" the model. + + This XML version incorporates the logical bare minimum changes + necessary to make the Exchange Table Model a valid XML DTD. +--> +<!-- + The XML version of the Exchange Table Model differs from + the SGML version in the following ways: + + The following parameter entities have been removed: + + - tbl.table.excep, tbl.hdft.excep, tbl.row.excep, tbl.entry.excep + There are no exceptions in XML. The following normative statement + is made in lieu of exceptions: the exchange table model explicitly + forbids a table from occurring within another table. If the + content model of an entry includes a table element, then this + cannot be enforced by the DTD, but it is a deviation from the + exchange table model to include a table within a table. + + - tbl.hdft.name, tbl.hdft.mdl, tbl.hdft.excep, tbl.hdft.att + The motivation for these elements was to change the table + header/footer elements. Since XML does not allow element declarations + to contain name groups, and the exchange table model does not + allow a table to contain footers, the continued presence of these + attributes seems unnecessary. + + The following parameter entity has been added: + + - tbl.thead.att + This entity parameterizes the attributes on thead. It replaces + the tbl.hdft.att parameter entity. + + Other miscellaneous changes: + + - Tag ommission indicators have been removed + - Comments have been removed from declarations + - NUMBER attributes have been changed to NMTOKEN + - NUTOKEN attributes have been to changed to NMTOKEN + - Removed the grouping characters around the content model + parameter entry for the 'entry' element. This is necessary + so that an entry can contain #PCDATA and be defined as an + optional, repeatable OR group beginning with #PCDATA. +--> +<!-- + This entity includes a set of element and attribute declarations + that partially defines the Exchange table model. However, the model + is not well-defined without the accompanying natural language + description of the semantics (meanings) of these various elements, + attributes, and attribute values. The semantic writeup, also available + from SGML Open, should be used in conjunction with this entity. +--> +<!-- + In order to use the Exchange table model, various parameter entity + declarations are required. A brief description is as follows: + + ENTITY NAME WHERE USED WHAT IT IS + + %yesorno In ATTLIST of: An attribute declared value + almost all elements for a "boolean" attribute + + %paracon In content model of: The "text" (logical content) + <entry> of the model group for <entry> + + %titles In content model of: The "title" part of the model + table element group for the table element + + %tbl.table.name In declaration of: The name of the "table" + table element element + + %tbl.table-titles.mdl In content model of: The model group for the title + table elements part of the content model for + table element + + %tbl.table.mdl In content model of: The model group for the content + table elements model for table element, + often (and by default) defined + in terms of %tbl.table-titles.mdl + and tgroup + + %tbl.table.att In ATTLIST of: Additional attributes on the + table element table element + + %bodyatt In ATTLIST of: Additional attributes on the + table element table element (for backward + compatibility with the SGML + model) + + %tbl.tgroup.mdl In content model of: The model group for the content + <tgroup> model for <tgroup> + + %tbl.tgroup.att In ATTLIST of: Additional attributes on the + <tgroup> <tgroup> element + + %tbl.thead.att In ATTLIST of: Additional attributes on the + <thead> <thead> element + + %tbl.tbody.att In ATTLIST of: Additional attributes on the + <tbody> <tbody> element + + %tbl.colspec.att In ATTLIST of: Additional attributes on the + <colspec> <colspec> element + + %tbl.row.mdl In content model of: The model group for the content + <row> model for <row> + + %tbl.row.att In ATTLIST of: Additional attributes on the + <row> <row> element + + %tbl.entry.mdl In content model of: The model group for the content + <entry> model for <entry> + + %tbl.entry.att In ATTLIST of: Additional attributes on the + <entry> <entry> element + + This set of declarations will use the default definitions shown below + for any of these parameter entities that are not declared before this + set of declarations is referenced. +--> +<!-- + These definitions are not directly related to the table model, but are + used in the default CALS table model and may be defined elsewhere (and + prior to the inclusion of this table module) in the referencing DTD. +--> +<!-- no if zero(s), yes if any other value --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <define name="titles"> + <optional> + <ref name="title"/> + </optional> + </define> + <define name="pcd"> + <text/> + </define> + <define name="paracon"> + <ref name="pcd"/> + </define> + <!-- default for use in entry content --> + <!-- + The parameter entities as defined below change and simplify the CALS table + model as published (as part of the Example DTD) in MIL-HDBK-28001. The + resulting simplified DTD has support from the SGML Open vendors and is + therefore more interoperable among different systems. + + These following declarations provide the Exchange default definitions + for these entities. However, these entities can be redefined (by giving + the appropriate parameter entity declaration(s) prior to the reference + to this Table Model declaration set entity) to fit the needs of the + current application. + + Note, however, that changes may have significant effect on the ability to + interchange table information. These changes may manifest themselves + in useability, presentation, and possible structure information degradation. + --> + <define name="tbl.table-titles.mdl"> + <ref name="titles"/> + </define> + <define name="tbl.table-main.mdl"> + <oneOrMore> + <ref name="tgroup"/> + </oneOrMore> + </define> + <define name="tbl.table.mdl"> + <choice> + <ref name="tbl.table-titles.mdl"/> + <ref name="tbl.table-main.mdl"/> + </choice> + </define> + <define name="tbl.table.att"> + <optional> + <attribute name="pgwide"> + <ref name="yesorno"/> + </attribute> + </optional> + </define> + <define name="tbl.tgroup.mdl"> + <zeroOrMore> + <ref name="colspec"/> + </zeroOrMore> + <optional> + <ref name="thead"/> + </optional> + <optional> + <ref name="tfoot"/> + </optional> + <ref name="tbody"/> + </define> + + <define name="tbl.row.mdl"> + <oneOrMore> + <ref name="entry"/> + </oneOrMore> + </define> + <!-- ===== Element and attribute declarations follow. ===== --> + <!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.table.name "table" + ENTITY % tbl.table-titles.mdl "%titles;," + ENTITY % tbl.table.mdl "%tbl.table-titles; tgroup+" + ENTITY % tbl.table.att " + pgwide %yesorno; #IMPLIED " + --> + <define name="table"> + <element name="table"> + <optional> + <ref name="title"/> + </optional> + <ref name="table.attlist"/> + <ref name="tbl.table.mdl"/> + </element> + </define> + <define name="table.attlist" combine="interleave"> + <optional> + <attribute name="frame"> + <choice> + <value>top</value> + <value>bottom</value> + <value>topbot</value> + <value>all</value> + <value>sides</value> + <value>none</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="colsep"> + <ref name="yesorno"/> + </attribute> + </optional> + <optional> + <attribute name="rowsep"> + <ref name="yesorno"/> + </attribute> + </optional> + <ref name="tbl.table.att"/> + <ref name="bodyatt"/> + </define> + <!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.tgroup.mdl "colspec*,thead?,tbody" + ENTITY % tbl.tgroup.att "" + --> + <define name="tgroup"> + <element name="tgroup"> + <ref name="tgroup.attlist"/> + <ref name="tbl.tgroup.mdl"/> + </element> + </define> + <define name="tgroup.attlist" combine="interleave"> + <attribute name="cols"> + <data type="NMTOKEN"/> + </attribute> + <optional> + <attribute name="colsep"> + <ref name="yesorno"/> + </attribute> + </optional> + <optional> + <attribute name="rowsep"> + <ref name="yesorno"/> + </attribute> + </optional> + <optional> + <attribute name="align"> + <choice> + <value>left</value> + <value>right</value> + <value>center</value> + <value>justify</value> + <value>char</value> + </choice> + </attribute> + </optional> + <ref name="tbl.tgroup.att"/> + </define> + <!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.colspec.att "" + --> + <define name="colspec"> + <element name="colspec"> + <ref name="colspec.attlist"/> + <empty/> + </element> + </define> + <define name="colspec.attlist" combine="interleave"> + <optional> + <attribute name="colnum"> + <data type="NMTOKEN"/> + </attribute> + </optional> + <optional> + <attribute name="colname"> + <data type="NMTOKEN"/> + </attribute> + </optional> + <optional> + <attribute name="colwidth"/> + </optional> + <optional> + <attribute name="colsep"> + <ref name="yesorno"/> + </attribute> + </optional> + <optional> + <attribute name="rowsep"> + <ref name="yesorno"/> + </attribute> + </optional> + <optional> + <attribute name="align"> + <choice> + <value>left</value> + <value>right</value> + <value>center</value> + <value>justify</value> + <value>char</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="char"/> + </optional> + <optional> + <attribute name="charoff"> + <data type="NMTOKEN"/> + </attribute> + </optional> + <ref name="tbl.colspec.att"/> + </define> + <!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.thead.att "" + --> + <define name="thead"> + <element name="thead"> + <ref name="thead.attlist"/> + <oneOrMore> + <ref name="row"/> + </oneOrMore> + </element> + </define> + <define name="thead.attlist" combine="interleave"> + <optional> + <attribute name="valign"> + <choice> + <value>top</value> + <value>middle</value> + <value>bottom</value> + </choice> + </attribute> + </optional> + <ref name="tbl.thead.att"/> + </define> + + <define name="tfoot"> + <element name="tfoot"> + <ref name="thead.attlist"/> + <oneOrMore> + <ref name="row"/> + </oneOrMore> + </element> + </define> + <!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.tbody.att "" + --> + <define name="tbody"> + <element name="tbody"> + <ref name="tbody.attlist"/> + <oneOrMore> + <ref name="row"/> + </oneOrMore> + </element> + </define> + <define name="tbody.attlist" combine="interleave"> + <optional> + <attribute name="valign"> + <choice> + <value>top</value> + <value>middle</value> + <value>bottom</value> + </choice> + </attribute> + </optional> + <ref name="tbl.tbody.att"/> + </define> + <!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % tbl.row.mdl "entry+" + ENTITY % tbl.row.att "" + --> + <define name="row"> + <element name="row"> + <ref name="row.attlist"/> + <ref name="tbl.row.mdl"/> + </element> + </define> + <define name="row.attlist" combine="interleave"> + <optional> + <attribute name="rowsep"> + <ref name="yesorno"/> + </attribute> + </optional> + <optional> + <attribute name="valign"> + <choice> + <value>top</value> + <value>middle</value> + <value>bottom</value> + </choice> + </attribute> + </optional> + <ref name="tbl.row.att"/> + </define> + <!-- + Default declarations previously defined in this entity and + referenced below include: + ENTITY % paracon "#PCDATA" + ENTITY % tbl.entry.mdl "(%paracon;)*" + ENTITY % tbl.entry.att "" + --> + <define name="entry"> + <element name="entry"> + <ref name="entry.attlist"/> + <ref name="tbl.entry.mdl"/> + </element> + </define> + <define name="entry.attlist" combine="interleave"> + <optional> + <attribute name="colname"> + <data type="NMTOKEN"/> + </attribute> + </optional> + <optional> + <attribute name="namest"> + <data type="NMTOKEN"/> + </attribute> + </optional> + <optional> + <attribute name="nameend"> + <data type="NMTOKEN"/> + </attribute> + </optional> + <optional> + <attribute name="morerows"> + <data type="NMTOKEN"/> + </attribute> + </optional> + <optional> + <attribute name="colsep"> + <ref name="yesorno"/> + </attribute> + </optional> + <optional> + <attribute name="rowsep"> + <ref name="yesorno"/> + </attribute> + </optional> + <optional> + <attribute name="align"> + <choice> + <value>left</value> + <value>right</value> + <value>center</value> + <value>justify</value> + <value>char</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="char"/> + </optional> + <optional> + <attribute name="charoff"> + <data type="NMTOKEN"/> + </attribute> + </optional> + <optional> + <attribute name="valign"> + <choice> + <value>top</value> + <value>middle</value> + <value>bottom</value> + </choice> + </attribute> + </optional> + <ref name="tbl.entry.att"/> + </define> +</grammar> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/admonitions.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/admonitions.xsl new file mode 100644 index 000000000..d495da333 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/admonitions.xsl @@ -0,0 +1,231 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:attribute-set name="default-admonition-outer-block"> + <xsl:attribute name="border-style">solid</xsl:attribute> + <xsl:attribute name="border-width">1px</xsl:attribute> + <xsl:attribute name="padding">6pt</xsl:attribute> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + <!-- + <xsl:attribute name="background-color">blue</xsl:attribute> + --> + </xsl:attribute-set> + + <xsl:attribute-set name="default-admonition-title-block"> + <xsl:attribute name="space-after">10pt</xsl:attribute> + <xsl:attribute name="font-size">larger</xsl:attribute> + <xsl:attribute name="color">red</xsl:attribute> + </xsl:attribute-set> + + + <xsl:attribute-set name="attention-block" use-attribute-sets="default-admonition-outer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="caution-block" use-attribute-sets="default-admonition-outer-block"> + </xsl:attribute-set> + + + <xsl:attribute-set name="danger-block" use-attribute-sets="default-admonition-outer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="error-block" use-attribute-sets="default-admonition-outer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="hint-block" use-attribute-sets="default-admonition-outer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="important-block" use-attribute-sets="default-admonition-outer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="note-block" use-attribute-sets="default-admonition-outer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="tip-block" use-attribute-sets="default-admonition-outer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="admonition-custom-block" use-attribute-sets="default-admonition-outer-block"> + </xsl:attribute-set> + + + <xsl:attribute-set name="warning-block" use-attribute-sets="default-admonition-outer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="attention-title-block" use-attribute-sets="default-admonition-title-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="caution-title-block" use-attribute-sets="default-admonition-title-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="danger-title-block" use-attribute-sets="default-admonition-title-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="error-title-block" use-attribute-sets="default-admonition-title-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="hint-title-block" use-attribute-sets="default-admonition-title-block"> + <xsl:attribute name="color">black</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="important-title-block" use-attribute-sets="default-admonition-title-block"> + <xsl:attribute name="color">black</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="note-title-block" use-attribute-sets="default-admonition-title-block"> + <xsl:attribute name="color">black</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="tip-title-block" use-attribute-sets="default-admonition-title-block"> + <xsl:attribute name="color">black</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="warning-title-block" use-attribute-sets="default-admonition-title-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="admonition-custorm-title-block" use-attribute-sets="default-admonition-title-block"> + <xsl:attribute name="color">black</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="admonition-paragraph-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="admonition-first-paragraph-block" use-attribute-sets="admonition-paragraph-block"> + </xsl:attribute-set> + + + + <xsl:template match="attention"> + <fo:block role="attention" xsl:use-attribute-sets="attention-block"> + <xsl:if test="$attention-title != ''"> + <fo:block role="attention-title" xsl:use-attribute-sets="attention-title-block"> + <xsl:value-of select="$attention-title"/> + </fo:block> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="caution"> + <fo:block role="caution" xsl:use-attribute-sets="caution-block"> + <xsl:if test="$caution-title != ''"> + <fo:block role="caution-title" xsl:use-attribute-sets="caution-title-block"> + <xsl:value-of select="$caution-title"/> + </fo:block> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="danger"> + <fo:block role="danger" xsl:use-attribute-sets="danger-block"> + <xsl:if test="$danger-title != ''"> + <fo:block role="danger-title" xsl:use-attribute-sets="danger-title-block"> + <xsl:value-of select="$danger-title"/> + </fo:block> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="error"> + <fo:block role="error" xsl:use-attribute-sets="error-block"> + <xsl:if test="$error-title != ''"> + <fo:block role="error-title" xsl:use-attribute-sets="error-title-block"> + <xsl:value-of select="$error-title"/> + </fo:block> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="hint"> + <fo:block role="hint" xsl:use-attribute-sets="hint-block"> + <xsl:if test="$hint-title != ''"> + <fo:block role="hint-title" xsl:use-attribute-sets="hint-title-block"> + <xsl:value-of select="$hint-title"/> + </fo:block> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="important"> + <fo:block role="important" xsl:use-attribute-sets="important-block"> + <xsl:if test="$important-title != ''"> + <fo:block role="important-title" xsl:use-attribute-sets="important-title-block"> + <xsl:value-of select="$important-title"/> + </fo:block> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="note"> + <fo:block role="note" xsl:use-attribute-sets="note-block"> + <xsl:if test="$note-title != ''"> + <fo:block role="note-title" xsl:use-attribute-sets="note-title-block"> + <xsl:value-of select="$note-title"/> + </fo:block> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="tip"> + <fo:block role="tip" xsl:use-attribute-sets="tip-block"> + <xsl:if test="$tip-title != ''"> + <fo:block role="tip-title" xsl:use-attribute-sets="tip-title-block"> + <xsl:value-of select="$tip-title"/> + </fo:block> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="warning"> + <fo:block role="warning" xsl:use-attribute-sets="warning-block"> + <xsl:if test="$warning-title != ''"> + <fo:block role="warning-title" xsl:use-attribute-sets="warning-title-block"> + <xsl:value-of select="$warning-title"/> + </fo:block> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + <xsl:template match="admonition[@classes = 'admonition-custom']"> + <fo:block role="admonition-custotrm" xsl:use-attribute-sets="admonition-custom-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="admonition/title"> + <fo:block role="admonition-custorm-title" xsl:use-attribute-sets="admonition-custorm-title-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + + <xsl:template match="attention/paragraph[1]| caution/paragraph[1]|danger/paragraph[1]|error/paragraph[1]| + hint/paragraph[1]|important/paragraph[1]|note/paragraph[1]|tip/paragraph[1]|warning/paragraph[1]| + admonition/paragraph[1] " + priority="2"> + <fo:block role="admonition-paragraph" xsl:use-attribute-sets="admonition-first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="attention/paragraph| caution/paragraph|danger/paragraph|error/paragraph| + hint/paragraph|important/paragraph|note/paragraph|tip/paragraph|warning/paragraph|admonition/paragraph"> + <fo:block role="admonition-paragraph" xsl:use-attribute-sets="admonition-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/bibliographic_fields.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/bibliographic_fields.xsl new file mode 100644 index 000000000..3579c6d2d --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/bibliographic_fields.xsl @@ -0,0 +1,575 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + + <!-- $Id$ --> + + + <!--the automatic page break creates problems for simple page + layouts when no page break should occurr--> + <xsl:attribute-set name="bibliographic-fields-list-block" > + <xsl:attribute name="start-indent">0mm</xsl:attribute> + <xsl:attribute name="provisional-distance-between-starts">30mm</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + + <xsl:attribute-set name="bibliographic-fields-list-item"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="bibliographic-fields-first-list-item" use-attribute-sets = "bibliographic-fields-list-item"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="bibliographic-fields-list-item-label"> + <xsl:attribute name="end-indent">label-end()</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="bibliographic-fields-item-body"> + <xsl:attribute name="start-indent">body-start()</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="bibliographic-fields-item-label-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set> + + + <xsl:attribute-set name="bibliographic-fields-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="bibliographic-first-fields-block" use-attribute-sets = "bibliographic-fields-block"> + </xsl:attribute-set> + + <!--attribute set for Bibliographic address value. Address must preserve white space. + Element is fo:block. `docutils`--> + <xsl:attribute-set name="address-value-block" use-attribute-sets="bibliographic-fields-block"> + <xsl:attribute name="white-space">pre</xsl:attribute> + </xsl:attribute-set> + + <!--NOT AS LIST--> + <!--======================================================================--> + + <xsl:attribute-set name="author-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="authors-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="date-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="organization-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="contact-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="status-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="copyright-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="version-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="revision-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="address-block"> + <xsl:attribute name="white-space">pre</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="custom-bib-info1"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="custom-bib-info2"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="custom-bib-info3"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="custom-bib-info4"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="custom-bib-info5"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="custom-bib-info6"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="custom-bib-info7"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="custom-bib-info8"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="custom-bib-info9"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="custom-bib-info10"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="Some-custom-field"> + </xsl:attribute-set> + + + + <!--END OF ATTRIBUTE SETS--> + <!--======================================================================--> + + + <!--only apply temlates if docinfo won't be written to front matter--> + <xsl:template match="docinfo"> + <xsl:if test="$bibliographic-pagination='with-body'"> + <xsl:choose> + <xsl:when test="$bibliographic-format = 'list'"> + <fo:list-block role="field-list" + xsl:use-attribute-sets="bibliographic-fields-list-block"> + <xsl:apply-templates mode="list"/> + </fo:list-block> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + </xsl:template> + + <xsl:template match="docinfo" mode="front"> + <xsl:choose> + <xsl:when test="$bibliographic-format = 'list'"> + <fo:list-block role="field-list" + xsl:use-attribute-sets="bibliographic-fields-list-block"> + <xsl:apply-templates mode="list"/> + </fo:list-block> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template name="make-list-item"> + <xsl:param name="role"/> + <xsl:param name="label-text"/> + <xsl:param name="has-children"/> + <xsl:param name="address"/> + <xsl:choose> + <xsl:when test="preceding-sibling::*"> + <fo:list-item role="{$role}" xsl:use-attribute-sets="bibliographic-fields-list-item"> + <xsl:call-template name="list-item-insides"> + <xsl:with-param name="role" select="$role"/> + <xsl:with-param name="label-text" select="$label-text"/> + <xsl:with-param name="has-children" select="$has-children"/> + <xsl:with-param name="address" select="$address"/> + </xsl:call-template> + </fo:list-item> + </xsl:when> + <xsl:otherwise> + <fo:list-item role="{$role}" xsl:use-attribute-sets="bibliographic-fields-first-list-item"> + <xsl:call-template name="list-item-insides"> + <xsl:with-param name="role" select="$role"/> + <xsl:with-param name="label-text" select="$label-text"/> + <xsl:with-param name="has-children" select="$has-children"/> + <xsl:with-param name="address" select="$address"/> + </xsl:call-template> + </fo:list-item> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="list-item-insides"> + <xsl:param name="role"/> + <xsl:param name="label-text"/> + <xsl:param name="has-children"/> + <xsl:param name="address"/> + <fo:list-item-label xsl:use-attribute-sets = "bibliographic-fields-list-item-label"> + <fo:block xsl:use-attribute-sets="bibliographic-fields-item-label-block"> + <xsl:value-of select="$label-text"/> + </fo:block> + </fo:list-item-label> + <fo:list-item-body xsl:use-attribute-sets="bibliographic-fields-item-body"> + <xsl:choose> + <xsl:when test="$has-children = 'True'"> + <xsl:apply-templates mode="list"/> + </xsl:when> + <xsl:when test="$address = 'True'"> + <fo:block xsl:use-attribute-sets = "address-value-block"> + <xsl:apply-templates mode="list"/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:block xsl:use-attribute-sets="bibliographic-fields-block"> + <xsl:apply-templates mode="list"/> + </fo:block> + </xsl:otherwise> + </xsl:choose> + </fo:list-item-body> + </xsl:template> + + <xsl:template match="docinfo/author" mode="list"> + <xsl:call-template name="make-list-item"> + <xsl:with-param name="label-text" select="$author-text"/> + <xsl:with-param name="role" select="'authors'"/> + </xsl:call-template> + </xsl:template> + + <xsl:template match="docinfo/authors" mode="list"> + <xsl:call-template name="make-list-item"> + <xsl:with-param name="label-text" select="$authors-text"/> + <xsl:with-param name="role" select="'author'"/> + <xsl:with-param name="has-children" select="'True'"/> + </xsl:call-template> + </xsl:template> + + <xsl:template match="docinfo/authors/author" mode="list"> + <fo:block xsl:use-attribute-sets="bibliographic-fields-block"> + <xsl:apply-templates mode="list"/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/organization" mode="list"> + <xsl:call-template name="make-list-item"> + <xsl:with-param name="label-text" select="$organization-text"/> + <xsl:with-param name="role" select="'organization'"/> + </xsl:call-template> + </xsl:template> + + <xsl:template match="docinfo/contact" mode="list"> + <xsl:call-template name="make-list-item"> + <xsl:with-param name="label-text" select="$contact-text"/> + <xsl:with-param name="role" select="'contact'"/> + </xsl:call-template> + </xsl:template> + + <xsl:template match="docinfo/status" mode="list"> + <xsl:call-template name="make-list-item"> + <xsl:with-param name="label-text" select="$status-text"/> + <xsl:with-param name="role" select="'status'"/> + </xsl:call-template> + </xsl:template> + + <xsl:template match="docinfo/copyright" mode="list"> + <xsl:call-template name="make-list-item"> + <xsl:with-param name="label-text" select="$copyright-text"/> + <xsl:with-param name="role" select="'copyright'"/> + </xsl:call-template> + </xsl:template> + + <xsl:template match="docinfo/address" mode="list"> + <xsl:call-template name="make-list-item"> + <xsl:with-param name="label-text" select="$address-text"/> + <xsl:with-param name="role" select="'address'"/> + <xsl:with-param name="address" select="'True'"/> + </xsl:call-template> + </xsl:template> + + <xsl:template match="docinfo/version" mode="list"> + <xsl:call-template name="make-list-item"> + <xsl:with-param name="label-text" select="$version-text"/> + <xsl:with-param name="role" select="'version'"/> + </xsl:call-template> + </xsl:template> + + <xsl:template match="docinfo/revision" mode="list"> + <xsl:call-template name="make-list-item"> + <xsl:with-param name="label-text" select="$revision-text"/> + <xsl:with-param name="role" select="'revision'"/> + </xsl:call-template> + </xsl:template> + + <xsl:template match="docinfo/date" mode="list"> + <xsl:call-template name="make-list-item"> + <xsl:with-param name="label-text" select="$version-text"/> + <xsl:with-param name="role" select="'version'"/> + </xsl:call-template> + </xsl:template> + + + <!--custom bibliographic fields--> + + + <xsl:template match="document/docinfo/field" mode="list"> + <xsl:call-template name="make-list-item"> + <xsl:with-param name="label-text"> + <xsl:value-of select="field_name"/> + </xsl:with-param> + <xsl:with-param name="role" select="'generic-field'"/> + <xsl:with-param name="has-children" select="'True'"/> + </xsl:call-template> + </xsl:template> + + <xsl:template match="document/docinfo/field/field_name" mode="list"> + </xsl:template> + + <xsl:template match="document/docinfo/field/field_body" mode="list"> + <xsl:apply-templates mode="list"/> + </xsl:template> + + <xsl:template match="docinfo/field/field_body/paragraph" priority="2" mode="list"> + <fo:block xsl:use-attribute-sets="bibliographic-fields-block"> + <xsl:apply-templates mode="list"/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/field/field_body/paragraph[1]" priority="3" mode="list"> + <fo:block xsl:use-attribute-sets="bibliographic-first-fields-block"> + <xsl:apply-templates mode="list"/> + </fo:block> + </xsl:template> + + <!--==============================================================================--> + <!--NOT AS LIST--> + + <xsl:template match="docinfo/author|docinfo/authors/author"> + <fo:block role="author" xsl:use-attribute-sets="author-block"> + <xsl:value-of select="$author-text"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/authors"> + <fo:block role="authors" xsl:use-attribute-sets="authors-block"> + <xsl:value-of select="$authors-text"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/date"> + <fo:block role="date" xsl:use-attribute-sets="date-block"> + <xsl:value-of select="$date-text"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/organization"> + <fo:block role="organization" xsl:use-attribute-sets="organization-block"> + <xsl:value-of select="$organization-text"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/contact"> + <fo:block role="contact" xsl:use-attribute-sets="contact-block"> + <xsl:value-of select="$contact-text"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/status"> + <fo:block role="status" xsl:use-attribute-sets="status-block"> + <xsl:value-of select="$status-text"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/copyright"> + <fo:block role="copyright" xsl:use-attribute-sets="copyright-block"> + <xsl:value-of select="$copyright-text"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/version"> + <fo:block role="version" xsl:use-attribute-sets="version-block"> + <xsl:value-of select="$version-text"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/revision"> + <fo:block role="revision" xsl:use-attribute-sets="revision-block"> + <xsl:value-of select="$revision-text"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/address"> + <fo:block role="address" xsl:use-attribute-sets="address-block"> + <xsl:value-of select="$address-text"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/field[field_name = 'Some-custom-field']" priority="2"> + <fo:block role="Some-custom-field" xsl:use-attribute-sets="Some-custom-field"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/field"> + <xsl:variable name="custom-num" select="count(preceding-sibling::field) + 1"/> + <xsl:choose> + <xsl:when test="$custom-num = 1"> + <fo:block role="custom-bib-info1" xsl:use-attribute-sets="custom-bib-info1"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$custom-num = 2"> + <fo:block role="custom-bib-info2" xsl:use-attribute-sets="custom-bib-info2"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$custom-num = 3"> + <fo:block role="custom-bib-info3" xsl:use-attribute-sets="custom-bib-info3"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$custom-num = 4"> + <fo:block role="custom-bib-info4" xsl:use-attribute-sets="custom-bib-info4"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$custom-num = 5"> + <fo:block role="custom-bib-info5" xsl:use-attribute-sets="custom-bib-info5"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$custom-num = 6"> + <fo:block role="custom-bib-info6" xsl:use-attribute-sets="custom-bib-info6"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$custom-num = 7"> + <fo:block role="custom-bib-info7" xsl:use-attribute-sets="custom-bib-info7"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$custom-num = 8"> + <fo:block role="custom-bib-info8" xsl:use-attribute-sets="custom-bib-info8"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$custom-num = 9"> + <fo:block role="custom-bib-info9" xsl:use-attribute-sets="custom-bib-info9"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$custom-num = 10"> + <fo:block role="custom-bib-info10" xsl:use-attribute-sets="custom-bib-info10"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="msg"> + <xsl:text>Can only handle 10 custom fields in biblilographic fields entries
</xsl:text> + </xsl:variable> + <xsl:call-template name="error-message"> + <xsl:with-param name="text" select="$msg"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="docinfo/field/field_name"/> + + <xsl:template name="custom-name"> + <xsl:variable name="custom-num"> + <xsl:for-each select="parent::field_body"> + <xsl:for-each select="parent::field"> + <xsl:value-of select="count(preceding-sibling::field) + 1"/> + </xsl:for-each> + </xsl:for-each> + </xsl:variable> + <xsl:choose> + <xsl:when test="$custom-num = 1"> + <xsl:if test="$custom-bib-info1-name"> + <xsl:value-of select="$custom-bib-info1-name"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test="$custom-num = 2"> + <xsl:if test="$custom-bib-info2-name"> + <xsl:value-of select="$custom-bib-info2-name"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test="$custom-num = 3"> + <xsl:if test="$custom-bib-info3-name"> + <xsl:value-of select="$custom-bib-info3-name"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test="$custom-num = 4"> + <xsl:if test="$custom-bib-info5-name"> + <xsl:value-of select="$custom-bib-info5-name"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test="$custom-num = 6"> + <xsl:if test="$custom-bib-info6-name"> + <xsl:value-of select="$custom-bib-info6-name"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test="$custom-num = 7"> + <xsl:if test="$custom-bib-info7-name"> + <xsl:value-of select="$custom-bib-info7-name"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test="$custom-num = 8"> + <xsl:if test="$custom-bib-info8-name"> + <xsl:value-of select="$custom-bib-info8-name"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test="$custom-num = 9"> + <xsl:if test="$custom-bib-info9-name"> + <xsl:value-of select="$custom-bib-info9-name"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test="$custom-num = 10"> + <xsl:if test="$custom-bib-info10-name"> + <xsl:value-of select="$custom-bib-info10-name"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:when> + </xsl:choose> + </xsl:template> + + <xsl:template match="docinfo/field/field_body"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="docinfo/field/field_body/paragraph" priority="2"> + <fo:block xsl:use-attribute-sets="bibliographic-fields-block"> + <xsl:apply-templates mode="list"/> + </fo:block> + </xsl:template> + + <xsl:template match="docinfo/field/field_body/paragraph[1]" priority="3" > + <fo:block xsl:use-attribute-sets="bibliographic-first-fields-block"> + <xsl:call-template name="custom-name"/> + <xsl:apply-templates mode="list"/> + </fo:block> + </xsl:template> +</xsl:stylesheet> + diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/body_directives.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/body_directives.xsl new file mode 100644 index 000000000..b1f3a65b7 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/body_directives.xsl @@ -0,0 +1,302 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <xsl:attribute-set name="topic-block"> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="topic-title-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="topic-paragraph-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">0pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="topic-first-paragraph-block" use-attribute-sets="topic-paragraph-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="sidebar-block"> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="background-color">#FFFFF0</xsl:attribute> + <xsl:attribute name="padding">6pt</xsl:attribute> + <xsl:attribute name="start-indent">10mm</xsl:attribute> + <xsl:attribute name="end-indent">40mm</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="sidebar-title-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="sidebar-subtitle-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + + <xsl:attribute-set name="sidebar-paragraph-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="sidebar-first-paragraph-block" use-attribute-sets="sidebar-paragraph-block"> + <xsl:attribute name="space-after">0pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="rubric-block"> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="font-size">larger</xsl:attribute> + <xsl:attribute name="color">red</xsl:attribute> + </xsl:attribute-set> + + <!--epigraph--> + <xsl:attribute-set name="epigraph-outer-block"> + <xsl:attribute name="start-indent">20mm</xsl:attribute> + <xsl:attribute name="end-indent">20mm</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="text-align">right</xsl:attribute> + <xsl:attribute name="font-style">italic</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="epigraph-paragraph-block"> + <xsl:attribute name="start-indent">inherit</xsl:attribute> + <xsl:attribute name="end-indent">inherit</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="epigraph-first-paragraph-block" use-attribute-sets="block-quote-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + + <xsl:attribute-set name="epigraph-attribution-block"> + <xsl:attribute name="text-align">right</xsl:attribute> + </xsl:attribute-set> + + <!--highlights--> + <xsl:attribute-set name="highlights-outer-block"> + <xsl:attribute name="start-indent">20mm</xsl:attribute> + <xsl:attribute name="end-indent">20mm</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="highlights-paragraph-block"> + <xsl:attribute name="start-indent">inherit</xsl:attribute> + <xsl:attribute name="end-indent">inherit</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="highlights-first-paragraph-block" use-attribute-sets="block-quote-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <!--pull-quote--> + <xsl:attribute-set name="pull-quote-outer-block"> + <xsl:attribute name="start-indent">20mm</xsl:attribute> + <xsl:attribute name="end-indent">20mm</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="pull-quote-paragraph-block"> + <xsl:attribute name="start-indent">inherit</xsl:attribute> + <xsl:attribute name="end-indent">inherit</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="pull-quote-first-paragraph-block" use-attribute-sets="block-quote-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="pull-quote-attribution-block"> + <xsl:attribute name="text-align">right</xsl:attribute> + </xsl:attribute-set> + + <!--container--> + <xsl:attribute-set name="container-outer-block"> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="container-paragraph-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="container-first-paragraph-block" use-attribute-sets="block-quote-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + + <!--END OF ATTRIBUTE SETS--> + + <!--TOPIC--> + <xsl:template match="topic[not(@classes)]"> + <fo:block xsl:use-attribute-sets="topic-block" role="topic"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="topic[not(@classes)]/title"> + <fo:block role="title" xsl:use-attribute-sets = "topic-title-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="topic[not(@classes)]/paragraph[1]" priority="2"> + <fo:block role="topic-paragraph" xsl:use-attribute-sets="topic-first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="topic[not(@classes)]/paragraph"> + <fo:block role="topic-paragraph" xsl:use-attribute-sets="topic-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <!--SIDEBAR--> + <!--SHOULD I generate a warning that FOP can't do sidebars instead?--> + <xsl:template match="sidebar"> + <fo:block xsl:use-attribute-sets="sidebar-block" role="sidebar"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="sidebar/title"> + <fo:block role="title" xsl:use-attribute-sets = "sidebar-title-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="sidebar/subtitle"> + <fo:block role="subtitle" xsl:use-attribute-sets = "sidebar-subtitle-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="sidebar/paragraph[1]" priority="2"> + <fo:block role="sidebar-paragraph" xsl:use-attribute-sets="sidebar-first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="sidebar/paragraph"> + <fo:block role="sidebar-paragraph" xsl:use-attribute-sets="sidebar-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <!--RUBRIC--> + <xsl:template match="rubric[not(@classes)]"> + <fo:block role="rubric" xsl:use-attribute-sets="rubric-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <!--EPIGRAPH--> + <xsl:template match="block_quote[@classes='epigraph']"> + <fo:block role="epigraph" xsl:use-attribute-sets = "epigraph-outer-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[@classes='epigraph']/paragraph"> + <fo:block role="epigraph-paragraph" xsl:use-attribute-sets = "epigraph-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[@classes='epigraph']/paragraph[1]" priority="2"> + <fo:block role="epigraph-paragraph" xsl:use-attribute-sets = "epigraph-first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[@classes='epigraph']/attribution"> + <fo:block role="epigraph-attribution" xsl:use-attribute-sets = "epigraph-attribution-block"> + <xsl:value-of select="$text-before-epigraph-attribution"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <!--HIGHLIGHTS--> + <xsl:template match="block_quote[@classes='highlights']"> + <fo:block role="highlights" xsl:use-attribute-sets = "highlights-outer-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[@classes='highlights']/paragraph"> + <fo:block role="highlights-paragraph" xsl:use-attribute-sets = "highlights-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[@classes='highlights']/paragraph[1]" priority="2"> + <fo:block role="highlights-paragraph" xsl:use-attribute-sets = "highlights-first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <!--PULL-QUOTE--> + <xsl:template match="block_quote[@classes='pull-quote']"> + <fo:block role="pull-quote" xsl:use-attribute-sets = "pull-quote-outer-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[@classes='pull-quote']/paragraph"> + <fo:block role="pull-quote-paragraph" xsl:use-attribute-sets = "pull-quote-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[@classes='pull-quote']/paragraph[1]" priority="2"> + <fo:block role="pull-quote-paragraph" xsl:use-attribute-sets = "pull-quote-first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[@classes='pull-quote']/attribution"> + <fo:block role="pull-quote-attribution" xsl:use-attribute-sets = "pull-quote-attribution-block"> + <xsl:value-of select="$text-before-pull-quote-attribution"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <!--CONTAINER--> + <xsl:template match="container"> + <fo:block role="container" xsl:use-attribute-sets = "container-outer-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="container/paragraph"> + <fo:block role="container-paragraph" xsl:use-attribute-sets = "container-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="container/paragraph[1]" priority="2"> + <fo:block role="container-paragraph" xsl:use-attribute-sets = "container-first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="compound"> + <xsl:apply-templates/> + </xsl:template> + + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/body_elements.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/body_elements.xsl new file mode 100644 index 000000000..a8744a0f0 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/body_elements.xsl @@ -0,0 +1,230 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <xsl:attribute-set name="paragraph-block"> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="first-paragraph-block" use-attribute-sets="paragraph-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="literal-block"> + <xsl:attribute name="font-family">monospace</xsl:attribute> + <xsl:attribute name="font-size">8</xsl:attribute> + <xsl:attribute name="white-space">pre</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + + <xsl:attribute-set name="transition-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="document-title-block"> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="font-size">24pt</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="document-title-page-block"> + <!-- + <xsl:attribute name="break-after">page</xsl:attribute> + --> + </xsl:attribute-set> + + <xsl:attribute-set name="document-subtitle-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="font-size">18pt</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="block-quote-outer-block"> + <xsl:attribute name="start-indent">20mm</xsl:attribute> + <xsl:attribute name="end-indent">20mm</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="block-quote-paragraph-block"> + <!-- + <xsl:attribute name="start-indent">inherit</xsl:attribute> + <xsl:attribute name="end-indent">inherit</xsl:attribute> + --> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="block-quote-first-paragraph-block" use-attribute-sets="block-quote-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + + <xsl:attribute-set name="block-quote-attribution-block"> + <xsl:attribute name="text-align">right</xsl:attribute> + </xsl:attribute-set> + + <xsl:template name="get-preceding-sib"> + <xsl:choose> + <xsl:when test="self::comment"> + <xsl:for-each select="preceding-sibling::*[1]"> + <xsl:call-template name="get-preceding-sib"/> + </xsl:for-each> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="name(.)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!--default paragraphs--> + <xsl:template match="section/paragraph|document/paragraph|compound/paragraph"> + <xsl:variable name="prev-sib"> + <xsl:for-each select="preceding-sibling::*[1]"> + <xsl:call-template name="get-preceding-sib"/> + </xsl:for-each> + </xsl:variable> + <xsl:choose> + <xsl:when test="not(preceding-sibling::*)"> + <xsl:call-template name="default-first-paragraph"/> + </xsl:when> + <xsl:when test="$prev-sib != 'paragraph'"> + <xsl:call-template name="default-first-paragraph"/> + </xsl:when> + <!-- + <xsl:when test="$prev-sib = 'topic' or $prev-sib = 'table' + or $prev-sib = 'attention' or $prev-sib = 'caution' or $prev-sib = 'danger' + or $prev-sib = 'danger' or $prev-sib = 'error' or $prev-sib = 'hint' + or $prev-sib = 'important' or $prev-sib = 'note' or $prev-sib = 'tip' or + $prev-sib = 'warning' or $prev-sib = 'admonition' or $prev-sib = 'bullet_list' + or $prev-sib = 'enumerated_list' or $prev-sib = 'definition_list' or + $prev-sib = 'field_list' or $prev-sib = 'option_list' or $prev-sib = 'line_block' + or $prev-sib = 'literal_block' or $prev-sib = 'doctest_block' or + $prev-sib = 'transition' or $prev-sib = 'title' or $prev-sib = 'subtitle' + or $prev-sib = 'block_quote' or $prev-sib = 'sidebar' or $prev-sib = 'rubric' + or $prev-sib = 'container' or $prev-sib = 'compound' or $prev-sib = 'decoration' + "> + <xsl:call-template name="default-first-paragraph"/> + </xsl:when> + --> + <xsl:otherwise> + <xsl:call-template name="default-paragraph"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="default-first-paragraph"> + <xsl:choose> + <xsl:when test="@ids"> + <fo:block role="first-paragraph" xsl:use-attribute-sets="first-paragraph-block" id="{@ids}"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:block role="first-paragraph" xsl:use-attribute-sets="first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="default-paragraph"> + <xsl:choose> + <xsl:when test="@ids"> + <fo:block role="paragraph" xsl:use-attribute-sets="paragraph-block" id="{@ids}"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:block role="paragraph" xsl:use-attribute-sets="paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="literal_block"> + <fo:block xsl:use-attribute-sets="literal-block" role="literal-block"><xsl:apply-templates/></fo:block> + </xsl:template> + + + <xsl:template match="doctest_block"> + <fo:block xsl:use-attribute-sets="literal-block" role="doctest-block"><xsl:apply-templates/></fo:block> + </xsl:template> + + <xsl:template match="transition"> + <fo:block xsl:use-attribute-sets = "transition-block" role="transition"> + <!-- + <fo:inline><fo:leader leader-pattern="rule" leader-length="3in"/></fo:inline> + --> + <xsl:value-of select="$transition-text"/> + </fo:block> + </xsl:template> + + <xsl:template match="document/subtitle"> + <xsl:if test="$title-pagination='with-body'"> + <fo:block xsl:use-attribute-sets="document-subtitle-block" role="subtitle"> + <xsl:apply-templates/> + </fo:block> + </xsl:if> + </xsl:template> + + <xsl:template match="document/title"> + <xsl:if test="$title-pagination='with-body'"> + <fo:block xsl:use-attribute-sets="document-title-block" role="title"> + <xsl:apply-templates/> + </fo:block> + </xsl:if> + </xsl:template> + + <xsl:template match="document/title" mode="front"> + <fo:block xsl:use-attribute-sets="document-title-page-block" role="title-page"> + <fo:block xsl:use-attribute-sets="document-title-block" role="title"> + <xsl:apply-templates/> + </fo:block> + <xsl:apply-templates select="/document/subtitle" mode="front"/> + </fo:block> + </xsl:template> + + <xsl:template match="document/subtitle" mode="front"> + <fo:block xsl:use-attribute-sets="document-subtitle-block" role="subtitle"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[not(@classes)]"> + <fo:block role="block-quote" xsl:use-attribute-sets = "block-quote-outer-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[not(@classes)]/paragraph"> + <fo:block role="block-quote" xsl:use-attribute-sets = "block-quote-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[not(@classes)]/paragraph[1]" priority="2"> + <fo:block role="block-quote" xsl:use-attribute-sets = "block-quote-first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="block_quote[not(@classes)]/attribution"> + <fo:block role="block-quote" xsl:use-attribute-sets = "block-quote-attribution-block"> + <xsl:value-of select="$text-before-block-quote-attribution"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="comment"/> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/bullet_list.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/bullet_list.xsl new file mode 100644 index 000000000..2cc943dc4 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/bullet_list.xsl @@ -0,0 +1,174 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <!-- For the bullet list. "The provisional-distance-between-starts + property of the list-block specifies the distance bewteen the start of the + label (the bullet, for example) and the actual start of the list content" + (Pawson, 100) + + Element is fo:block-list + --> + <xsl:attribute-set name="bullet-list-block" > + <xsl:attribute name="start-indent">5mm</xsl:attribute> + <xsl:attribute name="provisional-distance-between-starts">5mm</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <!--for the bullet list item. FO element is list-item. docutils element is list_item.--> + <xsl:attribute-set name="bullet-list-item"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <!--for the bullet list item last item. Space may be different. Element is fo:list-item.--> + <xsl:attribute-set name="bullet-first-list-item" use-attribute-sets="bullet-list-item"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="bullet-level2-list-item"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <!--for the bullet list item last item. Space may be different. Element is fo:list-item.--> + <xsl:attribute-set name="bullet-level2-first-list-item" use-attribute-sets="bullet-level2-list-item"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <!--Element is fo:list-item-label.--> + <xsl:attribute-set name="bullet-list-item-label"> + <xsl:attribute name="end-indent">label-end()</xsl:attribute> + </xsl:attribute-set> + + <!--for the block in the bullet label fo:list-item-lable/block. Element is fo:block.`doc`--> + <xsl:attribute-set name="bullet-list-item-label-block"> + </xsl:attribute-set> + + <!--for the option list item body. Element is fo:list-item-body.--> + <xsl:attribute-set name="bullet-list-item-body"> + <xsl:attribute name="start-indent">body-start()</xsl:attribute> + </xsl:attribute-set> + + <!--for the block of the body (paragraphs) in an bullet list. Element is fo:block.--> + <xsl:attribute-set name="bullet-list-item-body-block"> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <!--same as above--> + <xsl:attribute-set name="bullet-level2-list-block" > + <xsl:attribute name="start-indent">15mm</xsl:attribute> + <xsl:attribute name="provisional-distance-between-starts">5mm</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:template match="bullet_list"> + <fo:list-block xsl:use-attribute-sets="bullet-list-block" role="bullet-list"> + <xsl:apply-templates/> + </fo:list-block> + </xsl:template> + + <xsl:template name="make-bullet"> + <xsl:variable name="level" select="count(ancestor::bullet_list)"/> + <xsl:choose> + <xsl:when test="$level = 1"> + <xsl:choose> + <xsl:when test="$bullet-text != ''"> + <xsl:value-of select="$bullet-text"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="../@bullet"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="$bullet-text-level2 != ''"> + <xsl:value-of select="$bullet-text-level2"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="../@bullet"/> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="bullet_list/list_item"> + <fo:list-item xsl:use-attribute-sets="bullet-list-item"> + <fo:list-item-label xsl:use-attribute-sets="bullet-list-item-label"> + <fo:block xsl:use-attribute-sets = "bullet-list-item-label-block"><xsl:call-template name="make-bullet"/></fo:block> + </fo:list-item-label> + <fo:list-item-body xsl:use-attribute-sets="bullet-list-item-body"> + <xsl:apply-templates/> + </fo:list-item-body> + </fo:list-item> + </xsl:template> + + <xsl:template match="bullet_list/list_item[1]" priority="2"> + <fo:list-item xsl:use-attribute-sets="bullet-first-list-item"> + <fo:list-item-label xsl:use-attribute-sets="bullet-list-item-label"> + <fo:block xsl:use-attribute-sets = "bullet-list-item-label-block"><xsl:call-template name="make-bullet"/></fo:block> + </fo:list-item-label> + <fo:list-item-body xsl:use-attribute-sets="bullet-list-item-body"> + <xsl:apply-templates/> + </fo:list-item-body> + </fo:list-item> + </xsl:template> + + <xsl:template match="bullet_list/list_item/bullet_list/list_item" priority="3"> + <fo:list-item xsl:use-attribute-sets="bullet-level2-list-item"> + <fo:list-item-label xsl:use-attribute-sets="bullet-list-item-label"> + <fo:block xsl:use-attribute-sets = "bullet-list-item-label-block"><xsl:call-template name="make-bullet"/></fo:block> + </fo:list-item-label> + <fo:list-item-body xsl:use-attribute-sets="bullet-list-item-body"> + <xsl:apply-templates/> + </fo:list-item-body> + </fo:list-item> + </xsl:template> + + <xsl:template match="bullet_list/list_item/bullet_list/list_item[1]" priority="4"> + <fo:list-item xsl:use-attribute-sets="bullet-level2-first-list-item"> + <fo:list-item-label xsl:use-attribute-sets="bullet-list-item-label"> + <fo:block xsl:use-attribute-sets = "bullet-list-item-label-block"><xsl:call-template name="make-bullet"/></fo:block> + </fo:list-item-label> + <fo:list-item-body xsl:use-attribute-sets="bullet-list-item-body"> + <xsl:apply-templates/> + </fo:list-item-body> + </fo:list-item> + </xsl:template> + + <xsl:template match="bullet_list/list_item/paragraph"> + <fo:block xsl:use-attribute-sets="bullet-list-item-body-block" role="bullet-list-paragraph"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="list_item/bullet_list" priority="2"> + <xsl:variable name="level" select="count(ancestor::list_item)"/> + <xsl:choose> + <xsl:when test="$level = 1"> + <fo:list-block xsl:use-attribute-sets="bullet-level2-list-block" role="bullet-list2"> + <xsl:apply-templates/> + </fo:list-block> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Cannot format lists more than 2 levels deep</xsl:text> + </xsl:message> + <xsl:choose> + <xsl:when test="$strict='True'"> + <xsl:message terminate="yes">Processinng stylesheets now quiting</xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:message>Not formatting text</xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/citation.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/citation.xsl new file mode 100644 index 000000000..312e9c83d --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/citation.xsl @@ -0,0 +1,31 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + + <!-- $Id$ --> + + <!--Since there is no accepted way to render the limited citation + element, I am simply using it like a substition--> + + <xsl:key name="citation" match="citation" use="@ids"/> + + <xsl:template match= "citation_reference"> + <xsl:apply-templates select="key('citation', @refid)" mode="citation"/> + </xsl:template> + + <xsl:template match="citation" mode="citation"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="citation/label"/> + + <xsl:template match="citation/paragraph"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="citation"/> + +</xsl:stylesheet> + diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/definition_list.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/definition_list.xsl new file mode 100644 index 000000000..75dcd8085 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/definition_list.xsl @@ -0,0 +1,141 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + <!--Definition list attriute sets--> + + <!--the block that wraps all the other blocks. Use to + contol space before the list and the the text before and after--> + <xsl:attribute-set name="definition-list-block" > + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <!--controls properties of the whole item. Can be used to control space + between items.--> + <xsl:attribute-set name="definition-list-item-block" > + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <!--Sames as definition-list-item-block, but for the first block. + It inherits from the definition-list-item-block. + --> + <xsl:attribute-set name="definition-list-item-first-block" use-attribute-sets="definition-list-item-block" > + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <!--for the bock of the the term. Can be used to control spacing between + term and definition, but don't use with space before, or you won't be able + to control spacing before list--> + <xsl:attribute-set name="definition-term-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="definition-block"> + </xsl:attribute-set> + + + <!-- + <xsl:attribute-set name="definition-term-inline"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="role">definition-term-inline</xsl:attribute> + </xsl:attribute-set> + --> + + <xsl:attribute-set name="classifier-inline"> + <xsl:attribute name="font-style">italic</xsl:attribute> + </xsl:attribute-set> + + + <!--for all the blocks in the definition. There are not other blocks below + (nested) in this one. Use to control the space between paragraphs by + setting the space-bfore attribute. Don't use the space-after attribute, or + you won't be able to contorl the spacing between items--> + + <xsl:attribute-set name="definition-paragraph-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="start-indent">30pt</xsl:attribute> + </xsl:attribute-set> + + <!-- + Same as the definition-parapgraph-block, except this one contorls the first + parapgraph. It doesn't make sense to change any of the attributes here, since + it inherits from the definitionn-paragraph-block. --> + <xsl:attribute-set name="definition-first-paragraph-block" use-attribute-sets="definition-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <!--END OF ATTRIBUTE SETS--> + + <xsl:template match="definition_list"> + <fo:block role="definition-list" xsl:use-attribute-sets="definition-list-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="definition_list_item"> + <fo:block xsl:use-attribute-sets = "definition-list-item-block" role="definition-list-item"> + <fo:block role="term" xsl:use-attribute-sets="definition-term-block"> + <xsl:apply-templates select="term"/> + <xsl:apply-templates select="classifier"/> + </fo:block> + <xsl:apply-templates select="definition"/> + </fo:block> + </xsl:template> + + <xsl:template match="definition_list_item[1]" priority="2"> + <fo:block xsl:use-attribute-sets = "definition-list-item-first-block" role="definition-list-item"> + <fo:block role="term" xsl:use-attribute-sets="definition-term-block"> + <xsl:apply-templates select="term"/> + <xsl:apply-templates select="classifier"/> + </fo:block> + <xsl:apply-templates select="definition"/> + </fo:block> + </xsl:template> + + <xsl:template match="definition_list_item/term"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="definition_list_item/definition"> + <fo:block role="definition" xsl:use-attribute-sets = "definition-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="definition/paragraph[1]" priority="2"> + <fo:block xsl:use-attribute-sets="definition-first-paragraph-block" + role="definition-paragraph"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="definition/paragraph"> + <fo:block xsl:use-attribute-sets="definition-paragraph-block" + role="definition-paragraph"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="classifier"> + <xsl:text> :</xsl:text> + <fo:inline xsl:use-attribute-sets="classifier-inline"> + <xsl:apply-templates /> + </fo:inline> + </xsl:template> + + + <xsl:template match="list_item/definition_list" priority="2"> + <xsl:message terminate="yes"> + <xsl:text>FATAL: Should not have nested definition lists</xsl:text> + <xsl:text>Processinng stylesheets now quiting</xsl:text> + </xsl:message> + </xsl:template> + + + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/docutils_to_fo.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/docutils_to_fo.xsl new file mode 100644 index 000000000..5fa6e6d78 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/docutils_to_fo.xsl @@ -0,0 +1,42 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" +> + <!-- $Id$ --> + + <xsl:include href = "parameters.xsl"/> + <xsl:include href = "root.xsl"/> + <xsl:include href = "page.xsl"/> + <xsl:include href = "front_matter.xsl"/> + <xsl:include href = "toc.xsl"/> + <xsl:include href = "header_footer.xsl"/> + <xsl:include href = "bibliographic_fields.xsl"/> + <xsl:include href = "section.xsl"/> + <xsl:include href = "body_elements.xsl"/> + <xsl:include href = "bullet_list.xsl"/> + <xsl:include href = "enumerated_list.xsl"/> + <xsl:include href = "definition_list.xsl"/> + <xsl:include href = "field_list.xsl"/> + <xsl:include href = "option_list.xsl"/> + <xsl:include href = "line_block.xsl"/> + <xsl:include href = "table.xsl"/> + <xsl:include href = "table_extended.xsl"/> + <xsl:include href = "table_extended2.xsl"/> + <xsl:include href = "table_long.xsl"/> + <xsl:include href = "footnote.xsl"/> + <xsl:include href = "citation.xsl"/> + <xsl:include href = "admonitions.xsl"/> + <xsl:include href = "image_figure.xsl"/> + <xsl:include href = "body_directives.xsl"/> + <xsl:include href = "inline.xsl"/> + <xsl:include href = "misc.xsl"/> + <xsl:include href = "error.xsl"/> + <xsl:include href = "util.xsl"/> + + + <xsl:output method="xml" encoding="UTF-8"/> + + +</xsl:stylesheet> + diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/enumerated_list.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/enumerated_list.xsl new file mode 100644 index 000000000..96a2b53c2 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/enumerated_list.xsl @@ -0,0 +1,148 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + <xsl:attribute-set name="enumerated-list-block" > + <xsl:attribute name="start-indent">5mm</xsl:attribute> + <xsl:attribute name="provisional-distance-between-starts">10mm</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="enumerated-level2-list-block" > + <xsl:attribute name="start-indent">15mm</xsl:attribute> + <xsl:attribute name="provisional-distance-between-starts">10mm</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + + <xsl:attribute-set name="enumerated-list-item"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="enumerated-first-list-item" use-attribute-sets="enumerated-list-item"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="enumerated-level2-list-item"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="enumerated-level2-first-list-item" + use-attribute-sets="enumerated-level2-list-item"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="enumerated-list-item-label"> + <xsl:attribute name="end-indent">label-end()</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="enumerated-list-item-body"> + <xsl:attribute name="start-indent">body-start()</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="enumerated-list-item-body-block"> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + + <xsl:template match="enumerated_list"> + <fo:list-block xsl:use-attribute-sets="enumerated-list-block"> + <xsl:apply-templates/> + </fo:list-block> + </xsl:template> + + <xsl:template name="make-enum-list-contents"> + <xsl:variable name="format"> + <xsl:variable name="desc" select="../@enumtype"/> + <xsl:choose> + <xsl:when test="$desc = 'arabic'"> + <xsl:text>1</xsl:text> + </xsl:when> + <xsl:when test="$desc = 'upperalpha'"> + <xsl:text>A</xsl:text> + </xsl:when> + <xsl:when test="$desc = 'loweralpha'"> + <xsl:text>a</xsl:text> + </xsl:when> + <xsl:when test="$desc = 'lowerroman'"> + <xsl:text>i</xsl:text> + </xsl:when> + <xsl:when test="$desc = 'upperroman'"> + <xsl:text>I</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:variable> + <fo:list-item-label xsl:use-attribute-sets="enumerated-list-item-label"> + <fo:block> + <xsl:value-of select="../@prefix"/> + <xsl:number from="enumerated_list" format="{$format}"/> + <xsl:value-of select="../@suffix"/> + </fo:block> + </fo:list-item-label> + <fo:list-item-body xsl:use-attribute-sets="enumerated-list-item-body"> + <xsl:apply-templates/> + </fo:list-item-body> + </xsl:template> + + <xsl:template match="enumerated_list/list_item"> + <fo:list-item xsl:use-attribute-sets="enumerated-list-item"> + <xsl:call-template name="make-enum-list-contents"/> + </fo:list-item> + </xsl:template> + + <xsl:template match="enumerated_list/list_item/enumerated_list/list_item" priority="3"> + <fo:list-item xsl:use-attribute-sets="enumerated-level2-list-item"> + <xsl:call-template name="make-enum-list-contents"/> + </fo:list-item> + </xsl:template> + + <xsl:template match="enumerated_list/list_item[1]" priority="2"> + <fo:list-item xsl:use-attribute-sets="enumerated-first-list-item"> + <xsl:call-template name="make-enum-list-contents"/> + </fo:list-item> + </xsl:template> + + <xsl:template match="enumerated_list/list_item/enumerated_list/list_item[1]" priority="4"> + <fo:list-item xsl:use-attribute-sets="enumerated-level2-first-list-item"> + <xsl:call-template name="make-enum-list-contents"/> + </fo:list-item> + </xsl:template> + + <xsl:template match="enumerated_list/list_item/paragraph"> + <fo:block xsl:use-attribute-sets="enumerated-list-item-body-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="list_item/enumerated_list" priority="2"> + <xsl:variable name="level" select="count(ancestor::list_item)"/> + <xsl:choose> + <xsl:when test="$level = 1"> + <fo:list-block xsl:use-attribute-sets="enumerated-level2-list-block"> + <xsl:apply-templates/> + </fo:list-block> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Cannot format lists more than 2 levels deep</xsl:text> + </xsl:message> + <xsl:choose> + <xsl:when test="$strict='True'"> + <xsl:message terminate="yes">Processinng stylesheets now quiting</xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:message>Not formatting text</xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + +</xsl:stylesheet> + + diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/error.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/error.xsl new file mode 100644 index 000000000..e25e2da35 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/error.xsl @@ -0,0 +1,386 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <xsl:template name="test-params"> + + <xsl:if test= "$title-pagination != 'with-front' and $title-pagination != 'with-toc' and + $title-pagination != 'with-body'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$page-layout"/> + <xsl:text>" not a valid value for param "title-pagination"
</xsl:text> + <xsl:text>Valid values are 'with-front', 'with-body', or 'with-body'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + + <xsl:if test= "$bibliographic-pagination != 'with-front' and $bibliographic-pagination != 'with-toc' and + $bibliographic-pagination != 'with-body'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$page-layout"/> + <xsl:text>" not a valid value for param "bibliographic-pagination"
</xsl:text> + <xsl:text>Valid values are 'with-front', 'with-body', or 'with-body'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + + <xsl:if test= "$dedication-pagination != 'with-front' and $dedication-pagination != 'with-toc' and + $dedication-pagination != 'with-body'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$page-layout"/> + <xsl:text>" not a valid value for param "dedication-pagination"
</xsl:text> + <xsl:text>Valid values are 'with-front', 'with-body', or 'with-body'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + + <xsl:if test= "$abstract-pagination != 'with-front' and $abstract-pagination != 'with-toc' and + $abstract-pagination != 'with-body'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$page-layout"/> + <xsl:text>" not a valid value for param "abstract-pagination"
</xsl:text> + <xsl:text>Valid values are 'with-front', 'with-body', or 'with-body'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + + <xsl:if test= "$toc-pagination != 'with-front' and $toc-pagination != 'with-toc' and + $toc-pagination != 'with-body'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$page-layout"/> + <xsl:text>" not a valid value for param "toc-pagination"
</xsl:text> + <xsl:text>Valid values are 'with-front', 'with-body', or 'with-body'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + + <xsl:if test= "$page-layout != '' and $page-layout != 'simple' and $page-layout != 'odd-even' + and $page-layout != 'first-odd-even' and $page-layout != 'first'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$page-layout"/> + <xsl:text>" not a valid value for param "page-layout"
</xsl:text> + <xsl:text>Valid values are 'simple', 'odd-even', 'first', or 'first-odd-even'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:if test= "$option-list-format != 'list' and $option-list-format != 'definition'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$option-list-format"/> + <xsl:text>" not a valid value for param "option-list-format"
</xsl:text> + <xsl:text>Valid values are 'list', and 'definition'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:if test ="$number-verse != '' and string($number-verse + 1 ) = 'NaN'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$number-verse"/> + <xsl:text>" not a valid value for param "number-verse"
</xsl:text> + <xsl:text>Please use a number
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:if test= "$table-title-placement != 'bottom' and $table-title-placement != 'top'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$table-title-placement"/> + <xsl:text>" not a valid value for param "table-title-placement"
</xsl:text> + <xsl:text>Valid values are 'top', and 'bottom'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:if test= "$footnote-style != 'list' and $footnote-style != 'traditional'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$footnote-style"/> + <xsl:text>" not a valid value for param "footnote-style"
</xsl:text> + <xsl:text>Valid values are 'list', and 'traditional'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:if test= "$footnote-placement != 'footnote' and $footnote-placement != 'endnote'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$footnote-placement"/> + <xsl:text>" not a valid value for param "footnote-placement"
</xsl:text> + <xsl:text>Valid values are 'footnote', and 'endnote'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:if test= "$internal-link-type != 'link' and $internal-link-type != 'page' + and $internal-link-type != 'page-link'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$internal-link-type"/> + <xsl:text>" not a valid value for param "internal-link-type"
</xsl:text> + <xsl:text>Valid values are 'link', and 'page', and 'page-link'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:if test= "$bibliographic-format != 'list' and $bibliographic-format != 'normal' + and $bibliographic-format != ''"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$bibliographic-format"/> + <xsl:text>" not a valid value for param "bibliographic-format"
</xsl:text> + <xsl:text>Valid values are 'list', 'normal', or ''.
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + + <!--test $font-order parameter for valid values--> + <xsl:call-template name="test-order"> + <xsl:with-param name="order" select="$front-order"/> + </xsl:call-template> + + <!--test $front order to make sure appropriate values included--> + <xsl:if test = "$title-exists and not(contains($front-order, 'title'))"> + <xsl:variable name="msg"> + <xsl:text>'title' has not been declared in parameter 'front-order', </xsl:text> + <xsl:text>yet this element exists.
</xsl:text> + <xsl:text>Please fix. (For example, 'title, bibliographic, dedication, abstract, toc')
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:if test = "$bibliographic-exists and not(contains($front-order, 'bibliographic'))"> + <xsl:variable name="msg"> + <xsl:text>'bibliographic' has not been declared in parameter 'front-order', </xsl:text> + <xsl:text>yet this element exists.
</xsl:text> + <xsl:text>Please fix. (For example, 'title, bibliographic, dedication, abstract, toc')
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:if test = "$dedication-exists and not(contains($front-order, 'dedication'))"> + <xsl:variable name="msg"> + <xsl:text>'dedication' has not been declared in parameter 'front-order', </xsl:text> + <xsl:text>yet this element exists.
</xsl:text> + <xsl:text>Please fix. (For example, 'title, bibliographic, dedication, abstract, toc')
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:if test = "$abstract-exists and not(contains($front-order, 'abstract'))"> + <xsl:variable name="msg"> + <xsl:text>'abstract' has not been declared in parameter 'front-order', </xsl:text> + <xsl:text>yet this element exists.
</xsl:text> + <xsl:text>Please fix. (For example, 'title, bibliographic, dedication, abstract, toc')
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:if test = "$toc-exists and not(contains($front-order, 'toc'))"> + <xsl:variable name="msg"> + <xsl:text>'toc' has not been declared in parameter 'front-order', </xsl:text> + <xsl:text>yet this element exists.
</xsl:text> + <xsl:text>Please fix. (For example, 'title, bibliographic, dedication, abstract, toc')
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + </xsl:template> + + <xsl:template name="test-order"> + <xsl:param name="order"/> + <xsl:param name="first-run">True</xsl:param> + <xsl:variable name="order-string"> + <xsl:choose> + <xsl:when test="$first-run='True'"> + <xsl:value-of select="concat($order, ',')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$order"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="matter" select="normalize-space(substring-before($order-string, ','))"/> + <xsl:if test="$matter != ''"> + <xsl:if test = "$matter != 'title' and $matter != 'bibliographic' and + $matter != 'dedication' and $matter != 'abstract' and $matter != 'toc'"> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$matter"/> + <xsl:text>" not a valid area for parameter 'front-order'
</xsl:text> + <xsl:text>Valid values are 'title', 'bibliographic', 'dedication',</xsl:text> + <xsl:text> 'abstract', and 'toc'
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:call-template name="test-order"> + <xsl:with-param name="order" select="substring-after($order-string, ',')"/> + <xsl:with-param name="first-run" select="'False'"/> + </xsl:call-template> + </xsl:if> + </xsl:template> + + <xsl:template name="trace-ancestors"> + <xsl:param name="children"/> + <xsl:choose> + <xsl:when test="parent::*"> + <xsl:for-each select="parent::*"> + <xsl:call-template name="trace-ancestors"> + <xsl:with-param name="children"> + <xsl:value-of select="name(.)"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="$children"/> + </xsl:with-param> + </xsl:call-template> + </xsl:for-each> + </xsl:when> + <xsl:otherwise> + <xsl:text>/</xsl:text> + <xsl:value-of select="$children"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="trace-siblings"> + <xsl:param name="previous-siblings"/> + <xsl:choose> + <xsl:when test="preceding-sibling::*"> + <xsl:for-each select="preceding-sibling::*[1]"> + <xsl:call-template name="trace-siblings"> + <xsl:with-param name="previous-siblings"> + <xsl:value-of select="name(.)"/> + <xsl:text>=></xsl:text> + <xsl:value-of select="$previous-siblings"/> + </xsl:with-param> + </xsl:call-template> + </xsl:for-each> + </xsl:when> + <xsl:otherwise> + <xsl:text>siblings: </xsl:text> + <xsl:value-of select="$previous-siblings"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template name="trace"> + <xsl:variable name="ancestors"> + <xsl:call-template name="trace-ancestors"> + <xsl:with-param name="children" select="name(.)"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="siblings"> + <xsl:call-template name="trace-siblings"/> + </xsl:variable> + <xsl:value-of select="$ancestors"/> + <xsl:text>[</xsl:text> + <xsl:for-each select="@*"> + <xsl:value-of select="name(.)"/> + <xsl:text>="</xsl:text> + <xsl:value-of select="."/> + <xsl:text>" </xsl:text> + </xsl:for-each> + <xsl:text>]</xsl:text> + <xsl:text>
</xsl:text> + <xsl:value-of select="$siblings"/> + </xsl:template> + + + <xsl:template match="*"> + <xsl:variable name="trace"> + <xsl:call-template name="trace"/> + </xsl:variable> + <xsl:message> + <xsl:text>no match for </xsl:text> + <xsl:value-of select="$trace"/> + </xsl:message> + <xsl:choose> + <xsl:when test="$strict='True'"> + <xsl:message terminate="yes"> + <xsl:text>Processing XSLT Stylesheets now quiting</xsl:text> + </xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Not processing text in this element.</xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="system_message[@type='ERROR']"> + <xsl:message> + <xsl:text>Error when converting to XML:
</xsl:text> + <xsl:value-of select="."/> + </xsl:message> + <xsl:if test="$strict='True'"> + <xsl:call-template name="quit-message"/> + </xsl:if> + </xsl:template> + + <xsl:template match="system_message[@type='ERROR']/paragraph| system_message[@type='ERROR']/literal_block" priority="2"/> + + <xsl:template name="quit-message"> + <xsl:param name="msg"/> + <xsl:message terminate="yes"> + <xsl:value-of select="$msg"/> + <xsl:text>Processing stylesheets now quitting.</xsl:text> + </xsl:message> + </xsl:template> + + <xsl:template name="error-message"> + <xsl:param name="text"/> + <xsl:message> + <xsl:value-of select="$text"/> + </xsl:message> + <xsl:choose> + <xsl:when test="$strict='True'"> + <xsl:call-template name="quit-message"/> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Not processing text for this element.</xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/field_list.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/field_list.xsl new file mode 100644 index 000000000..1e2afaf28 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/field_list.xsl @@ -0,0 +1,90 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <!--for the list-block that wraps the whole list--> + <xsl:attribute-set name="field-list-block" > + <xsl:attribute name="start-indent">0mm</xsl:attribute> + <xsl:attribute name="provisional-distance-between-starts">30mm</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <!--Can control space between items--> + <xsl:attribute-set name="field-list-item"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="field-first-list-item" use-attribute-sets="field-list-item"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="field-list-item-label"> + <xsl:attribute name="end-indent">label-end()</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="field-list-item-body"> + <xsl:attribute name="start-indent">body-start()</xsl:attribute> + </xsl:attribute-set> + + <!--element is fo:block. Can control space between + paragraphs when items has multiple paragraphs--> + <xsl:attribute-set name="field-body-block"> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="field-list-item-label-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set> + + + <!--END attribute sets--> + + + + + <xsl:template match="field_list"> + <fo:list-block role="field-list" xsl:use-attribute-sets="field-list-block"> + <xsl:apply-templates/> + </fo:list-block> + </xsl:template> + + <xsl:template match="field_list/field"> + <fo:list-item xsl:use-attribute-sets="field-list-item"> + <xsl:apply-templates/> + </fo:list-item> + </xsl:template> + + + <!--last item, may be different for space--> + <xsl:template match="field_list/field[1]" priority="2"> + <fo:list-item xsl:use-attribute-sets="field-first-list-item"> + <xsl:apply-templates/> + </fo:list-item> + </xsl:template> + + <xsl:template match="field_list/field/field_body/paragraph"> + <fo:block xsl:use-attribute-sets="field-body-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="field_list/field/field_body"> + <fo:list-item-body xsl:use-attribute-sets="field-list-item-body"> + <xsl:apply-templates/> + </fo:list-item-body> + </xsl:template> + + <xsl:template match="field_list/field/field_name"> + <fo:list-item-label xsl:use-attribute-sets="field-list-item-label"> + <fo:block xsl:use-attribute-sets="field-list-item-label-block"> + <xsl:apply-templates/> + </fo:block> + </fo:list-item-label> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/footnote.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/footnote.xsl new file mode 100644 index 000000000..8182ede17 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/footnote.xsl @@ -0,0 +1,232 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:key name="footnote" match="footnote" use="@ids"/> + + <!--note that a value of 'baseline' for baseline-shift means the number + has no shift, and has the same effect as not setting the value at all--> + + <xsl:attribute-set name="footnote"> + <xsl:attribute name="font-weight">normal</xsl:attribute> + <xsl:attribute name="font-style">normal</xsl:attribute> + </xsl:attribute-set> + + <!--set up the defaults for the footnote label--> + <xsl:attribute-set name="default-footnote-label-inline"> + <xsl:attribute name="baseline-shift">super</xsl:attribute> + <xsl:attribute name="font-size">8pt</xsl:attribute> + </xsl:attribute-set> + + <!--the attributes for the label at the bottom of the page, or with the endnotes--> + <xsl:attribute-set name="footnote-label-inline" use-attribute-sets="default-footnote-label-inline"> + </xsl:attribute-set> + + <!--the attributes for the label in the body of the text--> + <xsl:attribute-set name="footnote-body-label-inline" use-attribute-sets="default-footnote-label-inline"> + </xsl:attribute-set> + + + <!-- the attributes for the list that formats each footnote--> + <xsl:attribute-set name="footnote-list-block"> + <xsl:attribute name="provisional-label-separation">0pt</xsl:attribute> + <xsl:attribute name="provisional-distance-between-starts">18pt</xsl:attribute> + </xsl:attribute-set> + + <!--the item-lable in the list when footnotes formatted as a list--> + <xsl:attribute-set name= "footnote-item-label"> + <xsl:attribute name="end-indent">label-end()</xsl:attribute> + </xsl:attribute-set> + + <!--the block that surrounds the label. By default, this is not a superscript--> + <xsl:attribute-set name= "footnote-label-block"> + </xsl:attribute-set> + + <!--the attributes for the item-body of the list when a footnote is formatted + as a list--> + <xsl:attribute-set name= "footnote-item-body"> + <xsl:attribute name="start-indent">body-start()</xsl:attribute> + </xsl:attribute-set> + + <!--the attributes for the footnote-body--> + <xsl:attribute-set name= "footnote-body"> + </xsl:attribute-set> + + <!--for the paragraphs in the footnote--> + <xsl:attribute-set name="footnote-paragraph-block"> + <xsl:attribute name="space-before">5pt</xsl:attribute> + </xsl:attribute-set> + + <!--for the paragraphs in the footnote, the first one--> + <xsl:attribute-set name="footnote-first-paragraph-block" use-attribute-sets="footnote-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <!--ENDNOTES--> + + <!--the block that wraps all the endnotes--> + <xsl:attribute-set name="endnotes-block"> + <xsl:attribute name="break-before">page</xsl:attribute> + </xsl:attribute-set> + + <!--controls the space between each endnote--> + <xsl:attribute-set name="endnote-block"> + <xsl:attribute name="space-before">5pt</xsl:attribute> + </xsl:attribute-set> + + <!--the spacing for the first endnote--> + <xsl:attribute-set name="endnote-first-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + + <!--for the title of the endnotes--> + <xsl:attribute-set name="endnotes-title-block"> + <xsl:attribute name="space-after">18pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">18pt</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + </xsl:attribute-set> + + + + + <xsl:template match="footnote_reference"> + <xsl:choose> + <xsl:when test = "$footnote-placement = 'footnote'"> + <xsl:apply-templates select="key('footnote', @refid)" mode="footnote"/> + </xsl:when> + <xsl:when test = "$footnote-placement = 'endnote' and string(. + 1) = 'NaN'"> + <xsl:apply-templates select="key('footnote', @refid)" mode="footnote"/> + </xsl:when> + <xsl:when test = "$footnote-placement = 'endnote' and string(. + 1) != 'NaN'"> + <fo:inline xsl:use-attribute-sets="footnote-body-label-inline"> + <xsl:value-of select="."/> + </fo:inline> + </xsl:when> + </xsl:choose> + </xsl:template> + + <xsl:template match="footnote" mode="footnote"> + <xsl:choose> + <xsl:when test="$footnote-style = 'list'"> + <xsl:call-template name="footnote-as-list"/> + </xsl:when> + <xsl:when test="$footnote-style = 'traditional'"> + <xsl:call-template name="footnote-traditional"/> + </xsl:when> + </xsl:choose> + </xsl:template> + + <xsl:template name="footnote-list-body"> + <fo:list-block xsl:use-attribute-sets="footnote-list-block"> + <fo:list-item> + <fo:list-item-label xsl:use-attribute-sets="footnote-item-label"> + <fo:block xsl:use-attribute-sets="footnote-label-block"> + <xsl:value-of select="label"/> + </fo:block> + </fo:list-item-label> + <fo:list-item-body xsl:use-attribute-sets="footnote-item-body"> + <xsl:apply-templates select="paragraph" mode="footnote"/> + </fo:list-item-body> + </fo:list-item> + </fo:list-block> + <fo:block role="spacer" font-size="{$space-between-footnotes}" > </fo:block> + </xsl:template> + + <xsl:template name="footnote-as-list"> + <fo:footnote xsl:use-attribute-sets = "footnote"> + <xsl:apply-templates select="label" mode="footnote"/> + <fo:footnote-body xsl:use-attribute-sets="footnote-body"> + <xsl:call-template name="footnote-list-body"/> + </fo:footnote-body> + </fo:footnote> + </xsl:template> + + <xsl:template name="footnote-traditional"> + <fo:footnote xsl:use-attribute-sets = "footnote"> + <xsl:apply-templates select="label" mode="footnote"/> + <fo:footnote-body xsl:use-attribute-sets="footnote-body"> + <xsl:apply-templates select="paragraph" mode="traditional-footnote"/> + <fo:block role="spacer" font-size="{$space-between-footnotes}" > </fo:block> + </fo:footnote-body> + </fo:footnote> + </xsl:template> + + + <xsl:template match="footnote/label" mode="footnote"> + <fo:inline xsl:use-attribute-sets="footnote-body-label-inline"> + <xsl:apply-templates/> + </fo:inline> + </xsl:template> + + <xsl:template match="footnote/paragraph" mode="footnote"> + <fo:block xsl:use-attribute-sets="footnote-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="footnote/paragraph[1]" mode="traditional-footnote" priority="2"> + <fo:block xsl:use-attribute-sets="footnote-first-paragraph-block"> + <fo:inline xsl:use-attribute-sets="footnote-label-inline"> + <xsl:value-of select="../label"/> + </fo:inline> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="footnote/paragraph" mode="traditional-footnote"> + <fo:block xsl:use-attribute-sets="footnote-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="footnote[label = '1']" priority="2"> + <xsl:if test="$footnote-placement='endnote'"> + <fo:block role="endnotes" xsl:use-attribute-sets="endnotes-block"> + <xsl:apply-templates select="../rubric[@classes='endnotes']" mode="endnotes"/> + <xsl:for-each select="self::footnote|following-sibling::footnote"> + <xsl:variable name="label" select="label"/> + <xsl:if test="string($label + 1) != 'NaN'"> + <xsl:call-template name="endnote"/> + </xsl:if> + </xsl:for-each> + </fo:block> + </xsl:if> + </xsl:template> + + <xsl:template name="endnote"> + <xsl:choose> + <xsl:when test="$footnote-style = 'list'"> + <xsl:call-template name="footnote-list-body"/> + </xsl:when> + <xsl:when test="$footnote-style = 'traditional'"> + <xsl:choose> + <xsl:when test="self::footnote[label = '1']"> + <fo:block role="endnote" xsl:use-attribute-sets="endnote-first-block"> + <xsl:apply-templates select="paragraph" mode="traditional-footnote"/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:block role="endnote" xsl:use-attribute-sets="endnote-block"> + <xsl:apply-templates select="paragraph" mode="traditional-footnote"/> + </fo:block> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + </xsl:choose> + </xsl:template> + + <xsl:template match="rubric[@classes='endnotes']" mode="endnotes"> + <fo:block role="endnotes-title" xsl:use-attribute-sets="endnotes-title-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="footnote|footnote/label|footnote/paragraph|rubric[@classes='endnotes']"/> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/front_matter.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/front_matter.xsl new file mode 100644 index 000000000..3e8f33547 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/front_matter.xsl @@ -0,0 +1,120 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <!--attribute set for dedication wrapper block (to be able to force a break after). Element is fo:block--> + <xsl:attribute-set name="dedication-block"> + </xsl:attribute-set> + + <!--attribute set for abstract wrapper block (to be able to force a break after). Element is fo:block--> + <xsl:attribute-set name="abstract-block"> + </xsl:attribute-set> + + <!--attribute set for dedication title. Element is fo:block--> + <xsl:attribute-set name="dedication-title-block"> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <!--attribute set for abstract title. Element is fo:block--> + <xsl:attribute-set name="abstract-title-block"> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set> + + <!--attribute set for dedication paragraph. Element is fo:block--> + <xsl:attribute-set name="dedication-paragraph-block"> + <xsl:attribute name="font-style">italic</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="dedication-first-paragraph-block" + use-attribute-sets = "dedication-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <!--attribute set for abstract paragraph. Element is fo:block--> + <xsl:attribute-set name="abstract-paragraph-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="abstract-first-paragraph-block" + use-attribute-sets = "abstract-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <!--END OF ATTRIBUTE SETS--> + + <!--ony process if not already processed in front matter--> + <xsl:template match="topic[@classes='dedication']"> + <xsl:if test="$dedication-pagination = 'with-body'"> + <fo:block role="dedication" xsl:use-attribute-sets="dedication-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:if> + </xsl:template> + + <xsl:template match="topic[@classes='dedication']" mode="front"> + <fo:block role="dedication" xsl:use-attribute-sets="dedication-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="topic[@classes='dedication']/title" priority="2"> + <fo:block role="dedication-title" xsl:use-attribute-sets="dedication-title-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="topic[@classes='dedication']/paragraph"> + <fo:block role="dedication-paragraph" xsl:use-attribute-sets="dedication-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="topic[@classes='dedication']/paragraph[1]" priority = "2"> + <fo:block role="dedication-paragraph" xsl:use-attribute-sets="dedication-first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="topic[@classes='abstract']"> + <xsl:if test="$abstract-pagination = 'with-body'"> + <fo:block role="abstract" xsl:use-attribute-sets="abstract-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:if> + </xsl:template> + + <xsl:template match="topic[@classes='abstract']" mode="front"> + <fo:block role="abstract" xsl:use-attribute-sets="abstract-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="topic[@classes='abstract']/title" priority="2"> + <fo:block role="abstract-title" xsl:use-attribute-sets="abstract-title-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="topic[@classes='abstract']/paragraph"> + <fo:block role="abstract-paragraph" xsl:use-attribute-sets = "abstract-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="topic[@classes='abstract']/paragraph[1]" priority="2"> + <fo:block role="abstract-paragraph" xsl:use-attribute-sets = "abstract-first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + +</xsl:stylesheet> + diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/header_footer.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/header_footer.xsl new file mode 100644 index 000000000..4819e09da --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/header_footer.xsl @@ -0,0 +1,463 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Date: 2011-01-09 02:51:33 -0500 (Sun, 09 Jan 2011) $ --> + <!-- + This stylesheet handles headers and footers. It creates the fo:static-content + elements, and the child fo:block elements. Each paragraph up to three has its + own attriute set. + --> + + <xsl:attribute-set name="header-block"> + <xsl:attribute name="font-size">12pt</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="space-before.conditionality">retain</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="first-header-block" use-attribute-sets = "header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="odd-header-block" use-attribute-sets = "header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="even-header-block" use-attribute-sets = "header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="body-header-block" use-attribute-sets = "header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="footer-block"> + <xsl:attribute name="font-size">12pt</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="space-before.conditionality">retain</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="first-footer-block" use-attribute-sets = "footer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="odd-footer-block" use-attribute-sets = "footer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="even-footer-block" use-attribute-sets = "footer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="body-footer-block" use-attribute-sets = "footer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-first-header-block" use-attribute-sets = "header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-odd-header-block" use-attribute-sets = "header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-even-header-block" use-attribute-sets = "header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-body-header-block" use-attribute-sets = "header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-first-footer-block" use-attribute-sets = "footer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-odd-footer-block" use-attribute-sets = "footer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-even-footer-block" use-attribute-sets = "footer-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-body-footer-block" use-attribute-sets = "footer-block"> + <xsl:attribute name="font-size">12pt</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="space-before.conditionality">retain</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="paragraph-header-block"> + <xsl:attribute name="font-size">12pt</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="paragraph-footer-block"> + <xsl:attribute name="font-size">12pt</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + </xsl:attribute-set> + + + <xsl:template match="decoration"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="container[@classes='first-header']| + container[@classes='first-footer']| + container[@classes='odd-header']| + container[@classes='even-header']| + container[@classes='odd-footer']| + container[@classes='even-footer']| + container[@classes='body-header']| + container[@classes='body-footer']| + container[@classes='toc-first-header']| + container[@classes='toc-first-footer']| + container[@classes='toc-odd-header']| + container[@classes='toc-even-header']| + container[@classes='toc-odd-footer']| + container[@classes='toc-even-footer']| + container[@classes='toc-body-header']| + container[@classes='toc-body-footer'] "/> + + <xsl:template match="container[@classes='first-header']" mode= "header"> + <xsl:if test= "$layout-page = 'first' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="first-header"> + <fo:block role="header" xsl:use-attribute-sets="first-header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='first-footer']" mode= "footer"> + <xsl:if test= "$layout-page = 'first' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="first-footer"> + <fo:block role="footer" xsl:use-attribute-sets="first-footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='odd-header']" mode= "header"> + <xsl:if test= "$layout-page = 'odd-even' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="odd-header"> + <fo:block role="header" xsl:use-attribute-sets="odd-header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='even-header']" mode= "header"> + <xsl:if test= "$layout-page = 'odd-even' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="even-header"> + <fo:block role="header" xsl:use-attribute-sets="even-header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='odd-footer']" mode= "footer"> + <xsl:if test= "$layout-page = 'odd-even' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="odd-footer"> + <fo:block role="footer" xsl:use-attribute-sets="odd-footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='even-footer']" mode= "footer"> + <xsl:if test= "$layout-page = 'odd-even' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="even-footer"> + <fo:block role="footer" xsl:use-attribute-sets="even-footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='body-header']" mode= "header"> + <xsl:if test= "$layout-page = 'first' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="body-header"> + <fo:block role="header" xsl:use-attribute-sets="body-header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='body-footer']" mode= "footer"> + <xsl:if test= "$layout-page = 'first' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="body-footer"> + <fo:block role="footer" xsl:use-attribute-sets="body-footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='toc-first-header']" mode= "header"> + <xsl:if test= "$layout-page = 'first' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="toc-first-header"> + <fo:block role="header" xsl:use-attribute-sets="toc-first-header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='toc-first-footer']" mode= "footer"> + <xsl:if test= "$layout-page = 'first' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="toc-first-footer"> + <fo:block role="footer" xsl:use-attribute-sets="toc-first-footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='toc-odd-header']" mode= "header"> + <xsl:if test= "$layout-page = 'odd-even' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="toc-odd-header"> + <fo:block role="header" xsl:use-attribute-sets="toc-odd-header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='toc-even-header']" mode= "header"> + <xsl:if test= "$layout-page = 'odd-even' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="toc-even-header"> + <fo:block role="header" xsl:use-attribute-sets="toc-even-header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='toc-odd-footer']" mode= "footer"> + <xsl:if test= "$layout-page = 'odd-even' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="toc-odd-footer"> + <fo:block role="footer" xsl:use-attribute-sets="toc-odd-footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='toc-even-footer']" mode= "footer"> + <xsl:if test= "$layout-page = 'odd-even' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="toc-even-footer"> + <fo:block role="footer" xsl:use-attribute-sets="toc-even-footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='toc-body-header']" mode= "header"> + <xsl:if test= "$layout-page = 'first' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="toc-body-header"> + <fo:block role="header" xsl:use-attribute-sets="toc-body-header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + <xsl:template match="container[@classes='toc-body-footer']" mode= "footer"> + <xsl:if test= "$layout-page = 'first' or $layout-page = 'first-odd-even'"> + <fo:static-content flow-name="toc-body-footer"> + <fo:block role="footer" xsl:use-attribute-sets="toc-body-footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + </xsl:template> + + + <xsl:template match="decoration/header" mode="header"> + <xsl:choose> + <xsl:when test="$layout-page = '' or $layout-page = 'simple'"> + <fo:static-content flow-name="simple-header"> + <fo:block role="header" xsl:use-attribute-sets="header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:when> + <xsl:when test="$layout-page = 'odd-even'"> + <fo:static-content flow-name="odd-header"> + <fo:block role="header" xsl:use-attribute-sets="header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + <fo:static-content flow-name="even-header"> + <fo:block role="header" xsl:use-attribute-sets="header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:when> + <xsl:when test="$layout-page = 'first'"> + <xsl:if test="$suppress-first-page-header != 'True'"> + <fo:static-content flow-name = "first-header"> + <fo:block role="header" xsl:use-attribute-sets="header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + <fo:static-content flow-name = "body-header"> + <fo:block role="header" xsl:use-attribute-sets="header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:when> + <xsl:when test="$layout-page = 'first-odd-even'"> + <xsl:if test="$suppress-first-page-header != 'True'"> + <fo:static-content flow-name = "first-header"> + <fo:block role="header" xsl:use-attribute-sets="header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + <fo:static-content flow-name = "odd-header"> + <fo:block role="header" xsl:use-attribute-sets="header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + <fo:static-content flow-name = "even-header"> + <fo:block role="header" xsl:use-attribute-sets="header-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:when> + </xsl:choose> + </xsl:template> + + <xsl:template match="decoration/footer" mode="footer"> + <xsl:choose> + <xsl:when test="$layout-page = '' or $layout-page = 'simple'"> + <fo:static-content flow-name="simple-footer"> + <fo:block role="footer" xsl:use-attribute-sets="footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:when> + <xsl:when test="$layout-page = 'odd-even'"> + <fo:static-content flow-name="odd-footer"> + <fo:block role="footer" xsl:use-attribute-sets="footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + <fo:static-content flow-name="even-footer"> + <fo:block role="footer" xsl:use-attribute-sets="footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:when> + <xsl:when test="$layout-page = 'first'"> + <xsl:if test="$suppress-first-page-footer != 'True'"> + <fo:static-content flow-name = "first-footer"> + <fo:block role="footer" xsl:use-attribute-sets="footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + <fo:static-content flow-name = "body-footer"> + <fo:block role="footer" xsl:use-attribute-sets="footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:when> + <xsl:when test="$layout-page = 'first-odd-even'"> + <xsl:if test="$suppress-first-page-footer != 'True'"> + <fo:static-content flow-name = "first-footer"> + <fo:block role="footer" xsl:use-attribute-sets="footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:if> + <fo:static-content flow-name = "odd-footer"> + <fo:block role="footer" xsl:use-attribute-sets="footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + <fo:static-content flow-name = "even-footer"> + <fo:block role="footer" xsl:use-attribute-sets="footer-block"> + <xsl:apply-templates/> + </fo:block> + </fo:static-content> + </xsl:when> + </xsl:choose> + </xsl:template> + + <xsl:template match="inline[@classes='page-num']"> + <fo:page-number/> + </xsl:template> + + <xsl:template match="decoration/header/paragraph"> + <fo:block xsl:use-attribute-sets="paragraph-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="decoration/footer/paragraph"> + <fo:block xsl:use-attribute-sets="paragraph-footer-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="container[@classes='first-header']/paragraph| + container[@classes='odd-header']/paragraph| + container[@classes='even-header']/paragraph| + container[@classes='body-header']/paragraph| + container[@classes='toc-first-header']/paragraph| + container[@classes='toc-odd-header']/paragraph| + container[@classes='toc-even-header']/paragraph| + container[@classes='toc-body-header']/paragraph" priority="3"> + + <fo:block role = "header-paragraph" xsl:use-attribute-sets="paragraph-header-block"> + <xsl:apply-templates/> + </fo:block> + + </xsl:template> + + <xsl:template match="container[@classes='first-footer']/paragraph| + container[@classes='odd-footer']/paragraph| + container[@classes='even-footer']/paragraph| + container[@classes='body-footer']/paragraph| + container[@classes='toc-first-footer']/paragraph| + container[@classes='toc-odd-footer']/paragraph| + container[@classes='toc-even-footer']/paragraph| + container[@classes='toc-body-footer']/paragraph" priority="3"> + + <fo:block role="footer-paragraph" xsl:use-attribute-sets="paragraph-footer-block"> + <xsl:apply-templates/> + </fo:block> + + </xsl:template> + + <!-- + <xsl:template match="decoration/header/paragraph[2]"> + <fo:block xsl:use-attribute-sets="header-second-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="decoration/header/paragraph[3]"> + <fo:block xsl:use-attribute-sets="header-third-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="decoration/footer/paragraph[1]"> + <fo:block xsl:use-attribute-sets="footer-first-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="decoration/footer/paragraph[2]"> + <fo:block xsl:use-attribute-sets="footer-second-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="decoration/footer/paragraph[3]"> + <fo:block xsl:use-attribute-sets="footer-third-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + --> + + <xsl:template match="decoration/header|decoration/footer"/> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/image_figure.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/image_figure.xsl new file mode 100644 index 000000000..8426daa09 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/image_figure.xsl @@ -0,0 +1,135 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <xsl:attribute-set name="figure-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="image-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="figure-caption-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">smaller</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="figure-legend-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="legend-paragraph-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="legend-first-paragraph-block" use-attribute-sets="legend-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:template name="get-alignment"> + <xsl:choose> + <xsl:when test="@align"> + <xsl:value-of select="@align"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>left</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="create-external-image-element"> + <xsl:element name="fo:external-graphic"> + <xsl:attribute name="src"> + <xsl:text>url('</xsl:text> + <xsl:value-of select="@uri"/> + <xsl:text>')</xsl:text> + </xsl:attribute> + <xsl:if test="@scale"> + <xsl:attribute name="content-height"> + <xsl:value-of select="@scale"/> + <xsl:text>%</xsl:text> + </xsl:attribute> + </xsl:if> + <xsl:if test="@height"> + <xsl:attribute name="content-height"> + <xsl:value-of select="@height"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@width"> + <xsl:attribute name="content-width"> + <xsl:value-of select="@width"/> + </xsl:attribute> + </xsl:if> + <!--doesn't work--> + <xsl:if test="@align"> + <xsl:attribute name="text-align"> + <xsl:value-of select="@align"/> + </xsl:attribute> + </xsl:if> + </xsl:element> + </xsl:template> + + <xsl:template match="image"> + <xsl:call-template name="test-attributes"/> + <xsl:variable name="text-align"> + <xsl:call-template name="get-alignment"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="parent::figure"> + <fo:block role="image" xsl:use-attribute-sets="image-block" > + <xsl:call-template name="create-external-image-element"/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:block role="image" xsl:use-attribute-sets="image-block" text-align="{$text-align}" > + <xsl:call-template name="create-external-image-element"/> + </fo:block> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="figure"> + <xsl:variable name="text-align"> + <xsl:call-template name="get-alignment"/> + </xsl:variable> + <fo:block role="figure" xsl:use-attribute-sets="figure-block" text-align="{$text-align}"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="figure/caption"> + <fo:block role="caption" xsl:use-attribute-sets="figure-caption-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="figure/legend"> + <fo:block role="legend" xsl:use-attribute-sets="figure-legend-block" id="generate-id()"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="figure/legend/paragraph[1]" priority="2"> + <fo:block role="legend-paragraph-block" xsl:use-attribute-sets="legend-first-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="figure/legend/paragraph"> + <fo:block role="legend-paragraph-block" xsl:use-attribute-sets="legend-paragraph-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <!--just test that top and bottom aren't used, since they make no sense--> + <xsl:template name="test-attributes"> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/inline.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/inline.xsl new file mode 100644 index 000000000..e4bcbda3a --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/inline.xsl @@ -0,0 +1,100 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:attribute-set name="emphasis-inline" > + <xsl:attribute name="font-style">italic</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="strong-inline" > + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set> + + <!--attribute set for reference elements with refuri attriute. Element is fo:basic-link. `docutils`--> + <xsl:attribute-set name="basic-link-inline" > + <xsl:attribute name="text-decoration">underline</xsl:attribute> + <xsl:attribute name="color">blue</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="literal-inline"> + <xsl:attribute name="font-family">monospace</xsl:attribute> + <xsl:attribute name="font-size">8</xsl:attribute> + <xsl:attribute name="white-space">pre</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="title-reference-inline" > + <xsl:attribute name="font-style">italic</xsl:attribute> + </xsl:attribute-set> + + <xsl:template match="strong"> + <fo:inline xsl:use-attribute-sets="strong-inline"> + <xsl:apply-templates/> + </fo:inline> + </xsl:template> + + <xsl:template match="emphasis"> + <fo:inline xsl:use-attribute-sets="emphasis-inline"> + <xsl:apply-templates/> + </fo:inline> + </xsl:template> + + <!--internal links--> + <xsl:template match="reference[@refid]"> + <xsl:choose> + <xsl:when test="$internal-link-type = 'link'"> + <fo:inline> + <fo:basic-link xsl:use-attribute-sets="basic-link-inline" internal-destination="{@refid}"> + <xsl:apply-templates/> + </fo:basic-link> + </fo:inline> + </xsl:when> + <xsl:when test="$internal-link-type = 'page'"> + <fo:page-number-citation ref-id="{@refid}"/> + </xsl:when> + <xsl:when test="$internal-link-type = 'page-link'"> + <fo:inline> + <fo:basic-link xsl:use-attribute-sets="basic-link-inline" internal-destination="{@refid}"> + <fo:page-number-citation ref-id="{@refid}"/> + </fo:basic-link> + </fo:inline> + </xsl:when> + </xsl:choose> + </xsl:template> + + + <!--this template creates clickable links; you may want to give the option to turn this off--> + <xsl:template match= "reference[@refuri]"> + <fo:basic-link xsl:use-attribute-sets="basic-link-inline" external-destination="url('{@refuri}')"> + <xsl:apply-templates/> + </fo:basic-link> + </xsl:template> + + <xsl:template match="target"> + <xsl:if test="parent::paragraph"> + <fo:inline id="{@ids}"> + <xsl:apply-templates/> + </fo:inline> + </xsl:if> + </xsl:template> + + <xsl:template match="literal"> + <fo:inline xsl:use-attribute-sets="literal-inline"> + <xsl:apply-templates/> + </fo:inline> + </xsl:template> + + <xsl:template match="title_reference"> + <fo:inline xsl:use-attribute-sets="title-reference-inline"> + <xsl:apply-templates/> + </fo:inline> + </xsl:template> + + + + +</xsl:stylesheet> + + diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/line_block.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/line_block.xsl new file mode 100644 index 000000000..af0f73282 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/line_block.xsl @@ -0,0 +1,206 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- + TODO + + Make different templates for numbered and unnumbered verse, to keep the + result clean + --> + + <!-- $Id$ --> + <xsl:attribute-set name="outer-line-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + + <!--add text-align-last=justfiy only for numbered verse, so change--> + <xsl:attribute-set name="level1-line-block"> + <xsl:attribute name="start-indent">10mm</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="level2-line-block"> + <xsl:attribute name="start-indent">20mm</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="level3-line-block"> + <xsl:attribute name="start-indent">30mm</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="level4-line-block"> + <xsl:attribute name="start-indent">40mm</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="level5-line-block"> + <xsl:attribute name="start-indent">50mm</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="stanza-title-block"> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="space-before">12</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set> + + <xsl:template match="line_block"> + <xsl:variable name="level" select="count(ancestor::line_block) + 1"/> + <xsl:choose> + <xsl:when test="not(parent::line_block) "> + <fo:block xsl:use-attribute-sets="outer-line-block" role="line-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template name="get-line-number"> + <xsl:variable name="top-block-id"> + <xsl:for-each select="ancestor::line_block[last()]"> + <xsl:value-of select="generate-id()"/> + </xsl:for-each> + </xsl:variable> + <xsl:number from="line_block[generate-id() = $top-block-id]" + count="line[normalize-space(.) != ''][not(title_reference)][not(inline[@classes='title'])]" level="any"/> + </xsl:template> + + <xsl:template name="number-line"> + <xsl:variable name="num"> + <xsl:call-template name="get-line-number"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$num != 0 and ($num +1) mod $number-verse = 1"> + <fo:leader leader-pattern="space" /> + <xsl:value-of select="$num"/> + </xsl:when> + <xsl:otherwise> + <fo:leader leader-pattern="space" /> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template match="line"> + <xsl:choose> + <xsl:when test="$number-verse != ''"> + <xsl:call-template name="line-with-number"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="line"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="line[title_reference]|line[inline[@classes='title']]" priority="2"> + <fo:block xsl:use-attribute-sets="stanza-title-block" role="stanza-title"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="line/title_reference" priority="2"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template name="line"> + <xsl:variable name="level" select="count(ancestor::line_block)"/> + <xsl:choose> + <xsl:when test="normalize-space(.) = ''"> + <fo:block> + <xsl:text> </xsl:text> + </fo:block> + </xsl:when> + + <xsl:when test="$level = 1"> + <fo:block xsl:use-attribute-sets="level1-line-block" role="line"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 2"> + <fo:block xsl:use-attribute-sets="level2-line-block" role="line"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 3"> + <fo:block xsl:use-attribute-sets="level3-line-block" role="line"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 4"> + <fo:block xsl:use-attribute-sets="level4-line-block" role="line"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 5"> + <fo:block xsl:use-attribute-sets="level5-line-block" role="line"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="msg"> + <xsl:text>Cannot process line_blocks more than 5 levels deep.</xsl:text> + </xsl:variable> + <xsl:call-template name="error-message"> + <xsl:with-param name="text" select="$msg"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template name="line-with-number"> + <xsl:variable name="level" select="count(ancestor::line_block)"/> + <xsl:choose> + <xsl:when test="normalize-space(.) = ''"> + <fo:block> + <xsl:text> </xsl:text> + </fo:block> + </xsl:when> + <xsl:when test="$level = 1"> + <fo:block xsl:use-attribute-sets="level1-line-block" text-align-last = "justify" role="line"> + <xsl:apply-templates/> + <xsl:call-template name="number-line"/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 2"> + <fo:block xsl:use-attribute-sets="level2-line-block" text-align-last = "justify" role="line"> + <xsl:apply-templates/> + <xsl:call-template name="number-line"/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 3"> + <fo:block xsl:use-attribute-sets="level3-line-block" text-align-last = "justify" role="line"> + <xsl:apply-templates/> + <xsl:call-template name="number-line"/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 4"> + <fo:block xsl:use-attribute-sets="level4-line-block" text-align-last = "justify" role="line"> + <xsl:apply-templates/> + <xsl:call-template name="number-line"/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 5"> + <fo:block xsl:use-attribute-sets="level5-line-block" text-align-last = "justify" role="line"> + <xsl:apply-templates/> + <xsl:call-template name="number-line"/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="msg"> + <xsl:text>Cannot process line_blocks more than 5 levels deep.</xsl:text> + </xsl:variable> + <xsl:call-template name="error-message"> + <xsl:with-param name="text" select="$msg"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="inline[@classes='title']"/> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/misc.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/misc.xsl new file mode 100644 index 000000000..7ba46bba1 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/misc.xsl @@ -0,0 +1,11 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Date$ --> + <!--nothing so far--> + + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/option_list.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/option_list.xsl new file mode 100644 index 000000000..e85fc074d --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/option_list.xsl @@ -0,0 +1,261 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <!-- For the option list. "The provisional-distance-between-starts + property of the list-block specifies the distance bewteen the start of the + label (the bullet, for example) and the actual start of the list content" + (Pawson, 100) + + Element is fo:block-list + --> + <xsl:attribute-set name="option-list-block"> + <xsl:attribute name="start-indent">0mm</xsl:attribute> + <xsl:attribute name="provisional-distance-between-starts">50mm</xsl:attribute> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <!--for the option list item. FO element is list-item. docutils element is list_item.--> + <xsl:attribute-set name="option-list-item"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + </xsl:attribute-set> + + <!--for the option list item last item. Space may be different. Element is fo:list-item.--> + <xsl:attribute-set name="option-first-list-item" use-attribute-sets="option-list-item"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <!--Element is fo:list-item-label.--> + <xsl:attribute-set name="option-list-item-label"> + <xsl:attribute name="end-indent">label-end()</xsl:attribute> + </xsl:attribute-set> + + <!--for the block in the options label fo:list-item-lable/block. Element is fo:block.--> + <xsl:attribute-set name="option-list-item-label-block"> + </xsl:attribute-set> + + <!--for the option list item body. Element is fo:list-item-body.--> + <xsl:attribute-set name="option-list-item-body"> + <xsl:attribute name="start-indent">body-start()</xsl:attribute> + </xsl:attribute-set> + + <!--for the block that formats each description in an option list. Element is fo:block.--> + <xsl:attribute-set name="option-list-item-body-block"> + </xsl:attribute-set> + + + <!--for the text of each option in an option list. Element is fo:inline.--> + <xsl:attribute-set name="option-inline"> + <xsl:attribute name="font-family">monospace</xsl:attribute> + </xsl:attribute-set> + + <!--for the text of each option argument in an option list. Element is fo:inline.--> + <xsl:attribute-set name="option-argument-inline"> + <xsl:attribute name="font-family">monospace</xsl:attribute> + <xsl:attribute name="font-style">italic</xsl:attribute> + </xsl:attribute-set> + + + <!--option_list as definition list--> + + + <!--for the options-list . Element is fo:block.`doc`--> + <xsl:attribute-set name="option-list-definition-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <!--for the block for each item (option with description) in an option list. Element is fo:block.--> + <xsl:attribute-set name="option-list-item-block"> + <xsl:attribute name="space-before">8pt</xsl:attribute> + </xsl:attribute-set> + + <!--for the first block for each item (option with description) in an option list. + May need special space for first item. + Element is fo:block.--> + <xsl:attribute-set name="option-list-first-item-block" use-attribute-sets="option-list-item-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <!--for the block for each option. Element is fo:block.--> + <xsl:attribute-set name="option-group-block"> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + </xsl:attribute-set> + + <!-- + <xsl:attribute-set name="option-list-description-first-block" use-attribute-sets = "option-list-description-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + --> + + <xsl:attribute-set name="option-list-description-block"> + <xsl:attribute name="start-indent">16pt</xsl:attribute> + <xsl:attribute name="space-before">8pt</xsl:attribute> + </xsl:attribute-set> + + + <!--for the block for paragraphs describing options. + This attribute set for the first of such paragraphs + Element is fo:block.--> + + <xsl:attribute-set name="option-list-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="option-list-first-paragraph-block" use-attribute-sets="option-list-paragraph-block"> + <xsl:attribute name="space-before">0pt</xsl:attribute> + </xsl:attribute-set> + + + <xsl:template match="option_list"> + <xsl:choose> + <xsl:when test="$option-list-format = 'both'"><!--only used in testing--> + <xsl:call-template name="option-list-as-list"/> + <xsl:call-template name="option-list-as-definition-list"/> + </xsl:when> + <xsl:when test="$option-list-format = 'list'"> + <xsl:call-template name="option-list-as-list"/> + </xsl:when> + <xsl:when test="$option-list-format = 'definition'"> + <xsl:call-template name="option-list-as-definition-list"/> + </xsl:when> + </xsl:choose> + </xsl:template> + + <xsl:template name="option-list-as-list"> + <fo:list-block xsl:use-attribute-sets="option-list-block" role="option-list"> + <xsl:apply-templates mode="list"/> + </fo:list-block> + </xsl:template> + + <xsl:template match="option_list/option_list_item" mode="list"> + <fo:list-item xsl:use-attribute-sets="option-list-item"> + <xsl:apply-templates mode="list"/> + </fo:list-item> + </xsl:template> + + <!--first item, may want different spacing--> + <xsl:template match="option_list/option_list_item[1]" mode="list" priority="2"> + <fo:list-item xsl:use-attribute-sets="option-first-list-item"> + <xsl:apply-templates mode="list"/> + </fo:list-item> + </xsl:template> + + <xsl:template match="option_list_item/option_group" mode="list"> + <fo:list-item-label xsl:use-attribute-sets="option-list-item-label" role="options and arguments"> + <fo:block xsl:use-attribute-sets="option-list-item-label-block"> + <xsl:apply-templates mode="list"/> + </fo:block> + </fo:list-item-label> + </xsl:template> + + <xsl:template match="option_group/option" mode="list"> + <xsl:if test="preceding-sibling::option"> + <xsl:value-of select="$options-separator"/> + </xsl:if> + <xsl:apply-templates mode="list"/> + </xsl:template> + + + <xsl:template match="option_list/option_list_item/description" mode="list"> + <fo:list-item-body xsl:use-attribute-sets="option-list-item-body" role="description"> + <xsl:apply-templates mode="list"/> + </fo:list-item-body> + </xsl:template> + + <xsl:template match="option_list_item/description/paragraph" mode="list"> + <fo:block xsl:use-attribute-sets="option-list-item-body-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="option_string" mode="list"> + <xsl:for-each select="parent::option"> + <xsl:if test="preceding-sibling::option"> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:for-each> + <fo:inline xsl:use-attribute-sets="option-inline" role="option"> + <xsl:apply-templates mode="list"/> + </fo:inline> + </xsl:template> + + <xsl:template match="option_argument" mode="list"> + <xsl:value-of select="@delimiter"/> + <fo:inline xsl:use-attribute-sets="option-argument-inline" role="option-arg"> + <xsl:apply-templates mode="list"/> + </fo:inline> + </xsl:template> + + <!--==================================================================================--> + <!--templates for making defintion layout--> + + + <xsl:template name="option-list-as-definition-list"> + <fo:block role = "option-list" xsl:use-attribute-sets="option-list-definition-block"> + <xsl:apply-templates mode="definition"/> + </fo:block> + </xsl:template> + + <xsl:template match="option_list/option_list_item[1]" mode="definition" priority="2"> + <fo:block role="item" xsl:use-attribute-sets = "option-list-first-item-block"> + <xsl:apply-templates mode="definition"/> + </fo:block> + </xsl:template> + + <xsl:template match="option_list/option_list_item" mode="definition" priority="1"> + <fo:block role="item" xsl:use-attribute-sets = "option-list-item-block"> + <xsl:apply-templates mode="definition"/> + </fo:block> + </xsl:template> + + <xsl:template match="option_group" mode="definition"> + <fo:block role="option-group" xsl:use-attribute-sets = "option-group-block"> + <xsl:apply-templates mode="definition"/> + </fo:block> + </xsl:template> + + <xsl:template match="option_group/option" mode="definition"> + <xsl:if test="preceding-sibling::option"> + <xsl:value-of select="$options-separator"/> + </xsl:if> + <xsl:apply-templates mode="definition"/> + </xsl:template> + + <xsl:template match="option_list_item/description" mode="definition"> + <fo:block role="option-list-description" xsl:use-attribute-sets="option-list-description-block"> + <xsl:apply-templates mode="definition"/> + </fo:block> + </xsl:template> + + <xsl:template match="option_list_item/description/paragraph[1]" mode="definition" priority="2"> + <fo:block role="option-list-description" xsl:use-attribute-sets="option-list-first-paragraph-block"> + <xsl:apply-templates mode="definition"/> + </fo:block> + </xsl:template> + + <xsl:template match="option_list_item/description/paragraph" mode="definition" priority="1"> + <fo:block role="option-list-description" xsl:use-attribute-sets="option-list-paragraph-block"> + <xsl:apply-templates mode="definition"/> + </fo:block> + </xsl:template> + + <xsl:template match="option_string" mode="definition"> + <fo:inline xsl:use-attribute-sets="option-inline" role="option"> + <xsl:apply-templates mode="list"/> + </fo:inline> + </xsl:template> + + <xsl:template match="option_argument" mode="definition"> + <xsl:value-of select="@delimiter"/> + <fo:inline xsl:use-attribute-sets="option-argument-inline" role="option-arg"> + <xsl:apply-templates mode="list"/> + </fo:inline> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/page.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/page.xsl new file mode 100644 index 000000000..64f8d0d1e --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/page.xsl @@ -0,0 +1,604 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id: docutils_to_fo.xsl 6604 2011-01-20 04:56:24Z paultremblay $ --> + + <!-- + TODO + make the xsl:attribute-set name="region-body" functional. Right now, the + template make-region-body uses the region-body attribute set, even if + a toc were being written. Need to pass the parmater section and determine + what type of attribute set to use. + --> + + <!-- This template sets up the page styles, needed at the start of an + FO document. + + The parameter layout-page is inherited from other the parameter stylesheet. + This parameter must be + 1.blank (""). The stylesheet interprets an empty string as simple + 2. simple + 3. first + 4. odd-even + 5. first-odd-even + + The parameters suppress-first-header and suppress-first-footer are also inherited + from the parameters stylesheet. + --> + + <!--paper size for the whole document (Converstion only allows one + size, at least at this point--> + <xsl:attribute-set name="paper-size-simple-page-master"> + <xsl:attribute name="page-width">8.5in</xsl:attribute> + <xsl:attribute name="page-height">11in</xsl:attribute> + </xsl:attribute-set> + + <!--default for all pages--> + <xsl:attribute-set name="default-simple-page-master"> + <xsl:attribute name="margin-left">1.0in</xsl:attribute> + <xsl:attribute name="margin-right">1.0in</xsl:attribute> + <xsl:attribute name="margin-top">1.0in</xsl:attribute> + <xsl:attribute name="margin-bottom">1.0in</xsl:attribute> + </xsl:attribute-set> + + + <!--properties for simple page. + Use simple page when all the pages will be the same with + the same headers and footers--> + <xsl:attribute-set name="simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"> + </xsl:attribute-set> + + <!--properties for first page. + Used for either the "first" layout, or "first-odd-even" layout. + With the first, you can set different margins for the first page, + and can suppress the header or footer on the first page--> + <xsl:attribute-set name="first-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"> + </xsl:attribute-set> + + <!--properties for the body page. + The body page defines the pages in a "first" layout that are not the + first page--> + <xsl:attribute-set name="body-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master" > + </xsl:attribute-set> + + <!-- properties for the odd page. + The odd-page is used in either a "odd-even" layout or "first-odd-even" + layout. With odd-even, you can specify different margins for odd and even + pages. You cannot have different headers and footers--> + <xsl:attribute-set name="odd-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"> + </xsl:attribute-set> + + <!-- properties for the even page. + See the odd page above--> + <xsl:attribute-set name="even-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"> + </xsl:attribute-set> + + <!--attribute sets for toc pages; traits are inherited from the body pages--> + <xsl:attribute-set name="toc-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"/> + <xsl:attribute-set name="toc-first-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"/> + <xsl:attribute-set name="toc-body-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"/> + <xsl:attribute-set name="toc-even-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"/> + <xsl:attribute-set name="toc-odd-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"/> + + <!--attribute sets for front-matter pages; traits are inherited from the page size only pages--> + <xsl:attribute-set name="front-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"/> + <xsl:attribute-set name="front-first-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"/> + <xsl:attribute-set name="front-body-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"/> + <xsl:attribute-set name="front-even-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"/> + <xsl:attribute-set name="front-odd-simple-page-master" use-attribute-sets="paper-size-simple-page-master default-simple-page-master"/> + + <!--the extent for the header at the top of the page--> + <xsl:attribute-set name="header-region-before"> + <xsl:attribute name="extent">.75in</xsl:attribute> + </xsl:attribute-set> + + <!--the extent for the footer at the top of the page--> + <xsl:attribute-set name="footer-region-after"> + <xsl:attribute name="extent">.75in</xsl:attribute> + </xsl:attribute-set> + + <!--Not used for anything at this point--> + <xsl:attribute-set name="front-matter-region-body"> + </xsl:attribute-set> + + <!--Not used for anything at this point--> + <xsl:attribute-set name="region-body"> + </xsl:attribute-set> + + + <!--default spacing for footer and header spacing--> + <xsl:variable name="default-spacing-header">.75in</xsl:variable> + <xsl:variable name="default-spacing-footer">.75in</xsl:variable> + + + <!--the main template. Calls on other templates to make fo:simple-page-master, + then calls on other templates to make fo:page-sequence-master--> + <xsl:template name="make-pages"> + <xsl:if test="$test='True'"> + <xsl:message> + <xsl:text>value of $page-sequence-type="</xsl:text> + <xsl:value-of select="$page-sequence-type"/> + <xsl:text>"
</xsl:text> + <xsl:text>value of $page-layout="</xsl:text> + <xsl:value-of select="$page-layout"/> + <xsl:text>"
</xsl:text> + <xsl:text>value of $layout-page="</xsl:text> + <xsl:value-of select="$layout-page"/> + <xsl:text>"</xsl:text> + </xsl:message> + </xsl:if> + <fo:layout-master-set> + <xsl:call-template name="page-properties"/> + <xsl:call-template name="page-sequence"/> + <xsl:if test= "$page-sequence-type='front-toc-body' or $page-sequence-type = 'front-body'"> + <xsl:call-template name="make-front-matter-pages"/> + </xsl:if> + <xsl:if test= "$page-sequence-type='front-toc-body' or $page-sequence-type = 'toc-body' + or $page-sequence-type='toc-combined-body'"> + <xsl:call-template name="make-toc-pages"/> + </xsl:if> + </fo:layout-master-set> + </xsl:template> + + <!--call on the appropriate template to make simpe-page-master, depending on + the parameter $layout-page--> + <xsl:template name="page-properties"> + <!--set up the physical properties of the pages--> + <xsl:choose> + <xsl:when test="$layout-page = '' or $layout-page = 'simple'"> + <xsl:call-template name="make-simple-page"/> + </xsl:when> + <xsl:when test="$layout-page = 'first'"> + <xsl:call-template name="make-first-page"/> + <xsl:call-template name="make-body-page"/> + </xsl:when> + <xsl:when test="$layout-page = 'odd-even'"> + <xsl:call-template name="make-odd-page"/> + <xsl:call-template name="make-even-page"/> + </xsl:when> + <xsl:when test="$layout-page = 'first-odd-even'"> + <xsl:call-template name="make-first-page"/> + <xsl:call-template name="make-odd-page"/> + <xsl:call-template name="make-even-page"/> + </xsl:when> + </xsl:choose> + </xsl:template> + + <!--a single element, very tricky to create because footers or headers + may or may not be present, and the user has to override the defaults--> + <xsl:template name="make-region-body"> + <xsl:param name="page-type"/> + <xsl:param name="section"/> + <xsl:variable name="margin-top"> + <xsl:choose> + <xsl:when test="$page-type = 'first' and /document/container[@classes = 'first-header']|/document/decoration/header"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'odd' and /document/container[@classes = 'odd-header']|/document/decoration/header"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'even' and /document/container[@classes = 'even-header']|/document/decoration/header"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'body' and /document/container[@classes = 'body-header']|/document/decoration/header"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'toc-first' and + /document/container[@classes = 'toc-first-header']|/document/decoration/header"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'toc-odd' + and /document/container[@classes = 'toc-odd-header']|/document/decoration/header"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'toc-even' + and /document/container[@classes = 'toc-even-header']|/document/decoration/header"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'toc-body' + and /document/container[@classes = 'toc-body-header']|/document/decoration/header"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'simple' and /document/decoration/header"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>0in</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="margin-bottom"> + <xsl:choose> + <xsl:when test="$page-type = 'first' and /document/container[@classes = 'first-footer']|document/decoration/footer"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'odd' and /document/container[@classes = 'odd-footer']|document/decoration/footer"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'even' and /document/container[@classes = 'even-footer']|document/decoration/footer"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'body' and /document/container[@classes = 'body-footer']|document/decoration/footer"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'simple' and /document/decoration/footer"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'toc-first' + and /document/container[@classes = 'toc-first-footer']|document/decoration/footer"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'toc-odd' + and /document/container[@classes = 'toc-odd-footer']|document/decoration/footer"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'toc-even' + and /document/container[@classes = 'toc-even-footer']|document/decoration/footer"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'toc-body' + and /document/container[@classes = 'toc-body-footer']|document/decoration/footer"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:when test="$page-type = 'simple' and /document/decoration/footer"> + <xsl:value-of select="$default-spacing-header"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>0in</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$custom-spc-header-footer = 'true'"> + <fo:region-body xsl:use-attribute-sets="region-body"/> + </xsl:when> + <xsl:otherwise> + <fo:region-body margin-top="{$margin-top}" margin-bottom="{$margin-bottom}" xsl:use-attribute-sets="region-body"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!--make the simple-page-master with the appropriate master-name + As with the other templates that create simple-page-master, it determines if there are headers + and footers, and if so, makes room for them--> + <xsl:template name="make-simple-page"> + <fo:simple-page-master xsl:use-attribute-sets="simple-page-master" master-name="simple-page"> + <xsl:call-template name="make-region-body"> + <xsl:with-param name="page-type" select="'simple'"/> + </xsl:call-template> + <xsl:if test="document/decoration/header"> + <fo:region-before xsl:use-attribute-sets = "header-region-before" region-name="simple-header"/> + </xsl:if> + <xsl:if test="document/decoration/footer"> + <fo:region-after xsl:use-attribute-sets = "footer-region-after" region-name="simple-footer"/> + </xsl:if> + </fo:simple-page-master> + </xsl:template> + + <!--same as above, but this template also determines if no space should be created, based + on the suppress-first-page-footer and suppress-first-page-header parameters--> + <xsl:template name="make-first-page"> + <fo:simple-page-master xsl:use-attribute-sets="first-simple-page-master" master-name="first"> + <xsl:call-template name="make-region-body"> + <xsl:with-param name="page-type" select="'first'"/> + </xsl:call-template> + <xsl:if test="document/container[@classes='first-header']|document/decoration/header"> + <fo:region-before xsl:use-attribute-sets = "header-region-before" region-name="first-header"/> + </xsl:if> + <xsl:if test="document/container[@classes = 'first-footer']|document/decoration/footer"> + <fo:region-after xsl:use-attribute-sets = "footer-region-after" region-name="first-footer"/> + </xsl:if> + </fo:simple-page-master> + </xsl:template> + + <xsl:template name="make-body-page"> + <fo:simple-page-master xsl:use-attribute-sets="body-simple-page-master" master-name="body"> + <xsl:call-template name="make-region-body"> + <xsl:with-param name="page-type" select="'body'"/> + </xsl:call-template> + <xsl:if test="document/container[@classes = 'body-header']|document/decoration/header"> + <fo:region-before xsl:use-attribute-sets = "header-region-before" region-name = "body-header"/> + </xsl:if> + <xsl:if test="document/container[@classes='body-footer']|document/decoration/footer"> + <fo:region-after xsl:use-attribute-sets = "footer-region-after" region-name = "body-footer"/> + </xsl:if> + </fo:simple-page-master> + </xsl:template> + + <xsl:template name="make-odd-page"> + <fo:simple-page-master xsl:use-attribute-sets="odd-simple-page-master" master-name="odd"> + <xsl:call-template name="make-region-body"> + <xsl:with-param name="page-type" select="'odd'"/> + </xsl:call-template> + <xsl:if test="document/container[@classes = 'odd-header']|document/decoration/header"> + <fo:region-before xsl:use-attribute-sets = "header-region-before" region-name="odd-header"/> + </xsl:if> + <xsl:if test="document/container[@classes = 'odd-footer']|document/decoration/footer"> + <fo:region-after xsl:use-attribute-sets = "footer-region-after" region-name="odd-footer"/> + </xsl:if> + </fo:simple-page-master> + </xsl:template> + + <xsl:template name="make-even-page"> + <fo:simple-page-master xsl:use-attribute-sets="even-simple-page-master" master-name="even"> + <xsl:call-template name="make-region-body"> + <xsl:with-param name="page-type" select="'even'"/> + </xsl:call-template> + <xsl:if test="document/container[@classes='even-header']|document/decoration/header"> + <fo:region-before xsl:use-attribute-sets = "header-region-before" region-name="even-header"/> + </xsl:if> + <xsl:if test="document/container[@classes='even-footer']|document/decoration/footer"> + <fo:region-after xsl:use-attribute-sets = "footer-region-after" region-name="even-footer"/> + </xsl:if> + </fo:simple-page-master> + </xsl:template> + + + <!--Create the fo:page-sequence-master, depending on the parameter layout-page--> + <xsl:template name="page-sequence"> + <xsl:choose> + <xsl:when test="$layout-page = '' or $layout-page = 'simple'"> + <fo:page-sequence-master master-name = "pages" > + <fo:repeatable-page-master-reference master-reference = "simple-page"/> + </fo:page-sequence-master> + </xsl:when> + <xsl:when test="$layout-page = 'first'"> + <fo:page-sequence-master master-name = "pages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference = "first" page-position = "first"/> + <fo:conditional-page-master-reference master-reference = "body" page-position = "rest"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </xsl:when> + <xsl:when test="$layout-page = 'odd-even'"> + <fo:page-sequence-master master-name = "pages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference = "odd" odd-or-even = "odd"/> + <fo:conditional-page-master-reference master-reference = "even" odd-or-even = "even"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </xsl:when> + <xsl:when test="$layout-page = 'first-odd-even'"> + <fo:page-sequence-master master-name = "pages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference = "first" page-position = "first"/> + <fo:conditional-page-master-reference master-reference = "odd" odd-or-even = "odd"/> + <fo:conditional-page-master-reference master-reference = "even" odd-or-even = "even"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </xsl:when> + </xsl:choose> + </xsl:template> + + <!--TOC--> + <!--Just a repeat of above--> + + + <xsl:template name="make-toc-pages"> + <xsl:call-template name="toc-page-properties"/> + <xsl:call-template name="toc-page-sequence"/> + </xsl:template> + + <!--call on the appropriate template to make simpe-page-master, depending on + the parameter $layout-page--> + <xsl:template name="toc-page-properties"> + <!--set up the physical properties of the pages--> + <xsl:choose> + <xsl:when test="$layout-page = '' or $layout-page = 'simple'"> + <xsl:call-template name="toc-make-simple-page"/> + </xsl:when> + <xsl:when test="$layout-page = 'first'"> + <xsl:call-template name="toc-make-first-page"/> + <xsl:call-template name="toc-make-body-page"/> + </xsl:when> + <xsl:when test="$layout-page = 'odd-even'"> + <xsl:call-template name="toc-make-odd-page"/> + <xsl:call-template name="toc-make-even-page"/> + </xsl:when> + <xsl:when test="$layout-page = 'first-odd-even'"> + <xsl:call-template name="toc-make-first-page"/> + <xsl:call-template name="toc-make-odd-page"/> + <xsl:call-template name="toc-make-even-page"/> + </xsl:when> + </xsl:choose> + </xsl:template> + + <!--make the simple-page-master for toc--> + <xsl:template name="toc-make-simple-page"> + <fo:simple-page-master xsl:use-attribute-sets="toc-simple-page-master" master-name="toc-simple-page"> + <xsl:call-template name="make-region-body"> + <xsl:with-param name="page-type" select="'simple'"/> + </xsl:call-template> + <xsl:if test="document/decoration/header"> + <fo:region-before xsl:use-attribute-sets = "header-region-before" region-name="odd-even-header"/> + </xsl:if> + <xsl:if test="document/decoration/footer"> + <fo:region-after xsl:use-attribute-sets = "footer-region-after" region-name="odd-even-footer"/> + </xsl:if> + </fo:simple-page-master> + </xsl:template> + + <!--same as for non toc pages,--> + <xsl:template name="toc-make-first-page"> + <fo:simple-page-master xsl:use-attribute-sets="toc-first-simple-page-master" master-name="toc-first"> + <xsl:call-template name="make-region-body"> + <xsl:with-param name="page-type" select="'toc-first'"/> + </xsl:call-template> + <xsl:if test="document/container[@classes='toc-first-header']|document/decoration/header"> + <fo:region-before xsl:use-attribute-sets = "header-region-before" region-name="toc-first-header"/> + </xsl:if> + <xsl:if test="document/container[@classes = 'toc-first-footer']|document/decoration/footer"> + <fo:region-after xsl:use-attribute-sets = "footer-region-after" region-name="toc-first-footer"/> + </xsl:if> + </fo:simple-page-master> + </xsl:template> + + <xsl:template name="toc-make-body-page"> + <fo:simple-page-master xsl:use-attribute-sets="toc-body-simple-page-master" master-name="toc-body"> + <xsl:call-template name="make-region-body"> + <xsl:with-param name="page-type" select="'toc-body'"/> + </xsl:call-template> + <xsl:if test="document/container[@classes = 'toc-body-header']|document/decoration/header"> + <fo:region-before xsl:use-attribute-sets = "header-region-before" region-name = "toc-body-header"/> + </xsl:if> + <xsl:if test="document/container[@classes='toc-body-footer']|document/decoration/footer"> + <fo:region-after xsl:use-attribute-sets = "footer-region-after" region-name = "toc-body-footer"/> + </xsl:if> + </fo:simple-page-master> + </xsl:template> + + <xsl:template name="toc-make-odd-page"> + <fo:simple-page-master xsl:use-attribute-sets="toc-odd-simple-page-master" master-name="toc-odd"> + <xsl:call-template name="make-region-body"> + <xsl:with-param name="page-type" select="'toc-odd'"/> + </xsl:call-template> + <xsl:if test="document/container[@classes = 'toc-odd-header']|document/decoration/header"> + <fo:region-before xsl:use-attribute-sets = "header-region-before" region-name="toc-odd-header"/> + </xsl:if> + <xsl:if test="document/container[@classes = 'toc-odd-footer']|document/decoration/footer"> + <fo:region-after xsl:use-attribute-sets = "footer-region-after" region-name="toc-odd-footer"/> + </xsl:if> + </fo:simple-page-master> + </xsl:template> + + <xsl:template name="toc-make-even-page"> + <fo:simple-page-master xsl:use-attribute-sets="toc-even-simple-page-master" master-name="toc-even"> + <xsl:call-template name="make-region-body"> + <xsl:with-param name="page-type" select="'toc-even'"/> + </xsl:call-template> + <xsl:if test="document/container[@classes='toc-even-header']|document/decoration/header"> + <fo:region-before xsl:use-attribute-sets = "header-region-before" region-name="toc-even-header"/> + </xsl:if> + <xsl:if test="document/container[@classes='toc-even-footer']|document/decoration/footer"> + <fo:region-after xsl:use-attribute-sets = "footer-region-after" region-name="toc-even-footer"/> + </xsl:if> + </fo:simple-page-master> + </xsl:template> + + + <!--Create the fo:page-sequence-master, depending on the parameter layout-page--> + <xsl:template name="toc-page-sequence"> + <!--do I want these params? They seem unneeded and potentially trouble making--> + <xsl:choose> + <xsl:when test="$layout-page = '' or $layout-page = 'simple'"> + <fo:page-sequence-master master-name = "toc-pages" > + <fo:repeatable-page-master-reference master-reference = "toc-simple-page"/> + </fo:page-sequence-master> + </xsl:when> + <xsl:when test="$layout-page = 'first'"> + <fo:page-sequence-master master-name = "toc-pages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference = "toc-first" page-position = "first"/> + <fo:conditional-page-master-reference master-reference = "toc-body" page-position = "rest"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </xsl:when> + <xsl:when test="$layout-page = 'odd-even'"> + <fo:page-sequence-master master-name = "toc-pages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference = "toc-odd" odd-or-even = "odd"/> + <fo:conditional-page-master-reference master-reference = "toc-even" odd-or-even = "even"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </xsl:when> + <xsl:when test="$layout-page = 'first-odd-even'"> + <fo:page-sequence-master master-name = "toc-pages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference = "toc-first" page-position = "first"/> + <fo:conditional-page-master-reference master-reference = "toc-odd" odd-or-even = "odd"/> + <fo:conditional-page-master-reference master-reference = "toc-even" odd-or-even = "even"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </xsl:when> + </xsl:choose> + </xsl:template> + + + <!--FRONT MATTER (no page numbers)--> + + <xsl:template name="make-front-matter-pages"> + <xsl:call-template name="front-matter-page-properties"/> + <xsl:call-template name="front-matter-page-sequence"/> + </xsl:template> + + <!--call on the appropriate template to make simpe-page-master, depending on + the parameter $layout-page--> + <xsl:template name="front-matter-page-properties"> + <!--set up the physical properties of the pages--> + <xsl:choose> + <xsl:when test="$layout-page = '' or $layout-page = 'simple'"> + <fo:simple-page-master xsl:use-attribute-sets="front-simple-page-master" master-name="front-matter-simple-page"> + <fo:region-body xsl:use-attribute-sets="front-matter-region-body"/> + </fo:simple-page-master> + </xsl:when> + <xsl:when test="$layout-page = 'first'"> + <fo:simple-page-master xsl:use-attribute-sets="front-first-simple-page-master" master-name="front-matter-first"> + <fo:region-body xsl:use-attribute-sets="front-matter-region-body"/> + </fo:simple-page-master> + <fo:simple-page-master xsl:use-attribute-sets="front-body-simple-page-master" master-name="front-matter-body"> + <fo:region-body xsl:use-attribute-sets="front-matter-region-body"/> + </fo:simple-page-master> + </xsl:when> + <xsl:when test="$layout-page = 'odd-even'"> + <fo:simple-page-master xsl:use-attribute-sets="front-odd-simple-page-master" master-name="front-matter-odd"> + <fo:region-body xsl:use-attribute-sets="front-matter-region-body"/> + </fo:simple-page-master> + <fo:simple-page-master xsl:use-attribute-sets="front-even-simple-page-master" master-name="front-matter-even"> + <fo:region-body xsl:use-attribute-sets="front-matter-region-body"/> + </fo:simple-page-master> + </xsl:when> + <xsl:when test="$layout-page = 'first-odd-even'"> + <fo:simple-page-master xsl:use-attribute-sets="front-first-simple-page-master" master-name="front-matter-first"> + <fo:region-body xsl:use-attribute-sets="front-matter-region-body"/> + </fo:simple-page-master> + <fo:simple-page-master xsl:use-attribute-sets="front-odd-simple-page-master" master-name="front-matter-odd"> + <fo:region-body xsl:use-attribute-sets="front-matter-region-body"/> + </fo:simple-page-master> + <fo:simple-page-master xsl:use-attribute-sets="front-even-simple-page-master" master-name="front-matter-even"> + <fo:region-body xsl:use-attribute-sets="front-matter-region-body"/> + </fo:simple-page-master> + </xsl:when> + </xsl:choose> + </xsl:template> + + <!--Create the fo:page-sequence-master, depending on the parameter layout-page--> + <xsl:template name="front-matter-page-sequence"> + <xsl:choose> + <xsl:when test="$layout-page = 'simple'"> + <fo:page-sequence-master master-name = "front-matter-pages" > + <fo:repeatable-page-master-reference master-reference = "front-matter-simple-page"/> + </fo:page-sequence-master> + </xsl:when> + <xsl:when test="$layout-page = 'first'"> + <fo:page-sequence-master master-name = "front-matter-pages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference = "front-matter-first" page-position = "first"/> + <fo:conditional-page-master-reference master-reference = "front-matter-body" page-position = "rest"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </xsl:when> + <xsl:when test="$layout-page = 'odd-even'"> + <fo:page-sequence-master master-name = "front-matter-pages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference = "front-matter-odd" odd-or-even = "odd"/> + <fo:conditional-page-master-reference master-reference = "front-matter-even" odd-or-even = "even"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </xsl:when> + <xsl:when test="$layout-page = 'first-odd-even'"> + <fo:page-sequence-master master-name = "front-matter-pages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference = "front-matter-first" page-position = "first"/> + <fo:conditional-page-master-reference master-reference = "front-matter-odd" odd-or-even = "odd"/> + <fo:conditional-page-master-reference master-reference = "front-matter-even" odd-or-even = "even"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </xsl:when> + </xsl:choose> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/parameters.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/parameters.xsl new file mode 100644 index 000000000..758bdc4db --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/parameters.xsl @@ -0,0 +1,216 @@ + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + + <!-- $Id: lists.xsl 6552 2011-01-13 05:56:07Z paultremblay $ --> +<!--if set to True, stylesheets cause quit when error found--> +<xsl:param name="strict"/> + + +<!--layout is either +simple (all pages the same) + +first (different first page from rest) + +odd-even (different for odd and even; headers and footers will be the same because of the limitations of rst) + +first-odd-even (different first, odd, and even; headers and footers will be the same, with the option of suppressing the first header and footer) +--> +<xsl:param name="page-layout"></xsl:param> + +<!--supress the header on the first page--> +<xsl:param name="suppress-first-page-header"/> + +<!--supress the footer on the first page--> +<xsl:param name="suppress-first-page-footer"/> + +<!--these are unfortunate parameters; they should be set to exactly the value of extent in +the page-header or page-footer attribute sets--> +<xsl:param name="spacing-header"/> +<xsl:param name="spacing-footer"/> +<xsl:param name="custom-spacing-header-footer"/> + + +<!--with-front, with-toc, or with-body--> +<xsl:param name="title-pagination">with-front</xsl:param> + +<!--with-front, with-toc, or with-body--> +<xsl:param name="bibliographic-pagination">with-front</xsl:param> + +<!--with-front, with-toc, or with-body--> +<xsl:param name="dedication-pagination">with-front</xsl:param> + +<!--with-front, with-toc, or with-body--> +<xsl:param name="abstract-pagination">with-front</xsl:param> +<!--either own-section, or with-body--> + +<!--with-front, with-toc, or with-body--> +<xsl:param name="toc-pagination">with-toc</xsl:param> +<!--Note: utils.xsl has the code for the variable page-sequence-type--> + +<!--the order for the front matter. Use a comma after each area, and +make sure you incude all areas. Relevant areas are +title, bibliographic, dedication, abstract, and toc +--> +<xsl:param name="front-order">title,bibliographic,dedication,abstract,toc</xsl:param> + +<xsl:param name="bibliographic-format">list</xsl:param> + + +<!--cols for custom table, when needed--> +<xsl:param name="table1-cols"></xsl:param> +<xsl:param name="table2-cols"></xsl:param> +<xsl:param name="table3-cols"></xsl:param> +<xsl:param name="table4-cols"></xsl:param> +<xsl:param name="table5-cols"></xsl:param> +<xsl:param name="table6-cols"></xsl:param> +<xsl:param name="table7-cols"></xsl:param> +<xsl:param name="table8-cols"></xsl:param> +<xsl:param name="table9-cols"></xsl:param> +<xsl:param name="table10-cols"></xsl:param> +<xsl:param name="table11-cols"></xsl:param> +<xsl:param name="table12-cols"></xsl:param> +<xsl:param name="table13-cols"></xsl:param> +<xsl:param name="table14-cols"></xsl:param> +<xsl:param name="table15-cols"></xsl:param> +<xsl:param name="table16-cols"></xsl:param> +<xsl:param name="table17-cols"></xsl:param> +<xsl:param name="table18-cols"></xsl:param> +<xsl:param name="table19-cols"></xsl:param> +<xsl:param name="table20-cols"></xsl:param> +<xsl:param name="table21-cols"></xsl:param> +<xsl:param name="table22-cols"></xsl:param> +<xsl:param name="table23-cols"></xsl:param> +<xsl:param name="table24-cols"></xsl:param> +<xsl:param name="table25-cols"></xsl:param> +<xsl:param name="table26-cols"></xsl:param> +<xsl:param name="table27-cols"></xsl:param> +<xsl:param name="table28-cols"></xsl:param> +<xsl:param name="table29-cols"></xsl:param> +<xsl:param name="table30-cols"></xsl:param> +<xsl:param name="table-cols"></xsl:param> +<xsl:param name="table-borderless-cols"></xsl:param> +<xsl:param name="table-long-cols"></xsl:param> + +<xsl:param name="long-rows-first-page"></xsl:param> + +<!--Parameters for docinfo fields. These parameters are used to fill in the text before such +fields as author, etc.--> +<xsl:param name="author-text">Author: </xsl:param> +<xsl:param name="authors-text">Authors: </xsl:param> +<xsl:param name="organization-text">Organization: </xsl:param> +<xsl:param name="contact-text">Contact: </xsl:param> +<xsl:param name="status-text">Status: </xsl:param> +<xsl:param name="copyright-text">Copyright: </xsl:param> +<xsl:param name="address-text">Address: </xsl:param> +<xsl:param name="version-text">Version: </xsl:param> +<xsl:param name="revision-text">Revision: </xsl:param> +<xsl:param name="date-text">Date: </xsl:param> + +<!--cutom bibliographic entry names--> +<xsl:param name="custom-bib-info1-name"></xsl:param> +<xsl:param name="custom-bib-info2-name"></xsl:param> +<xsl:param name="custom-bib-info3-name"></xsl:param> +<xsl:param name="custom-bib-info4-name"></xsl:param> +<xsl:param name="custom-bib-info5-name"></xsl:param> +<xsl:param name="custom-bib-info6-name"></xsl:param> +<xsl:param name="custom-bib-info7-name"></xsl:param> +<xsl:param name="custom-bib-info8-name"></xsl:param> +<xsl:param name="custom-bib-info9-name"></xsl:param> +<xsl:param name="custom-bib-info10-name"></xsl:param> + +<!--text for admontions--> +<xsl:param name="attention-title">Attention!</xsl:param> +<xsl:param name="caution-title">Caution!</xsl:param> +<xsl:param name="danger-title">!Danger!</xsl:param> +<xsl:param name="error-title">Error</xsl:param> +<xsl:param name="hint-title">Hint</xsl:param> +<xsl:param name="important-title">Important</xsl:param> +<xsl:param name="note-title">Note</xsl:param> +<xsl:param name="tip-title">Tip</xsl:param> +<xsl:param name="warning-title">Warning!</xsl:param> + +<!--text to use for transition elements--> +<xsl:param name="transition-text">***</xsl:param> + +<!--the format for the level 1 sectin title. If left blank, no number will be generated--> +<xsl:param name="number-section1">1</xsl:param> +<xsl:param name="number-section2">.1</xsl:param> +<xsl:param name="number-section3">.1</xsl:param> +<xsl:param name="number-section4">.1</xsl:param> +<xsl:param name="number-section5">.1</xsl:param> +<xsl:param name="number-section6">.1</xsl:param> +<xsl:param name="number-section7">.1</xsl:param> +<xsl:param name="number-section8">.1</xsl:param> +<xsl:param name="number-section9">.1</xsl:param> + +<!--inherit section numbers from previous sections, such as 1.1.1--> +<xsl:param name="inherit-section-num">True</xsl:param> + +<!--the default to use for a bullet list, rather than what the user specifies--> +<xsl:param name="bullet-text">•</xsl:param> + +<!--the default to use for a bullet list level 2, rather than what the user specifies--> +<!-- +<xsl:param name="bullet-text-level2">◦</xsl:param> +--> + +<xsl:param name="bullet-text-level2">°</xsl:param> + +<!--how to format the options list. Acceptable values are +'list' and 'definition'. The 'list' values creates a bullet-type +list, with the options taking the place of bullets. The 'definiton' +value creates a definition type list, with the options on a separate +block above the description `doc`--> +<xsl:param name="option-list-format">list</xsl:param> + +<!--the text that separates options in the options_list, +for example, -f -file. With "," as the value, these +arguments become -f, -file --> +<xsl:param name="options-separator">, </xsl:param> + + +<!--whether to number verse. Value is either '', or +some integer, a multiple of the lines you want to number. +For example, '5' will number every fifth line--> +<xsl:param name="number-verse"></xsl:param> + +<!--text to use before attribution in block quote--> +<xsl:param name="text-before-block-quote-attribution">—</xsl:param> +<xsl:param name="text-before-epigraph-attribution">—</xsl:param> +<xsl:param name="text-before-pull-quote-attribution">—</xsl:param> + +<!--where to place table title valid options are 'top' or 'bottom'--> +<xsl:param name="table-title-placement">bottom</xsl:param> + +<!--where to place footnote. Values are 'footnote' and +'endnote'. When 'footnote is choosen, footnotes are placed +at the bottom of each page. When 'endnote' is choosen, footnotes +are placed in the same place as in the RST document--> +<xsl:param name="footnote-placement">footnote</xsl:param> + +<!--the style of the footnote. Valid values are 'list', for making +the footnote into a list, with the number as the item; 'traditional', +to make the footnote more traditional with a first line indent;--> +<xsl:param name="footnote-style">list</xsl:param> + + +<!--This is a hack to fix the problem with fop ?? not +being able to space between footnotes. Instead, a blank +block is written with a no-break space character, and +the height of this block is determined by a font-size, +here the space-between-footnotes--> +<xsl:param name="space-between-footnotes">5pt</xsl:param> + + +<!--whether to make internal links clickable ('link'), +refer to a page number ('page'), or both ('page-link')--> +<xsl:param name="internal-link-type">link</xsl:param> + +<!--only for testing purposes--> +<xsl:param name="test"/> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/root.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/root.xsl new file mode 100644 index 000000000..0a847d2a1 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/root.xsl @@ -0,0 +1,187 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <!-- The stylesheet for handling root elements, such as document--> + + <!--any attributes here will apply to the entire document--> + <xsl:attribute-set name="default-page-sequence"> + </xsl:attribute-set> + + <xsl:attribute-set name="front-page-sequence" use-attribute-sets="default-page-sequence"> + <xsl:attribute name= "force-page-count">no-force</xsl:attribute> + </xsl:attribute-set> + + <!--attributes for the sequence of pages for the toc. + NOTE: The page numbering might have to be changed, by the user, if an odd-even layout is used. + Namely, the user might have to change the the force-page-count to odd or even, depending. --> + <xsl:attribute-set name="toc-page-sequence" use-attribute-sets="default-page-sequence"> + <xsl:attribute name= "format">i</xsl:attribute> + <xsl:attribute name= "initial-page-number">1</xsl:attribute> + <xsl:attribute name= "force-page-count">no-force</xsl:attribute> + </xsl:attribute-set> + + + <!--attributes for the sequence of pages for the main body. --> + <xsl:attribute-set name="body-page-sequence" use-attribute-sets="default-page-sequence"> + <xsl:attribute name= "format">1</xsl:attribute> + <xsl:attribute name= "initial-page-number">1</xsl:attribute> + </xsl:attribute-set> + + <!--default for fo:flow--> + <xsl:attribute-set name="default-flow"> + </xsl:attribute-set> + + + <xsl:attribute-set name="front-flow" use-attribute-sets="default-flow"> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-flow" use-attribute-sets="default-flow"> + </xsl:attribute-set> + + <xsl:attribute-set name="body-flow" use-attribute-sets="default-flow"> + </xsl:attribute-set> + + <xsl:attribute-set name="footnote-separator-flow"> + </xsl:attribute-set> + + <xsl:attribute-set name="footnote-separator-block"> + <!--putting space before can create way too much space--> + <!-- + <xsl:attribute name="space-before">5mm</xsl:attribute> + <xsl:attribute name="space-before.conditionality">retain</xsl:attribute> + --> + </xsl:attribute-set> + + <xsl:template match="/"> + <xsl:element name="fo:root"> + <xsl:call-template name="make-pages"/> + <xsl:apply-templates/> + </xsl:element> + </xsl:template> + + <!--title, bibliographic-info dedication, abstract toc--> + <xsl:template match = "document"> + <xsl:call-template name='test-params'/> + <xsl:if test="$test='True'"> + <xsl:message> + <xsl:text>value of $front-order = "</xsl:text> + <xsl:value-of select="$front-order"/> + <xsl:text>"</xsl:text> + </xsl:message> + </xsl:if> + <xsl:choose> + <xsl:when test="$page-sequence-type = 'front-toc-body'"> + <xsl:call-template name="make-front"/> + <xsl:call-template name="make-toc"/> + </xsl:when> + <xsl:when test="$page-sequence-type = 'front-body'"> + <xsl:call-template name="make-front"/> + </xsl:when> + <xsl:when test="$page-sequence-type = 'toc-body'"> + <xsl:call-template name="make-toc"/> + </xsl:when> + </xsl:choose> + <fo:page-sequence master-reference="pages" xsl:use-attribute-sets="body-page-sequence"> + <xsl:apply-templates select="/document/decoration/header" mode="header"/> + <xsl:apply-templates select="/document/container[@classes='body-header']" mode="header"/> + <xsl:apply-templates select="/document/container[@classes='first-header']" mode="header"/> + <xsl:apply-templates select="/document/container[@classes='odd-header']" mode="header"/> + <xsl:apply-templates select="/document/container[@classes='even-header']" mode="header"/> + <xsl:apply-templates select="/document/decoration/footer" mode="footer"/> + <xsl:apply-templates select="/document/container[@classes='body-footer']" mode="footer"/> + <xsl:apply-templates select="/document/container[@classes='first-footer']" mode="footer"/> + <xsl:apply-templates select="/document/container[@classes='odd-footer']" mode="footer"/> + <xsl:apply-templates select="/document/container[@classes='even-footer']" mode="footer"/> + <fo:static-content role = "footnote-separator" + xsl:use-attribute-sets = "footnote-separator-flow" flow-name="xsl-footnote-separator"> + <fo:block xsl:use-attribute-sets = "footnote-separator-block"> + <fo:leader leader-pattern="rule" leader-length="100%"/> + </fo:block> + </fo:static-content> + <fo:flow flow-name="xsl-region-body" xsl:use-attribute-sets="body-flow"> + <xsl:apply-templates/> + <!--write an empty block in case there is no content. A hack which I will have to fix later--> + <fo:block/> + </fo:flow> + </fo:page-sequence> + </xsl:template> + + <xsl:template name="make-front"> + <fo:page-sequence master-reference="front-matter-pages" xsl:use-attribute-sets="front-page-sequence"> + <fo:flow flow-name="xsl-region-body" xsl:use-attribute-sets="front-flow"> + <xsl:call-template name="apply-in-order"> + <xsl:with-param name="order" select="$front-order"/> + <xsl:with-param name="region" select="'with-front'"/> + </xsl:call-template> + </fo:flow> + </fo:page-sequence> + </xsl:template> + + <xsl:template name="make-toc"> + <fo:page-sequence master-reference="toc-pages" xsl:use-attribute-sets="toc-page-sequence"> + <xsl:apply-templates select="/document/decoration/header" mode="header"/> + <xsl:apply-templates select="/document/container[@classes='toc-body-header']" mode="header"/> + <xsl:apply-templates select="/document/container[@classes='toc-first-header']" mode="header"/> + <xsl:apply-templates select="/document/container[@classes='toc-odd-header']" mode="header"/> + <xsl:apply-templates select="/document/container[@classes='toc-even-header']" mode="header"/> + <xsl:apply-templates select="/document/decoration/footer" mode="footer"/> + <xsl:apply-templates select="/document/container[@classes='toc-body-footer']" mode="footer"/> + <xsl:apply-templates select="/document/container[@classes='toc-first-footer']" mode="footer"/> + <xsl:apply-templates select="/document/container[@classes='toc-odd-footer']" mode="footer"/> + <xsl:apply-templates select="/document/container[@classes='toc-even-footer']" mode="footer"/> + <fo:flow flow-name="xsl-region-body" xsl:use-attribute-sets="toc-flow"> + <xsl:call-template name="apply-in-order"> + <xsl:with-param name="order" select="$front-order"/> + <xsl:with-param name="region" select="'with-toc'"/> + </xsl:call-template> + </fo:flow> + </fo:page-sequence> + </xsl:template> + + + <xsl:template name="apply-in-order"> + <xsl:param name="order"/> + <xsl:param name="first-run">True</xsl:param> + <xsl:param name="region"/> + <xsl:variable name="order-string"> + <xsl:choose> + <xsl:when test="$first-run='True'"> + <xsl:value-of select="concat($order, ',')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$order"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="matter" select="normalize-space(substring-before($order-string, ','))"/> + <xsl:if test = "$matter != ''"> + <xsl:if test="$title-pagination=$region and $matter='title'"> + <xsl:apply-templates select="/document/title" mode="front"/> + </xsl:if> + <xsl:if test="$bibliographic-pagination=$region and $matter = 'bibliographic'"> + <xsl:apply-templates select="docinfo" mode="front"/> + </xsl:if> + <xsl:if test="$dedication-pagination=$region and $matter = 'dedication'"> + <xsl:apply-templates select="topic[@classes='dedication']" mode="front"/> + </xsl:if> + <xsl:if test="$abstract-pagination=$region and $matter = 'abstract'"> + <xsl:apply-templates select="topic[@classes='abstract']" mode="front"/> + </xsl:if> + <xsl:if test="$toc-pagination=$region and $matter = 'toc'"> + <xsl:apply-templates select="topic[@classes='contents']" mode="front"/> + </xsl:if> + <xsl:call-template name="apply-in-order"> + <xsl:with-param name="first-run">False</xsl:with-param> + <xsl:with-param name="order" select="substring-after($order-string, ',')"/> + <xsl:with-param name="region" select="$region"/> + </xsl:call-template> + </xsl:if> + </xsl:template> + + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/section.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/section.xsl new file mode 100644 index 000000000..895b33db7 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/section.xsl @@ -0,0 +1,204 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <xsl:attribute-set name="default-section-title-block"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="title-level1-block" use-attribute-sets="default-section-title-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">16</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="title-level2-block" use-attribute-sets="default-section-title-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">14</xsl:attribute> + <xsl:attribute name="font-style">italic</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="title-level3-block" use-attribute-sets="default-section-title-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">14</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="title-level4-block" use-attribute-sets="default-section-title-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">12</xsl:attribute> + <xsl:attribute name="font-style">italic</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="title-level5-block" use-attribute-sets="default-section-title-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">10</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="title-level6-block" use-attribute-sets="default-section-title-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">10</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="title-level7-block" use-attribute-sets="default-section-title-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">10</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="title-level8-block" use-attribute-sets="default-section-title-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">10</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="title-level9-block" use-attribute-sets="default-section-title-block"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">10</xsl:attribute> + </xsl:attribute-set> + + + <xsl:attribute-set name="title-number-inline"> + <xsl:attribute name="space-end">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:template name="make-ids"> + <xsl:param name="ids"/> + <xsl:variable name = "id" select="normalize-space(substring-before($ids, ' '))"/> + <xsl:if test = "$id != ''"> + <fo:inline id = "{$id}"/> + <xsl:call-template name="make-ids"> + <xsl:with-param name="ids" select = "substring-after($ids, ' ')"/> + </xsl:call-template> + </xsl:if> + </xsl:template> + + <xsl:template match="section"> + <fo:block role="empty-section-for-id"> + <xsl:call-template name="make-ids"> + <xsl:with-param name="ids" select="concat(@ids, ' ')"/> + </xsl:call-template> + </fo:block> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="section/title"> + <xsl:variable name="level"> + <xsl:value-of select="count(ancestor::section)"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$level = 1"> + <fo:block role = "section1-title" xsl:use-attribute-sets="title-level1-block" id = "{@refid}"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 2"> + <fo:block role="section2-title" xsl:use-attribute-sets="title-level2-block" id="{@refid}"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 3"> + <fo:block role="section3-title" xsl:use-attribute-sets="title-level3-block" id="{@refid}"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 4"> + <fo:block role="section4-title" xsl:use-attribute-sets="title-level4-block" id="{@refid}"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 5"> + <fo:block role="section5-title" xsl:use-attribute-sets="title-level5-block" id="{@refid}"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 6"> + <fo:block role="section6-title" xsl:use-attribute-sets="title-level6-block" id="{@refid}"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 7"> + <fo:block role="section7-title" xsl:use-attribute-sets="title-level7-block" id="{@refid}"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 8"> + <fo:block role="section8-title" xsl:use-attribute-sets="title-level8-block" id ="{@refid}"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$level = 9"> + <fo:block role="section9-title" xsl:use-attribute-sets="title-level9-block" id="{@refid}"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>Can't handle sections more than 9 deep.</xsl:text> + <xsl:text>Processing XSLT quitting.</xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template name="format-number"> + <xsl:param name="string"/> + <xsl:param name="level">1</xsl:param> + <xsl:variable name="num"> + <xsl:value-of select="substring-before($string, '.')"/> + </xsl:variable> + <xsl:if test = "normalize-space($num) != ''"> + <xsl:choose> + <xsl:when test="$level=1"> + <xsl:number value="$num" format="{$number-section1}"/> + </xsl:when> + <xsl:when test="$level=2"> + <xsl:number value="$num" format="{$number-section2}"/> + </xsl:when> + <xsl:when test="$level=3"> + <xsl:number value="$num" format="{$number-section3}"/> + </xsl:when> + <xsl:when test="$level=4"> + <xsl:number value="$num" format="{$number-section4}"/> + </xsl:when> + <xsl:when test="$level=5"> + <xsl:number value="$num" format="{$number-section5}"/> + </xsl:when> + <xsl:when test="$level=6"> + <xsl:number value="$num" format="{$number-section6}"/> + </xsl:when> + <xsl:when test="$level=7"> + <xsl:number value="$num" format="{$number-section7}"/> + </xsl:when> + <xsl:when test="$level=8"> + <xsl:number value="$num" format="{$number-section8}"/> + </xsl:when> + <xsl:when test="$level=9"> + <xsl:number value="$num" format="{$number-section9}"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$num"/> + </xsl:otherwise> + </xsl:choose> + <xsl:call-template name="format-number"> + <xsl:with-param name="level" select="$level + 1"/> + <xsl:with-param name="string" select="substring-after($string, '.')"/> + </xsl:call-template> + </xsl:if> + </xsl:template> + + <xsl:template match="section/title/generated[@classes='sectnum']"> + <xsl:variable name="num" select="concat(substring-before(., ' '), '.')"/> + <fo:inline xsl:use-attribute-sets="title-number-inline" role="number"> + <xsl:call-template name="format-number"> + <xsl:with-param name="string" select="$num"/> + </xsl:call-template> + </fo:inline> + </xsl:template> + + + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table.xsl new file mode 100644 index 000000000..204627e4d --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table.xsl @@ -0,0 +1,211 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + + <!-- $Id$ --> + + + <!--wraps the rest of the table.--> + <xsl:attribute-set name="table-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table-header"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="default-cell"> + <xsl:attribute name="border">solid black 1px</xsl:attribute> + <xsl:attribute name="padding">1em</xsl:attribute> + <xsl:attribute name="border-collapse">collapse</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table-header-cell" use-attribute-sets="default-cell"> + <xsl:attribute name="border-bottom">solid black 2px</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table-cell" use-attribute-sets="default-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="cell-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="caption-block"> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="space-before">6pt</xsl:attribute> + <xsl:attribute name="space-after">6pt</xsl:attribute> + </xsl:attribute-set> + + + <!--END OF ATTRIBUTE SETS--> + + <xsl:template match="table[not(@classes)]"> + <fo:block-container xsl:use-attribute-sets = "table-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" mode="caption"/> + </xsl:if> + <fo:table xsl:use-attribute-sets="table"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="''"/> + </xsl:call-template> + <xsl:apply-templates/> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" mode="caption"/> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[not(@classes)]/tgroup"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="table/tgroup/colspec"/> + + <!-- + <xsl:template match="table[not(@classes)]/tgroup/colspec"> + <xsl:variable name="col-num"> + <xsl:number/> + </xsl:variable> + <fo:table-column column-number="{$col-num}" + column-width="proportional-column-width({@colwidth})"/> + </xsl:template> + --> + + <xsl:template match="table[not(@classes)]/tgroup/thead"> + <fo:table-header xsl:use-attribute-sets = "table-header"> + <xsl:apply-templates/> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[not(@classes)]/tgroup/thead/row"> + <fo:table-row> + <xsl:apply-templates/> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[not(@classes)]/tgroup/thead/row/entry"> + <fo:table-cell xsl:use-attribute-sets="table-header-cell"> + <xsl:apply-templates/> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[not(@classes)]/tgroup/thead/row/entry/paragraph"> + <fo:block xsl:use-attribute-sets="table-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[not(@classes)]/tgroup/tbody"> + <fo:table-body xsl:use-attribute-sets="table-body"> + <xsl:apply-templates/> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[not(@classes)]/tgroup/tbody/row"> + <fo:table-row xsl:use-attribute-sets="table-row"> + <xsl:apply-templates/> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[not(@classes)]/tgroup/tbody/row/entry"> + <xsl:variable name="cols-spanned"> + <xsl:choose> + <xsl:when test="@morecols"> + <xsl:value-of select="@morecols + 1"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:choose> + <xsl:when test="@morerows"> + <xsl:value-of select="@morerows + 1"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template match="table[not(@classes)]/tgroup/tbody/row/entry/paragraph"> + <fo:block xsl:use-attribute-sets="cell-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table/title"/> + + <xsl:template match="table/title" mode="caption"> + <xsl:choose> + <xsl:when test="$table-title-placement = 'top'"> + <fo:block xsl:use-attribute-sets="caption-block" keep-with-next="always"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:when test="$table-title-placement = 'bottom'"> + <fo:block xsl:use-attribute-sets="caption-block" keep-with-previous="always"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + </xsl:choose> + </xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table_extended.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table_extended.xsl new file mode 100644 index 000000000..18ac12762 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table_extended.xsl @@ -0,0 +1,4678 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + + <!-- $Id$ --> + + + <xsl:attribute-set name="table1-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table1"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table1-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table1-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table1-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table1-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table1-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table1-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table1-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell1-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table2-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table2"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table2-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table2-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table2-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table2-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table2-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table2-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table2-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell2-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table3-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table3"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table3-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table3-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table3-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table3-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table3-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table3-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table3-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell3-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table4-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table4"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table4-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table4-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table4-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table4-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table4-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table4-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table4-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell4-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table5-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table5"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table5-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table5-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table5-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table5-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table5-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table5-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table5-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell5-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table6-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table6"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table6-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table6-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table6-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table6-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table6-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table6-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table6-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell6-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table7-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table7"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table7-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table7-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table7-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table7-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table7-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table7-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table7-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell7-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table8-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table8"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table8-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table8-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table8-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table8-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table8-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table8-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table8-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell8-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table9-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table9"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table9-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table9-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table9-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table9-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table9-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table9-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table9-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell9-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table10-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table10"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table10-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table10-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table10-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table10-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table10-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table10-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table10-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell10-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table11-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table11"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table11-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table11-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table11-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table11-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table11-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table11-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table11-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell11-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table12-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table12"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table12-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table12-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table12-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table12-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table12-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table12-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table12-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell12-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table13-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table13"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table13-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table13-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table13-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table13-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table13-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table13-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table13-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell13-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table14-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table14"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table14-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table14-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table14-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table14-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table14-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table14-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table14-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell14-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table15-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table15"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table15-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table15-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table15-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table15-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table15-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table15-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table15-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell15-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table16-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table16"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table16-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table16-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table16-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table16-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table16-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table16-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table16-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell16-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table17-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table17"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table17-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table17-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table17-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table17-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table17-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table17-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table17-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell17-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table18-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table18"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table18-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table18-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table18-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table18-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table18-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table18-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table18-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell18-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table19-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table19"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table19-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table19-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table19-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table19-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table19-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table19-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table19-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell19-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table20-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table20"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table20-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table20-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table20-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table20-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table20-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table20-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table20-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell20-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table21-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table21"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table21-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table21-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table21-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table21-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table21-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table21-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table21-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell21-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table22-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table22"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table22-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table22-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table22-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table22-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table22-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table22-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table22-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell22-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table23-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table23"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table23-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table23-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table23-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table23-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table23-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table23-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table23-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell23-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table24-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table24"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table24-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table24-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table24-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table24-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table24-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table24-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table24-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell24-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table25-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table25"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table25-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table25-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table25-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table25-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table25-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table25-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table25-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell25-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table26-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table26"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table26-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table26-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table26-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table26-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table26-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table26-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table26-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell26-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table27-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table27"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table27-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table27-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table27-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table27-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table27-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table27-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table27-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell27-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table28-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table28"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table28-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table28-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table28-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table28-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table28-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table28-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table28-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell28-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table29-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table29"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table29-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table29-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table29-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table29-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table29-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table29-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table29-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell29-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table30-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table30"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table30-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="table30-header-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="table30-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="table30-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="table30-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="table30-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="table30-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="cell30-block"> + </xsl:attribute-set> + + <!--END OF ATTRIBUTE SETS--> + + <xsl:template name="make-fo-table-cols"> + <xsl:param name="cols-string"/> + <xsl:param name="col-num">1</xsl:param> + <xsl:variable name="before-comma" + select="normalize-space(substring-before($cols-string, ','))" /> + <xsl:variable name="col-width"> + <xsl:choose> + <xsl:when test="$before-comma"> + <xsl:value-of select="$before-comma"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$cols-string"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:choose> + <xsl:when test="$col-width != ''"> + <fo:table-column column-number="{$col-num}" + column-width="proportional-column-width({$col-width})"/> + <xsl:call-template name="make-fo-table-cols"> + <xsl:with-param name="cols-string" + select= "normalize-space(substring-after($cols-string, ','))"/> + <xsl:with-param name="col-num" select="$col-num + 1"/> + </xsl:call-template> + </xsl:when> + </xsl:choose> + </xsl:template> + + <xsl:template name="get-column-widths"> + <xsl:param name="classes"/> + <xsl:variable name="columns"> + <xsl:choose> + <xsl:when test="$classes = 'table1'"> + <xsl:value-of select="$table1-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table2'"> + <xsl:value-of select="$table2-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table3'"> + <xsl:value-of select="$table3-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table4'"> + <xsl:value-of select="$table4-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table5'"> + <xsl:value-of select="$table5-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table6'"> + <xsl:value-of select="$table6-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table7'"> + <xsl:value-of select="$table7-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table8'"> + <xsl:value-of select="$table8-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table9'"> + <xsl:value-of select="$table9-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table10'"> + <xsl:value-of select="$table10-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table11'"> + <xsl:value-of select="$table11-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table12'"> + <xsl:value-of select="$table12-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table13'"> + <xsl:value-of select="$table13-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table14'"> + <xsl:value-of select="$table14-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table15'"> + <xsl:value-of select="$table15-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table16'"> + <xsl:value-of select="$table16-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table17'"> + <xsl:value-of select="$table17-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table18'"> + <xsl:value-of select="$table18-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table19'"> + <xsl:value-of select="$table19-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table20'"> + <xsl:value-of select="$table20-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table21'"> + <xsl:value-of select="$table21-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table22'"> + <xsl:value-of select="$table22-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table23'"> + <xsl:value-of select="$table23-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table24'"> + <xsl:value-of select="$table24-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table25'"> + <xsl:value-of select="$table25-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table26'"> + <xsl:value-of select="$table26-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table27'"> + <xsl:value-of select="$table27-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table28'"> + <xsl:value-of select="$table28-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table29'"> + <xsl:value-of select="$table29-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'table30'"> + <xsl:value-of select="$table30-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'borderless'"> + <xsl:value-of select="$table-borderless-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'long'"> + <xsl:value-of select="$table-long-cols"/> + </xsl:when> + + <xsl:when test="$classes = ''"> + <xsl:value-of select="$table-cols"/> + </xsl:when> + + </xsl:choose> + </xsl:variable> + <xsl:value-of select="$columns"/> + </xsl:template> + + + <xsl:template name="make-col-specs"> + <xsl:param name="classes"/> + <xsl:variable name="columns"> + <xsl:call-template name = "get-column-widths"> + <xsl:with-param name="classes" select = "$classes"/> + </xsl:call-template> + </xsl:variable> + <xsl:choose> + <xsl:when test="$columns != ''"> + <xsl:call-template name="make-fo-table-cols"> + <xsl:with-param name="cols-string" select="$columns"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="tgroup/colspec" mode="use"> + <xsl:with-param name="classe" select="$classes"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="cols-spanned"> + <xsl:choose> + <xsl:when test="@morecols"> + <xsl:value-of select="@morecols + 1"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="rows-spanned"> + <xsl:choose> + <xsl:when test="@morerows"> + <xsl:value-of select="@morerows + 1"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="tgroup/colspec" mode="use"> + <xsl:variable name="col-num"> + <xsl:number/> + </xsl:variable> + <fo:table-column column-number="{$col-num}" + column-width="proportional-column-width({@colwidth})"/> + </xsl:template> + + <xsl:template match="tgroup" > + <xsl:param name="classes"/> + <xsl:apply-templates > + <xsl:with-param name="classes" select="$classes"/> + </xsl:apply-templates> + </xsl:template> + + + <xsl:template match="table[@classes='table1']"> + <fo:block-container xsl:use-attribute-sets = "table1-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table1" xsl:use-attribute-sets="table1"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table1']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table1-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table1']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table1-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table1']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table1-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table1']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table1-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table1']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table1-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table1']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table1-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table1']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table1-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table1-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table1-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table1-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table1']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell1-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table2']"> + <fo:block-container xsl:use-attribute-sets = "table2-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table2" xsl:use-attribute-sets="table2"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table2']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table2-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table2']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table2-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table2']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table2-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table2']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table2-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table2']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table2-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table2']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table2-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table2']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table2-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table2-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table2-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table2-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table2']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell2-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table3']"> + <fo:block-container xsl:use-attribute-sets = "table3-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table3" xsl:use-attribute-sets="table3"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table3']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table3-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table3']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table3-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table3']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table3-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table3']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table3-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table3']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table3-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table3']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table3-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table3']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table3-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table3-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table3-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table3-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table3']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell3-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table4']"> + <fo:block-container xsl:use-attribute-sets = "table4-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table4" xsl:use-attribute-sets="table4"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table4']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table4-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table4']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table4-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table4']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table4-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table4']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table4-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table4']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table4-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table4']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table4-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table4']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table4-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table4-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table4-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table4-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table4']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell4-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table5']"> + <fo:block-container xsl:use-attribute-sets = "table5-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table5" xsl:use-attribute-sets="table5"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table5']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table5-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table5']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table5-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table5']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table5-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table5']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table5-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table5']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table5-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table5']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table5-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table5']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table5-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table5-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table5-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table5-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table5']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell5-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table6']"> + <fo:block-container xsl:use-attribute-sets = "table6-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table6" xsl:use-attribute-sets="table6"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table6']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table6-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table6']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table6-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table6']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table6-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table6']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table6-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table6']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table6-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table6']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table6-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table6']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table6-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table6-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table6-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table6-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table6']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell6-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table7']"> + <fo:block-container xsl:use-attribute-sets = "table7-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table7" xsl:use-attribute-sets="table7"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table7']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table7-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table7']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table7-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table7']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table7-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table7']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table7-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table7']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table7-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table7']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table7-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table7']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table7-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table7-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table7-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table7-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table7']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell7-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table8']"> + <fo:block-container xsl:use-attribute-sets = "table8-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table8" xsl:use-attribute-sets="table8"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table8']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table8-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table8']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table8-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table8']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table8-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table8']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table8-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table8']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table8-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table8']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table8-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table8']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table8-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table8-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table8-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table8-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table8']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell8-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table9']"> + <fo:block-container xsl:use-attribute-sets = "table9-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table9" xsl:use-attribute-sets="table9"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table9']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table9-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table9']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table9-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table9']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table9-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table9']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table9-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table9']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table9-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table9']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table9-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table9']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table9-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table9-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table9-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table9-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table9']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell9-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table10']"> + <fo:block-container xsl:use-attribute-sets = "table10-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table10" xsl:use-attribute-sets="table10"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table10']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table10-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table10']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table10-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table10']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table10-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table10']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table10-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table10']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table10-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table10']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table10-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table10']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table10-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table10-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table10-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table10-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table10']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell10-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table11']"> + <fo:block-container xsl:use-attribute-sets = "table11-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table11" xsl:use-attribute-sets="table11"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table11']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table11-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table11']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table11-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table11']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table11-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table11']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table11-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table11']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table11-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table11']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table11-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table11']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table11-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table11-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table11-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table11-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table11']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell11-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table12']"> + <fo:block-container xsl:use-attribute-sets = "table12-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table12" xsl:use-attribute-sets="table12"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table12']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table12-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table12']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table12-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table12']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table12-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table12']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table12-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table12']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table12-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table12']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table12-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table12']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table12-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table12-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table12-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table12-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table12']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell12-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table13']"> + <fo:block-container xsl:use-attribute-sets = "table13-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table13" xsl:use-attribute-sets="table13"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table13']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table13-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table13']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table13-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table13']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table13-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table13']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table13-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table13']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table13-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table13']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table13-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table13']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table13-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table13-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table13-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table13-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table13']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell13-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table14']"> + <fo:block-container xsl:use-attribute-sets = "table14-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table14" xsl:use-attribute-sets="table14"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table14']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table14-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table14']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table14-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table14']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table14-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table14']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table14-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table14']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table14-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table14']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table14-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table14']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table14-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table14-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table14-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table14-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table14']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell14-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table15']"> + <fo:block-container xsl:use-attribute-sets = "table15-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table15" xsl:use-attribute-sets="table15"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table15']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table15-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table15']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table15-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table15']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table15-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table15']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table15-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table15']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table15-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table15']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table15-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table15']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table15-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table15-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table15-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table15-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table15']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell15-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table16']"> + <fo:block-container xsl:use-attribute-sets = "table16-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table16" xsl:use-attribute-sets="table16"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table16']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table16-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table16']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table16-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table16']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table16-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table16']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table16-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table16']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table16-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table16']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table16-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table16']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table16-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table16-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table16-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table16-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table16']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell16-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table17']"> + <fo:block-container xsl:use-attribute-sets = "table17-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table17" xsl:use-attribute-sets="table17"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table17']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table17-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table17']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table17-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table17']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table17-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table17']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table17-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table17']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table17-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table17']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table17-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table17']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table17-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table17-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table17-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table17-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table17']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell17-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table18']"> + <fo:block-container xsl:use-attribute-sets = "table18-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table18" xsl:use-attribute-sets="table18"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table18']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table18-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table18']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table18-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table18']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table18-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table18']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table18-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table18']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table18-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table18']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table18-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table18']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table18-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table18-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table18-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table18-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table18']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell18-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table19']"> + <fo:block-container xsl:use-attribute-sets = "table19-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table19" xsl:use-attribute-sets="table19"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table19']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table19-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table19']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table19-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table19']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table19-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table19']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table19-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table19']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table19-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table19']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table19-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table19']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table19-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table19-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table19-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table19-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table19']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell19-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table20']"> + <fo:block-container xsl:use-attribute-sets = "table20-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table20" xsl:use-attribute-sets="table20"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table20']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table20-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table20']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table20-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table20']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table20-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table20']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table20-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table20']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table20-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table20']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table20-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table20']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table20-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table20-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table20-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table20-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table20']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell20-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table21']"> + <fo:block-container xsl:use-attribute-sets = "table21-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table21" xsl:use-attribute-sets="table21"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table21']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table21-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table21']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table21-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table21']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table21-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table21']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table21-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table21']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table21-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table21']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table21-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table21']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table21-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table21-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table21-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table21-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table21']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell21-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table22']"> + <fo:block-container xsl:use-attribute-sets = "table22-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table22" xsl:use-attribute-sets="table22"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table22']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table22-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table22']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table22-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table22']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table22-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table22']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table22-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table22']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table22-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table22']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table22-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table22']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table22-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table22-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table22-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table22-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table22']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell22-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table23']"> + <fo:block-container xsl:use-attribute-sets = "table23-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table23" xsl:use-attribute-sets="table23"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table23']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table23-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table23']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table23-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table23']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table23-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table23']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table23-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table23']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table23-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table23']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table23-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table23']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table23-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table23-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table23-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table23-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table23']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell23-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table24']"> + <fo:block-container xsl:use-attribute-sets = "table24-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table24" xsl:use-attribute-sets="table24"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table24']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table24-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table24']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table24-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table24']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table24-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table24']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table24-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table24']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table24-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table24']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table24-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table24']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table24-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table24-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table24-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table24-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table24']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell24-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table25']"> + <fo:block-container xsl:use-attribute-sets = "table25-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table25" xsl:use-attribute-sets="table25"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table25']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table25-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table25']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table25-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table25']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table25-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table25']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table25-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table25']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table25-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table25']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table25-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table25']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table25-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table25-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table25-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table25-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table25']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell25-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table26']"> + <fo:block-container xsl:use-attribute-sets = "table26-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table26" xsl:use-attribute-sets="table26"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table26']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table26-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table26']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table26-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table26']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table26-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table26']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table26-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table26']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table26-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table26']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table26-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table26']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table26-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table26-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table26-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table26-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table26']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell26-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table27']"> + <fo:block-container xsl:use-attribute-sets = "table27-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table27" xsl:use-attribute-sets="table27"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table27']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table27-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table27']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table27-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table27']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table27-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table27']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table27-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table27']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table27-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table27']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table27-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table27']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table27-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table27-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table27-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table27-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table27']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell27-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table28']"> + <fo:block-container xsl:use-attribute-sets = "table28-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table28" xsl:use-attribute-sets="table28"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table28']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table28-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table28']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table28-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table28']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table28-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table28']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table28-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table28']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table28-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table28']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table28-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table28']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table28-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table28-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table28-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table28-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table28']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell28-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table29']"> + <fo:block-container xsl:use-attribute-sets = "table29-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table29" xsl:use-attribute-sets="table29"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table29']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table29-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table29']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table29-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table29']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table29-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table29']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table29-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table29']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table29-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table29']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table29-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table29']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table29-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table29-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table29-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table29-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table29']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell29-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="table[@classes='table30']"> + <fo:block-container xsl:use-attribute-sets = "table30-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table30" xsl:use-attribute-sets="table30"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table30']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table30-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table30']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table30-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table30']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table30-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table30']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table30-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table30']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table30-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table30']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table30-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table30']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table30-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table30-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table30-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table30-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table30']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell30-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="title" mode="classes"/> + +</xsl:stylesheet>
\ No newline at end of file diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table_extended2.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table_extended2.xsl new file mode 100644 index 000000000..8546d3c0a --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table_extended2.xsl @@ -0,0 +1,161 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + + <xsl:attribute-set name="borderless-table-block-container" > + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="borderless-table"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="borderless-table-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="borderless-table-header-row"> + </xsl:attribute-set> + + <xsl:attribute-set name="borderless-table-header-cell"> + <xsl:attribute name="padding">1em</xsl:attribute> + <xsl:attribute name="border-collapse">collapse</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="borderless-table-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="borderless-table-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="borderless-table-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="borderless-table-cell" > + </xsl:attribute-set> + + <xsl:attribute-set name="borderless-cell-block"> + </xsl:attribute-set> + + + + <xsl:template match="table[@classes='borderless']"> + <fo:block-container xsl:use-attribute-sets = "borderless-table-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" mode="caption"/> + </xsl:if> + <fo:table role="borderless" xsl:use-attribute-sets="borderless-table"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates/> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" mode="caption"/> + </xsl:if> + </fo:block-container> + </xsl:template> + + <xsl:template match="table[@classes='borderless']/tgroup"> + <xsl:apply-templates/> + </xsl:template> + + + <xsl:template match="table[@classes = 'borderless']/tgroup/thead"> + <fo:table-header xsl:use-attribute-sets = "borderless-table-header"> + <xsl:apply-templates/> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='borderless']/tgroup//thead/row"> + <fo:table-row xsl:use-attribute-sets="borderless-table-header-row"> + <xsl:apply-templates/> + </fo:table-row> + </xsl:template> + + + <xsl:template match="table[@classes='borderless']/tgroup/thead/row/entry"> + <fo:table-cell xsl:use-attribute-sets="borderless-table-header-cell"> + <xsl:apply-templates/> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='borderless']/tgroup/thead/row/entry/paragraph"> + <fo:block xsl:use-attribute-sets="borderless-table-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='borderless']/tgroup/tbody"> + <fo:table-body xsl:use-attribute-sets="borderless-table-body"> + <xsl:apply-templates/> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='borderless']/tgroup/tbody/row"> + <fo:table-row xsl:use-attribute-sets="borderless-table-row"> + <xsl:apply-templates/> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes = 'borderless']/tgroup/tbody/row/entry"> + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="borderless-table-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="borderless-table-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="borderless-table-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="borderless-table-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes = 'borderless']/tgroup/tbody/row/entry/paragraph"> + <fo:block xsl:use-attribute-sets="borderless-cell-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table_long.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table_long.xsl new file mode 100644 index 000000000..5053a0db8 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/table_long.xsl @@ -0,0 +1,445 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + + <!-- $Id$ --> + + <xsl:attribute-set name="long-table"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="long-table-header"> + </xsl:attribute-set> + + <xsl:attribute-set name="long-table-header-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="long-table-header-cell" use-attribute-sets="default-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="long-table-header-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="long-table-body"> + </xsl:attribute-set> + + <xsl:attribute-set name="long-table-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set> + + + <xsl:attribute-set name="long-table-cell" use-attribute-sets="default-cell"> + </xsl:attribute-set> + + <xsl:attribute-set name="long-cell-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="long-caption-block"> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="space-before">6pt</xsl:attribute> + <xsl:attribute name="space-after">26pt</xsl:attribute> + <xsl:attribute name="space-before.conditionality">retain</xsl:attribute> + <xsl:attribute name="space-after.conditionality">retain</xsl:attribute> + </xsl:attribute-set> + + <!--END OF ATTRIBUTE SETS--> + + <xsl:template name="make-first-long-header"> + <xsl:variable name="cols-spanned" select="count(tgroup/colspec)"/> + <fo:table-row role="caption"> + <fo:table-cell number-columns-spanned="{$cols-spanned}"> + <fo:block xsl:use-attribute-sets="long-caption-block"> + <xsl:apply-templates select="title" mode="use"/> + </fo:block> + </fo:table-cell> + </fo:table-row> + </xsl:template> + + <xsl:template name="make-second-long-header"> + <xsl:variable name="cols-spanned" select="count(tgroup/colspec)"/> + <xsl:choose> + <xsl:when test="preceding-sibling::rubric[@classes='caption-non-first-page']"> + <fo:table-row role="caption"> + <fo:table-cell number-columns-spanned="{$cols-spanned}"> + <fo:block xsl:use-attribute-sets="long-caption-block"> + <xsl:apply-templates + select="preceding-sibling::rubric[@classes='caption-non-first-page']" + mode="use"/> + </fo:block> + </fo:table-cell> + </fo:table-row> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="make-first-long-header"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template name="caption-if-no-header"> + <xsl:param name="type"/> + <xsl:if test="not(tgroup/thead) and title and $table-title-placement = 'top'"> + <fo:table-header xsl:use-attribute-sets = "long-table-header"> + <xsl:choose> + <xsl:when test = "$type = 'first'"> + <xsl:call-template name="make-first-long-header"/> + </xsl:when> + <xsl:when test = "$type = 'second'"> + <xsl:call-template name="make-second-long-header"/> + </xsl:when> + </xsl:choose> + </fo:table-header> + </xsl:if> + </xsl:template> + + <xsl:template name="caption-if-no-footer"> + <xsl:param name="type"/> + <xsl:if test="not(tgroup/tfoot) and title and $table-title-placement = 'bottom'"> + <fo:table-footer xsl:use-attribute-sets = "long-table-header"> + <xsl:choose> + <xsl:when test = "$type = 'first'"> + <xsl:call-template name="make-first-long-header"/> + </xsl:when> + <xsl:when test = "$type = 'second'"> + <xsl:call-template name="make-second-long-header"/> + </xsl:when> + </xsl:choose> + </fo:table-footer> + </xsl:if> + </xsl:template> + + <xsl:template name="num-first-rows"> + <xsl:param name="preceding-tables"/> + <xsl:param name="row-string"/> + <xsl:param name="first-run">True</xsl:param> + <xsl:param name="recurs-num">1</xsl:param> + <xsl:variable name="table-num"> + <xsl:choose> + <xsl:when test="$preceding-tables != ''"> + <xsl:value-of select="$preceding-tables"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="count(preceding::table[@classes='long']) + 1"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="row-str"> + <xsl:choose> + <xsl:when test="$first-run = 'True'"> + <xsl:value-of select="normalize-space($long-rows-first-page)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$row-string"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="num"> + <xsl:choose> + <xsl:when test="substring-before($row-str, ',') != ''"> + <xsl:value-of select="substring-before($row-str, ',')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space($row-str)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:choose> + <xsl:when test="$num = ''"/> + <xsl:when test="$recurs-num = $table-num"> + <xsl:variable name="num-t-rows" select = "count(tgroup/tbody/row)"/> + <xsl:if test = "$num != 0 and $num > $num-t-rows - 1"> + <xsl:variable name="msg"> + <xsl:value-of select="$num"/> + <xsl:text> too large a number for long table </xsl:text> + <xsl:value-of select="$table-num"/> + <xsl:text>
</xsl:text> + <xsl:text>Table has </xsl:text> + <xsl:value-of select="$num-t-rows"/> + <xsl:text> rows. Can have no more than </xsl:text> + <xsl:value-of select="$num-t-rows - 1"/> + <xsl:text> rows on first page.
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:if> + <xsl:value-of select="$num"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="num-first-rows"> + <xsl:with-param name="preceding-tables" select="$table-num"/> + <xsl:with-param name="recurs-num" select="$recurs-num + 1"/> + <xsl:with-param name="row-string" select="substring-after($row-str, ',')"/> + <xsl:with-param name="first-run" select="'False'"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template match="table[@classes= 'long']"> + <xsl:variable name="num-first-rows"> + <xsl:call-template name="num-first-rows"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$num-first-rows = '' or $num-first-rows = 0"> + <fo:table xsl:use-attribute-sets="long-table"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:call-template name="caption-if-no-header"> + <xsl:with-param name="type" select="'first'"/> + </xsl:call-template> + <xsl:if test = "not(tgroup/thead)"> + <xsl:call-template name="caption-if-no-footer"> + <xsl:with-param name="type" select="'first'"/> + </xsl:call-template> + </xsl:if> + <xsl:apply-templates/> + </fo:table> + </xsl:when> + <xsl:otherwise> + <fo:table xsl:use-attribute-sets="long-table" break-after="page"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:call-template name="caption-if-no-header"> + <xsl:with-param name="type" select="'first'"/> + </xsl:call-template> + <xsl:if test = "not(tgroup/thead)"> + <xsl:call-template name="caption-if-no-footer"> + <xsl:with-param name="type" select="'first'"/> + </xsl:call-template> + </xsl:if> + <xsl:apply-templates mode="first-long"> + <xsl:with-param name="num-first-rows" select="$num-first-rows"/> + </xsl:apply-templates> + </fo:table> + <fo:table xsl:use-attribute-sets="long-table"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:call-template name="caption-if-no-header"> + <xsl:with-param name="type" select="'second'"/> + </xsl:call-template> + <xsl:if test = "not(tgroup/thead)"> + <xsl:call-template name="caption-if-no-footer"> + <xsl:with-param name="type" select="'second'"/> + </xsl:call-template> + </xsl:if> + <xsl:apply-templates mode="second-long"> + <xsl:with-param name="num-first-rows" select="$num-first-rows"/> + </xsl:apply-templates> + </fo:table> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table/title" mode="use" priority="2"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="table/title" mode="first-long"/> + <xsl:template match="table/title" mode="second-long"/> + + <xsl:template match="tgroup" mode="first-long"> + <xsl:param name="num-first-rows"/> + <xsl:apply-templates mode="first-long"> + <xsl:with-param name="num-first-rows" select="$num-first-rows"/> + </xsl:apply-templates> + </xsl:template> + + <xsl:template match="tgroup" mode="second-long"> + <xsl:param name="num-first-rows"/> + <xsl:apply-templates mode="second-long"> + <xsl:with-param name="num-first-rows" select="$num-first-rows"/> + </xsl:apply-templates> + </xsl:template> + + <xsl:template match="table[@classes ='long']/tgroup"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="table[@classes ='long']/tgroup/thead" mode="first-long"> + <fo:table-header xsl:use-attribute-sets = "long-table-header"> + <xsl:if test="../../title and $table-title-placement = 'top'"> + <xsl:for-each select="../.."> + <xsl:call-template name="make-first-long-header"/> + </xsl:for-each> + </xsl:if> + <xsl:apply-templates/> + </fo:table-header> + <xsl:for-each select="../.."> + <xsl:call-template name="caption-if-no-footer"> + <xsl:with-param name="type" select="'first'"/> + </xsl:call-template> + </xsl:for-each> + </xsl:template> + + <xsl:template match="table[@classes = 'long']/tgroup/thead" mode="second-long"> + <fo:table-header xsl:use-attribute-sets = "long-table-header"> + <xsl:if test="../../title and $table-title-placement = 'top'"> + <xsl:for-each select="../.."> + <xsl:call-template name="make-second-long-header"/> + </xsl:for-each> + </xsl:if> + <xsl:apply-templates/> + </fo:table-header> + <xsl:for-each select="../.."> + <xsl:call-template name="caption-if-no-footer"> + <xsl:with-param name="type" select="'second'"/> + </xsl:call-template> + </xsl:for-each> + </xsl:template> + + <xsl:template match="table[@classes ='long']/tgroup/thead"> + <fo:table-header xsl:use-attribute-sets = "long-table-header"> + <xsl:if test="../../title and $table-title-placement = 'top'"> + <xsl:for-each select="../.."> + <xsl:call-template name="make-first-long-header"/> + </xsl:for-each> + </xsl:if> + <xsl:apply-templates/> + </fo:table-header> + <xsl:for-each select="../.."> + <xsl:call-template name="caption-if-no-footer"> + <xsl:with-param name="type" select="'first'"/> + </xsl:call-template> + </xsl:for-each> + </xsl:template> + + <xsl:template match="table[@classes ='long']/tgroup/thead/row"> + <fo:table-row xsl:use-attribute-sets = "long-table-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes ='long']/tgroup/thead/row/entry"> + <fo:table-cell xsl:use-attribute-sets = "long-table-header-cell"> + <xsl:apply-templates/> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes ='long']/tgroup/thead/row/entry/paragraph"> + <fo:block xsl:use-attribute-sets = "long-table-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes = 'long']/tgroup/tbody" mode="first-long"> + <xsl:param name="num-first-rows"/> + <fo:table-body xsl:use-attribute-sets="long-table-body"> + <xsl:apply-templates mode="first-long"> + <xsl:with-param name="num-first-rows" select="$num-first-rows"/> + </xsl:apply-templates> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes ='long']/tgroup/tbody" mode="second-long"> + <xsl:param name="num-first-rows"/> + <fo:table-body xsl:use-attribute-sets="long-table-body"> + <xsl:apply-templates mode="second-long"> + <xsl:with-param name="num-first-rows" select="$num-first-rows"/> + </xsl:apply-templates> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes = 'long']/tgroup/tbody"> + <xsl:param name="num-first-rows"/> + <fo:table-body xsl:use-attribute-sets="long-table-body"> + <xsl:apply-templates/> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes ='long']/tgroup/tbody/row" mode="first-long"> + <xsl:param name="num-first-rows"/> + <xsl:variable name="num"> + <xsl:number/> + </xsl:variable> + <xsl:if test="$num < $num-first-rows + 1"> + <fo:table-row xsl:use-attribute-sets = "long-table-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:if> + </xsl:template> + + <xsl:template match="table[@classes = 'long']/tgroup/tbody/row" mode="second-long"> + <xsl:param name="num-first-rows"/> + <xsl:variable name="num"> + <xsl:number/> + </xsl:variable> + <xsl:if test="$num > $num-first-rows"> + <fo:table-row xsl:use-attribute-sets = "long-table-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:if> + </xsl:template> + + <xsl:template match="table[@classes ='long']/tgroup/tbody/row"> + <fo:table-row xsl:use-attribute-sets = "long-table-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes = 'long']/tgroup/tbody/row/entry"> + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="long-table-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="long-table-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="long-table-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="long-table-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template match="table[@classes = 'long']/tgroup/tbody/row/entry/paragraph"> + <fo:block xsl:use-attribute-sets="long-cell-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="rubric[@classes = 'caption-non-first-page']"/> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/toc.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/toc.xsl new file mode 100644 index 000000000..60187565b --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/toc.xsl @@ -0,0 +1,197 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <xsl:attribute-set name="toc-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-title-block"> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size">14pt</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-entry-defaults-block"> + <xsl:attribute name="space-after">3pt</xsl:attribute> + <xsl:attribute name="text-align-last">justify</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-level1-block" use-attribute-sets="toc-entry-defaults-block"> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-level2-block" use-attribute-sets="toc-entry-defaults-block"> + <xsl:attribute name="start-indent">10mm</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-level3-block" use-attribute-sets="toc-entry-defaults-block"> + <xsl:attribute name="start-indent">20mm</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-level4-block" use-attribute-sets="toc-entry-defaults-block"> + <xsl:attribute name="start-indent">30mm</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="toc-level5-block" use-attribute-sets="toc-entry-defaults-block"> + <xsl:attribute name="start-indent">40mm</xsl:attribute> + </xsl:attribute-set> + + <!--END OF ATTRIBUTE SETS--> + + <xsl:template match="topic[@classes='contents']"> + <xsl:if test="$toc-pagination ='with-body'"> + <fo:block role="toc" xsl:use-attribute-sets="toc-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:if> + </xsl:template> + + <xsl:template match="topic[@classes='contents']" mode="front"> + <fo:block role="toc" xsl:use-attribute-sets="toc-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <!--TOC title--> + <xsl:template match="topic[@classes='contents']/title" priority="2"> + <fo:block xsl:use-attribute-sets="toc-title-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + + <xsl:template match="topic[@classes = 'contents']/bullet_list"> + <xsl:apply-templates mode="toc"/> + </xsl:template> + + <xsl:template match="topic[@classes='contents']/bullet_list/list_item"/> + + <xsl:template match="reference" mode="toc"> + <xsl:apply-templates/> + </xsl:template> + + + + <xsl:template match="list_item" mode="toc"> + <xsl:apply-templates mode="toc"/> + </xsl:template> + + <xsl:template match="paragraph" mode="toc"> + <xsl:variable name="level"> + <xsl:value-of select="count(ancestor::bullet_list)"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$level = 1"> + <xsl:call-template name="toc-paragraph-level1"/> + </xsl:when> + <xsl:when test="$level = 2"> + <xsl:call-template name="toc-paragraph-level2"/> + </xsl:when> + <xsl:when test="$level = 3"> + <xsl:call-template name="toc-paragraph-level3"/> + </xsl:when> + <xsl:when test="$level = 4"> + <xsl:call-template name="toc-paragraph-level4"/> + </xsl:when> + <xsl:when test="$level = 5"> + <xsl:call-template name="toc-paragraph-level5"/> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Can't format paragraphs in TOC deeper than 5</xsl:text> + </xsl:message> + <xsl:if test="$strict='True'"> + <xsl:message terminate = "yes"> + <xsl:text>Terminating</xsl:text> + </xsl:message> + </xsl:if> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="toc-paragraph-level1"> + <fo:block xsl:use-attribute-sets = "toc-level1-block"> + <fo:inline> + <xsl:apply-templates mode="toc"/> + <fo:leader leader-pattern="dots"/> + <xsl:element name="fo:page-number-citation"> + <xsl:attribute name="ref-id"> + <xsl:value-of select="reference/@ids"/> + </xsl:attribute> + </xsl:element> + </fo:inline> + </fo:block> + </xsl:template> + + <xsl:template name="toc-paragraph-level2"> + <fo:block xsl:use-attribute-sets = "toc-level2-block"> + <fo:inline> + <xsl:apply-templates mode="toc"/> + <fo:leader leader-pattern="dots"/> + <xsl:element name="fo:page-number-citation"> + <xsl:attribute name="ref-id"> + <xsl:value-of select="reference/@ids"/> + </xsl:attribute> + </xsl:element> + </fo:inline> + </fo:block> + </xsl:template> + + <xsl:template name="toc-paragraph-level3"> + <fo:block xsl:use-attribute-sets = "toc-level3-block"> + <fo:inline> + <xsl:apply-templates mode="toc"/> + <fo:leader leader-pattern="dots"/> + <xsl:element name="fo:page-number-citation"> + <xsl:attribute name="ref-id"> + <xsl:value-of select="reference/@ids"/> + </xsl:attribute> + </xsl:element> + </fo:inline> + </fo:block> + </xsl:template> + + <xsl:template name="toc-paragraph-level4"> + <fo:block xsl:use-attribute-sets = "toc-level4-block"> + <fo:inline> + <xsl:apply-templates mode="toc"/> + <fo:leader leader-pattern="dots"/> + <xsl:element name="fo:page-number-citation"> + <xsl:attribute name="ref-id"> + <xsl:value-of select="reference/@ids"/> + </xsl:attribute> + </xsl:element> + </fo:inline> + </fo:block> + </xsl:template> + + <xsl:template name="toc-paragraph-level5"> + <fo:block xsl:use-attribute-sets = "toc-level5-block"> + <fo:inline> + <xsl:apply-templates mode="toc"/> + <fo:leader leader-pattern="dots"/> + <xsl:element name="fo:page-number-citation"> + <xsl:attribute name="ref-id"> + <xsl:value-of select="reference/@ids"/> + </xsl:attribute> + </xsl:element> + </fo:inline> + </fo:block> + </xsl:template> + + <xsl:template match="generated[@classes='sectnum'][ancestor::topic[@classes='contents']]"> + <!--not sure about this no-break space--> + <xsl:variable name="num" select="concat(substring-before(., ' '), '.')"/> + <xsl:call-template name="format-number"> + <xsl:with-param name="string" select="$num"/> + </xsl:call-template> + <!--this is a hack here--> + <xsl:text> </xsl:text> + <xsl:value-of select="substring-after(., ' ')"/> + </xsl:template> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/util.xsl b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/util.xsl new file mode 100644 index 000000000..22a008823 --- /dev/null +++ b/sandbox/paultremblay/python_interface/docutilsToFo/xsl_fo/util.xsl @@ -0,0 +1,160 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + + <xsl:variable name="toc-exists"> + <xsl:if test="/document/topic[@classes='contents']">True</xsl:if> + </xsl:variable> + <xsl:variable name="dedication-exists"> + <xsl:if test="/document/topic[@classes='dedication']">True</xsl:if> + </xsl:variable> + <xsl:variable name="abstract-exists"> + <xsl:if test="/document/topic[@classes='abstract']">True</xsl:if> + </xsl:variable> + <xsl:variable name="title-exists"> + <xsl:if test="/document/title">True</xsl:if> + </xsl:variable> + <xsl:variable name="bibliographic-exists"> + <xsl:if test="/document/docinfo">True</xsl:if> + </xsl:variable> + <!--determine page sequence, to be used in other templates--> + <xsl:variable name="page-sequence-type"> + <xsl:variable name="need-front-matter-page-sequence"> + <xsl:choose> + <xsl:when test="$title-exists='True' and $title-pagination='with-front'">True</xsl:when> + <xsl:when test="$bibliographic-exists='True' and $bibliographic-pagination='with-front'">True</xsl:when> + <xsl:when test="$abstract-exists='True' and $abstract-pagination='with-front'">True</xsl:when> + <xsl:when test="$dedication-exists='True' and $dedication-pagination='with-front'">True</xsl:when> + <xsl:when test="$toc-exists='True' and $toc-pagination='with-front'">True</xsl:when> + <xsl:otherwise>False</xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="need-toc-page-sequence"> + <xsl:choose> + <xsl:when test="$title-exists='True' and $title-pagination='with-toc'">True</xsl:when> + <xsl:when test="$bibliographic-exists='True' and $bibliographic-pagination='with-toc'">True</xsl:when> + <xsl:when test="$abstract-exists='True' and $abstract-pagination='with-toc'">True</xsl:when> + <xsl:when test="$dedication-exists='True' and $dedication-pagination='with-toc'">True</xsl:when> + <xsl:when test="$toc-exists='True' and $toc-pagination='with-toc'">True</xsl:when> + <xsl:otherwise>False</xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:choose> + <xsl:when test="$need-toc-page-sequence = 'True' and $need-front-matter-page-sequence = 'True'"> + <xsl:text>front-toc-body</xsl:text> + </xsl:when> + <xsl:when test="$need-front-matter-page-sequence = 'True'"> + <xsl:text>front-body</xsl:text> + </xsl:when> + <xsl:when test="$need-toc-page-sequence = 'True'"> + <xsl:text>toc-body</xsl:text> + </xsl:when> + <xsl:when test="$need-toc-page-sequence = 'False' and $need-front-matter-page-sequence = 'False'"> + <xsl:text>body</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate = "yes"> + <xsl:text>Stylsheet error: no page sequence found</xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="layout-page"> + <xsl:choose> + <xsl:when test = "$page-layout != ''"> + <xsl:value-of select="$page-layout"/> + </xsl:when> + <xsl:when test = "/document/container[@classes = 'body-header']|/document/container[@classes='body-footer']"> + <xsl:text>first</xsl:text> + </xsl:when> + <xsl:when test = "/document/container[@classes = 'toc-body-header']|/document/container[@classes='toc-body-footer']"> + <xsl:text>first</xsl:text> + </xsl:when> + <xsl:when test = "/document/container[@classes = 'first-header']|/document/container[@classes='first-footer']"> + <xsl:choose> + <xsl:when test="/document/container[@classes = 'odd-header']|/document/container[@classes = 'odd-footer']"> + <xsl:text>first-odd-even</xsl:text> + </xsl:when> + <xsl:when test="/document/container[@classes = 'even-header']|/document/container[@classes = 'even-footer']"> + <xsl:text>first-odd-even</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>first</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test = "/document/container[@classes = 'toc-first-header']|/document/container[@classes='toc-first-footer']"> + <xsl:choose> + <xsl:when test="/document/container[@classes = 'toc-odd-header']|/document/container[@classes = 'toc-odd-footer']"> + <xsl:text>first-odd-even</xsl:text> + </xsl:when> + <xsl:when test="/document/container[@classes = 'toc-even-header']|/document/container[@classes = 'toc-even-footer']"> + <xsl:text>first-odd-even</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>first</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test = "/document/container[@classes = 'odd-header']|/document/container[@classes='odd-footer']"> + <xsl:text>odd-even</xsl:text> + </xsl:when> + <xsl:when test = "/document/container[@classes = 'toc-odd-header']|/document/container[@classes='toc-odd-footer']"> + <xsl:text>odd-even</xsl:text> + </xsl:when> + <xsl:when test = "/document/container[@classes = 'even-header']|/document/container[@classes='even-footer']"> + <xsl:text>odd-even</xsl:text> + </xsl:when> + <xsl:when test = "/document/container[@classes = 'toc-even-header']|/document/container[@classes='toc-even-footer']"> + <xsl:text>odd-even</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>simple</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:template name="my-boolean-func"> + <xsl:param name="string"/> + <xsl:param name="name"/> + <xsl:param name="allow-empty-string" select="boolean('true')"/> + <xsl:choose> + <xsl:when test="$string = '' and $allow-empty-string"> + <xsl:value-of select= "boolean('')"/> + </xsl:when> + <xsl:when test="$string = 'yes' or $string = 'Yes' or $string = 'true' or $string = 'True'"> + <xsl:value-of select= "boolean('true')"/> + </xsl:when> + <xsl:when test="$string = 'no' or $string = 'No' or $string = 'false' or $string = 'False'"> + <xsl:value-of select= "boolean('')"/> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="msg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="$string"/> + <xsl:text>"</xsl:text> + <xsl:text> not a valid boolean value for </xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>
</xsl:text> + </xsl:variable> + <xsl:call-template name="quit-message"> + <xsl:with-param name="msg" select="$msg"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:variable name="custom-spc-header-footer"> + <xsl:call-template name="my-boolean-func"> + <xsl:with-param name="string" select="$custom-spacing-header-footer"/> + <xsl:with-param name="name" select="'custom-spacing-header-footer'"/> + </xsl:call-template> + </xsl:variable> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/scripts/docutils_to_fo.py b/sandbox/paultremblay/python_interface/scripts/docutils_to_fo.py new file mode 100755 index 000000000..b64cde8e0 --- /dev/null +++ b/sandbox/paultremblay/python_interface/scripts/docutils_to_fo.py @@ -0,0 +1,118 @@ +#! /Library/Frameworks/Python.framework/Versions/2.7/bin/python + +# $Id$ + +import sys, commands, shlex, subprocess, argparse, ConfigParser, os, tempfile +import docutilsToFo.rst2xml_lib +import docutilsToFo.make_stylesheet + +def get_args(): + use = 'Converts a file to XSL-FO\n' + parser = argparse.ArgumentParser(description=use) + # parser.add_argument('--xslt', nargs=1, choices = ['xsltproc', 'lxml', 'saxon'], default=['lxml'], + # dest='xsl_transform', help = 'choose which processer to use when transforming' ) + parser.add_argument('--strict', nargs=1, choices = ['True', 'False'], + default = 'True', help = 'whether to quit on errors', dest='strict') + parser.add_argument('--clean', action="store_const", const=True, + help = 'Whether to remove files after test', dest='clean') + parser.add_argument('--debug', action="store_const", + const=True, help = 'print out verbose messages', dest='debug') + in_file_msg = 'The file to convert. Will either be a path to a file, or standard in.' + parser.add_argument('in_file', nargs='?', help = in_file_msg, default=sys.stdin) + parser.add_argument('-s, -stylesheet', nargs=1, help = 'The root stylesheet to use', + dest='root_stylesheet') + parser.add_argument('-o, --out', nargs=1, help = 'Path to output result', dest='out_path') + parser.add_argument('--config', nargs=1, help = 'Path to configuration file', dest='config_file') + parser.add_argument('--verbose', nargs=1, type = int, help = 'How verbose messaging should be', + dest='verbose') + parser.add_argument('--no-fo-valid', action="store_const", + const=True, help = 'don\'t validate FO', dest='no_valid_fo') + return parser.parse_args() + +def parse_config_files(the_paths): + config = ConfigParser.SafeConfigParser() + for the_path in the_paths: + config.read(the_path) + return config + +def read_config_files(): + config_files = [] + if os.environ.get('HOME'): + config_files.append(os.path.join(os.environ.get('HOME'), '.docutils')) + config_files.append(os.path.join(os.getcwd(), 'docutils.conf')) + if arg.config_file: + config_files.append(arg.config_file[0]) + config = parse_config_files(config_files) + return config + +def get_config_option(the_option, section='FO'): + try: + value = config_obj.get(section, the_option) + except ConfigParser.NoSectionError, error: + return + except ConfigParser.NoOptionError, error: + return + + +arg = get_args() +config_obj = read_config_files() +# get_config_option('strict') +verbose = arg.verbose +if verbose: + verbose = arg.verbose[0] +else: + verbose = 2 + +debug = arg.debug +if debug: verbose = 5 +if debug: sys.stderr.write('In debug mode\n') +if debug: sys.stderr.write('script is "%s"\n' % __file__) +in_file = arg.in_file +if debug: + sys.stderr.write('in_file is "%s"\n' % str(in_file)) +config_file = arg.config_file + +valid_fo = True +if arg.no_valid_fo: + valid_fo = False +root_stylesheet = get_config_option('xsl-stylesheet') +if arg.root_stylesheet: root_stylesheet = arg.root_stylesheet[0] + +if debug: sys.stderr.write('root_stylesheet is "%s"\n' % str(root_stylesheet)) +out_path = None +if arg.out_path: + out_path = arg.out_path[0] +else: + out_xml = tempfile.mkstemp(suffix = '.fo')[1] + +# get path to put stylesheet +if out_path: + filename, ext = os.path.splitext(out_path) + out_xsl = '%s.xsl' % (filename) +else: + out_xsl = tempfile.mkstemp(suffix = '.xsl')[1] +if debug: + sys.stderr.write('out_xsl (file to output XSL stylesheet) is "%s"\n' % (out_xsl)) + +# make a stylesheet +ss_obj = docutilsToFo.make_stylesheet.ReadConfig(import_ss = root_stylesheet, + verbose = verbose, config_file = config_file) +try: + ss_string = ss_obj.make_stylesheet() +except docutilsToFo.make_stylesheet.FOConfigFileException, msg: + sys.stderr.write(str(msg)) + sys.stderr.write('\nscript now quitting\n') + sys.exit(1) +write_obj = file(out_xsl, 'w') +write_obj.write(ss_string) +write_obj.close() + +# convert to FO +error = docutilsToFo.rst2xml_lib.transform_lxml(xslt_file = out_xsl, xml_file = in_file, + param_dict = {}, out_file = out_path, verbose = verbose, valid_fo = valid_fo ) +if error: + if type(error) == type(' '): + sys.stderr.write(error) + sys.exit(1) + + diff --git a/sandbox/paultremblay/python_interface/scripts/validate_docutils.py b/sandbox/paultremblay/python_interface/scripts/validate_docutils.py new file mode 100755 index 000000000..12aeb0cbd --- /dev/null +++ b/sandbox/paultremblay/python_interface/scripts/validate_docutils.py @@ -0,0 +1,10 @@ +#! /Library/Frameworks/Python.framework/Versions/2.7/bin/python +import sys, os, argparse +import docutilsToFo.rst2xml_lib + +parser = argparse.ArgumentParser(description='validate docutils document') +parser.add_argument('xml_file', nargs=1, help = 'file to validate') +args = parser.parse_args() +xml_file = args.xml_file[0] + +docutilsToFo.rst2xml_lib.validate_docutils(xml_file) diff --git a/sandbox/paultremblay/python_interface/scripts/validate_fo.py b/sandbox/paultremblay/python_interface/scripts/validate_fo.py new file mode 100644 index 000000000..f311f1544 --- /dev/null +++ b/sandbox/paultremblay/python_interface/scripts/validate_fo.py @@ -0,0 +1,12 @@ +#! /Library/Frameworks/Python.framework/Versions/2.7/bin/python +import sys, os, argparse +import docutilsToFo.rst2xml_lib + +parser = argparse.ArgumentParser(description='validate docutils document') +parser.add_argument('xml_file', nargs=1, help = 'file to validate') +args = parser.parse_args() +xml_file = args.xml_file[0] + +error = docutilsToFo.rst2xml_lib.validate_fo_xsl(xml_file) +if error: + sys.exit(1) diff --git a/sandbox/paultremblay/python_interface/setup.py b/sandbox/paultremblay/python_interface/setup.py new file mode 100644 index 000000000..d0127adc8 --- /dev/null +++ b/sandbox/paultremblay/python_interface/setup.py @@ -0,0 +1,42 @@ +import sys, os, shutil, glob +from distutils.core import setup + +def remove_build(): + if os.path.isdir('build'): + shutil.rmtree('build') + +# get the script name +def get_script_name(): + return os.path.join('scripts', 'docutils_to_fo.py') + +xsl_files = glob.glob('xsl_fo/*') + +def remove_files(the_list): + for the_path in the_list: + os.remove(the_path) + +if 'sdist' in sys.argv: + os.chdir('test_files') + rm_files = [] + rm_files.extend(glob.glob('*.pdf')) + rm_files.extend(glob.glob('*.fo')) + rm_files.extend(glob.glob('*.xml')) + rm_files.extend(glob.glob('*.xsl')) + remove_files(rm_files) + os.chdir('..') + +remove_build() +script_name = get_script_name() + +setup(name="docutilsToFo", + version= '.6' , + description="Convert Docutils to FO", + author="Paul Tremblay", + author_email="noone@nowhere.com", + license = 'GNU GPL', + # url = "http://rtf2xml.sourceforge.net/", + packages=['docutilsToFo'], + package_dir = {'docutilsToFo': 'docutilsToFo'}, + package_data={'docutilsToFo': ['xsl_fo/*.xsl', 'valid/*.dtd', 'valid/*.rng', 'valid/*xsl']}, + scripts=[script_name], + ) diff --git a/sandbox/paultremblay/python_interface/test.py b/sandbox/paultremblay/python_interface/test.py new file mode 100644 index 000000000..986938cdd --- /dev/null +++ b/sandbox/paultremblay/python_interface/test.py @@ -0,0 +1,473 @@ +import sys, os, glob, commands, shlex, subprocess, argparse +import docutilsToFo.rst2xml_lib +from lxml import etree +import lxml +from docutilsToFo.rst2xml_lib import transform_lxml, publish_xml_cmdline, validate_fo_xsl + +# $Id$ +TEST = False +STRICT = True + +parser = argparse.ArgumentParser(description='Test all the files') +parser.add_argument('--xslt', nargs=1, choices = ['xsltproc', 'lxml', 'saxon', 'xalan'], default=['lxml'], + dest='xsl_transform', help = 'choose which processer to use when transforming' ) +parser.add_argument('--pdf', action="store_const", const=True, help = 'convert to PDF', dest='pdf') +parser.add_argument('--no-rst', action="store_const", const=True, help = 'don\'t convert to RST', dest='no_rst') +parser.add_argument('--no-fo', action="store_const", const=True, help = 'don\'t convert to FO', dest='no_fo') +parser.add_argument('--strict', nargs=1, choices = ['True', 'False'], + default = 'True', help = 'whether to quit on errors', dest='strict') +parser.add_argument('--debug', action="store_const", const=True, help = 'do debug messaging', dest='debug') +parser.add_argument('--verbose', action="store_const", const=True, help = 'be verose in messaging', dest='verbose') +parser.add_argument('--clean', action="store_const", const=True, help = 'whether to remove files after test', dest='clean') +parser.add_argument('--full', action="store_const", const=True, help = 'Do a full test (for developer only)', dest='full') + +arg = parser.parse_args() +PDF = arg.pdf +if arg.strict == 'True': + STRICT = True +else: + STRICT = False +debug = False +debug = arg.debug +verbose = arg.verbose +if debug: verbose = True +FULL = False +if arg.full: + FULL = True + PDF = True + +# ========================================================================================= +# stylesheet test +# ========================================================================================= +test_dict = { + 'long_plain.xml':[({'page-layout':'simple'}, 'simple_no_page_nos.fo'), + ({'page-layout': 'first'}, 'first_page_diff_no_page_nos.fo'), + ({'page-layout': 'odd-even'}, 'odd_even_no_page_nos.fo'), + ({'page-layout': 'first-odd-even'}, 'first_odd_even_no_page_nos.fo') + ], + 'header_footer.xml':[({'page-layout': 'simple'}, 'header_footer.fo'), + ({'page-layout': 'simple', 'suppress-first-page-header': 'True'}, 'header_footer2.fo'), + ({'page-layout': 'first' }, 'first_page_header_footer.fo'), + ({'page-layout': 'first', 'suppress-first-page-header': 'True'}, 'first_page_suppress_header.fo'), + ({'page-layout': 'first', 'suppress-first-page-header': 'True', 'suppress-first-page-header': 'True'}, + 'first_suppress_header_footer.fo'), + ({'page-layout': 'odd-even' }, 'odd_even_page_header_footer.fo'), + ({'page-layout': 'first-odd-even' }, 'first-odd_even_page_header_footer.fo'), + ({'page-layout': 'first-odd-even', 'suppress-first-page-header': 'True', 'suppress-first-page-header': 'True'}, + 'first_odd_even_page_header_footer_suppress_first.fo'), + ], + 'opt_list.xml':[({},'opt_list.fo'), + ({'option-list-format': 'definition'}, 'opt_list_as_def.fo') + ], + 'table_csv.xml':[({},'table_csv.fo'), + ({'table-title-placement':'top'},'table_caption_top_csv.fo') + ], + 'footnotes.xml':[({},'footnotes.fo'), + ({'footnote-style': 'traditional'},'footnotes_traditional.fo') + ], + 'endnotes.xml':[({'footnote-placement':'endnote'}, 'endnotes.fo') + ], + 'hyperlinks.xml':[({}, 'hyperlinks.fo'), + ({'internal-link-type':'page'}, 'hyperlinks_page.fo'), + ({'internal-link-type':'page-link'}, 'hyperlinks_link_page.fo') + ], + + 'title_subtitle.xml':[({}, 'title_subtitle.fo'), + ({'page-layout': 'first'}, 'title_subtitle_first.fo'), + ({'page-layout': 'odd-even'}, 'title_subtitle_odd_even.fo'), + ({'page-layout': 'first-odd-even'}, 'title_subtitle_first_odd_even.fo') + ], + + 'bibliographic_fields_toc.xml':[ + ({},'bibliographic_fields_toc.fo'), + ({'page-layout':'first'},'bibliographic_fields_first_toc.fo'), + ({'page-layout':'odd-even'},'bibliographic_fields_odd_even_toc.fo'), + ({'page-layout':'first-odd-even'},'bibliographic_fields_first_odd_even_toc.fo'), + ], + 'front_body.xml':[({},'front_matter.fo'), + ({'title-pagination':'with-front', + 'bibliographic-pagination':'with-front', + 'dedication-pagination':'with-front', + 'dedication-pagination':'with-front', + 'abstract-pagination':'with-front', + 'toc-pagination':'with-front'}, + 'front_matter2.fo'), + ({'title-pagination':'with-front', + 'bibliographic-pagination':'with-front', + 'dedication-pagination':'with-body', + 'dedication-pagination':'with-front', + 'abstract-pagination':'with-toc', + 'toc-pagination':'with-front'}, + 'front_matter3.fo'), + ({'title-pagination':'with-body', + 'bibliographic-pagination':'with-front', + 'dedication-pagination':'with-toc', + 'dedication-pagination':'with-front', + 'abstract-pagination':'with-toc', + 'toc-pagination':'with-body'}, + 'front_matter4.fo'), + ({'title-pagination':'with-body', + 'bibliographic-pagination':'with-front', + 'dedication-pagination':'with-toc', + 'dedication-pagination':'with-front', + 'abstract-pagination':'with-toc', + 'toc-pagination':'with-body', + 'front-order':'toc, abstract, dedication,,title, bibliographic'}, + 'front_matter5.fo'), + ], + + 'table_borderless.xml':[({}, 'table_borderless.fo'),], + 'table_grid_class.xml':[({}, 'table_grid_class.fo'),], + 'table_long1.xml':[({}, 'table_long1.fo'), + ({'table-title-placement':'top'}, 'table_long1_top_title.fo'), + ({'table-title-placement':'top','long-rows-first-page':'8' }, 'table_long1_top_title_split.fo'), + + ], + 'table_long2.xml':[({}, 'table_long2.fo'), + ({'table-title-placement':'top'}, 'table_long2_top_title.fo'), + ({'table-title-placement':'top','long-rows-first-page':'8' }, 'table_long2_top_title_split.fo'), + ], + } +# ========================================================================================= +# Docutils_to_fo test +# ========================================================================================= + +docfo_commands = [ + ('long_plain.xml', 'paper_size.conf'), + ('long_plain.xml', 'margins_simple.conf'), + ('long_plain.xml', 'margins_first_odd_even.conf'), + ('long_plain.xml', 'header_footer2.conf'), + ('long_plain.xml', 'header_footer3.conf'), + ('simple.xml', 'paragraph1.conf'), + ('simple.xml', 'paragraph2.conf'), + ('simple.xml', 'paragraph3.conf'), + ('simple2.xml', 'paragraph4.conf'), # long para should not break across page + ('simple.xml', 'paragraph5.conf'), # first paragraph test + ('front_body.xml', 'front1.conf'), # all front matter + ('front_body.xml', 'front2.conf'), # change order of front matter + ('title_subtitle.xml', 'title1.conf'), # title with front matter + ('bibliographic_fields.xml', 'bibliographic_fields.conf'), # generic bibliographic fields + ('bibliographic_fields.xml', 'bibliographic_fields2.conf'), # bibliographic fields as blocks + ('bibliographic_fields.xml', 'dedication1.conf'), # generic dedication + ('bibliographic_fields.xml', 'abstract1.conf'), # generic dedication + ('toc.xml', 'toc1.conf'), # generic toc + ('bibliographic_fields_toc.xml', 'page_number1.conf'), # page numbering + ('section.xml', 'section1.conf'), # generic sections + ('transition.xml', 'transition1.conf'), # transition + ('bullet_list.xml', 'bullet_list1.conf'), # bullet list + ('enumerated_list.xml', 'enumerated_list1.conf'), # enumerated list + ('definition_list.xml', 'definition_list1.conf'), # definition list + ('field_lists.xml', 'field_list1.conf'), # field list + ('opt_list.xml', 'option_list1.conf'), # option list as list + ('opt_list.xml', 'option_list2.conf'), # option list as definition list + ('literal_block.xml', 'literal_block1.conf'), # literal block + ('line_block.xml', 'line_block1.conf'), # line block + ('header_footer2.xml', 'header_footer4.conf'), # first header and footer + ('header_footer5.xml', 'header_footer5.conf'), # odd even + ('header_footer5.xml', 'header_footer6.conf'), # odd even, suppress first + ('header_footer_toc1.xml', 'header_footer_toc1.conf'), # first and other + ('header_footer_toc4.xml', 'header_footer_toc2.conf'), # odd even, + ('header_footer_toc3.xml', 'header_footer_toc3.conf'), # first odd even, + ('header_footer_toc2.xml', 'header_footer_toc1.conf'), # suppress first + ('block.xml', 'block_quote1.conf'), # block quote + ('table_simple.xml', 'table1.conf'), # default table + ] + +def error_func(msg, the_path = None): + if the_path: + sys.stderr.write('Problems with "%s"\n' % the_path) + if type(msg) == type(''): + sys.stderr.write(msg) + if STRICT: + sys.exit(1) + pass + +def transform_xsl(xsl_file, xml_file, param_dict = {}, out_file = None, xsl_transform = 'lxml'): + if not out_file: + base, ext = os.path.splitext(xml_file) + out_file = '%s.fo' % (base) + if xsl_transform == 'xsltproc': + command = 'xsltproc -o %s ' % (out_file) + params = param_dict.keys() + for param in params: + command += ' --stringparam %s "%s" ' % (param, param_dict[param]) + command += ' %s %s ' % (xsl_file, xml_file) + if TEST: + print command + status, output = commands.getstatusoutput(command) + if status: + msg = 'error converting %s to FO\n' % (xml_file) + msg += 'command = "%s" \n' % (command) + msg += output + msg += '\n' + error_func(msg) + elif xsl_transform == 'saxon': + command = 'saxon.sh ' + command += ' -o %s' % (out_file) + if STRICT: + command += ' -warnings:fatal ' + command += ' %s %s' % (xml_file, xsl_file) + params = param_dict.keys() + for param in params: + command += ' %s="%s" ' % (param, param_dict[param]) + status, output = commands.getstatusoutput(command) + if status: + msg = 'error converting %s to Fo\n' % (xml_file) + msg += 'command = "%s" \n' % (command) + msg += output + msg += '\n' + error_func(msg) + elif xsl_transform == 'xalan': + command = 'xalan.sh ' + command += ' -OUT %s' % (out_file) + command += ' -IN %s -XSL %s' % (xml_file, xsl_file) + params = param_dict.keys() + for param in params: + command += ' -PARAM %s "%s" ' % (param, param_dict[param]) + status, output = commands.getstatusoutput(command) + if status: + msg = 'error converting %s to Fo\n' % (xml_file) + msg += 'command = "%s" \n' % (command) + msg += output + msg += '\n' + error_func(msg) + elif xsl_transform == 'lxml': + error = transform_lxml(xslt_file = xsl_file, xml_file= xml_file, param_dict=param_dict, out_file= out_file) + if error: + error_func(error, xml_file) + else: + sys.stderr.write('"%s" not a valid xsl_transform. Fix. Script now quitting\n' % (xsl_transform)) + sys.exit(1) + + +def convert_to_xml(path_list): + if verbose: + sys.stderr.write('converting to xml...\n') + num_files = len(path_list) + counter = 0 + for the_path in path_list: + counter += 1 + base, ext = os.path.splitext(the_path) + out_file = '%s.xml' % (base) + if verbose: + sys.stderr.write('converting "%s" to "%s"\n' % (the_path, out_file)) + publish_xml_cmdline (in_path = the_path, out_path = out_file) + +# simple, fail-proof method +def convert_to_xml_command(path_list): + # print 'converting to xml...' + num_files = len(path_list) + counter = 0 + for the_path in path_list: + counter += 1 + # print 'converting %s of %s files' % (counter, num_files) + base, ext = os.path.splitext(the_path) + out_file = '%s.xml' % (base) + command = 'rst2xml.py --trim-footnote-reference-space %s %s' % (the_path, out_file) + status, output = commands.getstatusoutput(command) + +def convert_to_fo(xsl_transform): + if verbose: + sys.stderr.write('converting to fo...\n') + xml_files = glob.glob('*.xml') + len_simple = len(xml_files) + the_keys = test_dict.keys() + for the_key in the_keys: + if the_key not in xml_files: + sys.stderr.write('%s not found in test_files; fix. Script now quitting' % (the_key)) + sys.exit(1) + len_complex = len(the_keys) + len_inside = 0 + for the_key in the_keys: + this_inside = len(test_dict[the_key]) + len_inside += this_inside + num_files = len_simple - len_complex + len_inside + counter = 0 + for xml_file in xml_files: + params = {'strict':'True'} + transform_info = test_dict.get(xml_file) + if transform_info: + for info in transform_info: + counter += 1 + if verbose: + sys.stderr.write('converting "%s" to %s to FO\n' % (xml_file, out_file)) + # print 'converting %s of %s files' % (counter, num_files) + added_params = info[0] + out_file = info[1] + params.update(added_params) + transform_xsl(xsl_file = '../docutilsToFo/xsl_fo/docutils_to_fo.xsl', + xml_file = xml_file, param_dict= params, out_file = out_file, + xsl_transform = xsl_transform) + + validate_the_fo(out_file) + + else: + counter += 1 + # print 'converting %s of %s files' % (counter, num_files) + base, ext = os.path.splitext(xml_file) + out_file = '%s.fo' % (base) + if verbose: + sys.stderr.write('converting "%s" to %s FO\n' % (xml_file, out_file)) + transform_xsl(xsl_file = '../docutilsToFo/xsl_fo/docutils_to_fo.xsl', xml_file = xml_file, param_dict=params, xsl_transform = xsl_transform) + validate_the_fo(out_file) + +def convert_to_pdf(): + # print 'converting to pdf...' + fo_files = glob.glob('*.fo') + num_files = len(fo_files) + counter = 0 + for fo_file in fo_files: + counter += 1 + # print 'converting %s of %s files' % (counter, num_files) + base, ext = os.path.splitext(fo_file) + out_file = '%s.pdf' % (base) + command = 'fop %s %s' % (fo_file, out_file) + status, output = commands.getstatusoutput(command) + if status: + msg = 'error converting %s to PDF\n' % (fo_file) + msg += 'command = "%s" \n' % (command) + msg += output + msg += '\n' + error(msg) + +def convert_fo_to_pdf(fo_file, out_file): + command = 'fop %s %s' % (fo_file, out_file) + if verbose: + sys.stderr.write('\n doing command "%s"\n' % (command)) + status, output = commands.getstatusoutput(command) + if status: + msg = 'error converting %s to PDF\n' % (fo_file) + msg += 'command = "%s" \n' % (command) + msg += output + msg += '\n' + error(msg) + + +# not used +def make_conf_file(the_dict, section = 'FO', conf_path = 'docutils.conf'): + rm_path(conf_path) + write_obj = file(conf_path, 'w') + the_keys = the_dict.keys() + write_obj.write('[%s]\n' % section) + for the_key in the_keys: + write_obj.write('%s = %s\n' % (the_key, the_dict[the_key])) + write_obj.close() + return conf_path + +def run_docutils_command(command): + status, output = commands.getstatusoutput(command) + if status: + msg = 'error converting to FO with docutilst_to_fo.py:\n' + msg += 'command = "%s" \n' % (command) + msg += output + msg += '\n' + error_func(msg) + +def validate_the_fo(xml_file): + error = validate_fo_xsl(xml_file) + if error: + sys.stderr.write('Problems converting "%s"\n' % (xml_file)) + error_func('') + +def test_docutils_to_fo_script(script_command): + if verbose: + sys.stderr.write('\n\n==========================================\n') + sys.stderr.write('TESTING DOCUTILS SCRIPT\n') + sys.stderr.write('\n==========================================\n') + command = '%s -h' % script_command + status, output = commands.getstatusoutput(command) + default__commands = ' --config docutils.conf ' + for info in docfo_commands: + command = script_command + in_file = info[0] + filename,ext = os.path.splitext(in_file) + out_file = '%s.fo' % filename + out_opt = ' -o %s ' % out_file + config_file = os.path.join('conf_files', info[1]) + if not os.path.isfile(config_file): + sys.stderr.write('Can\'t find "%s" conf file\n' % config_file) + sys.exit(1) + config_opt = ' --config %s ' % config_file + command += ' %s %s %s' % (out_opt, config_opt, in_file) + if verbose: + sys.stderr.write('Converting "%s" to "%s" with "%s" \n' % (in_file, out_file, config_file)) + run_docutils_command(command) + validate_the_fo(out_file) + if PDF: + out_pdf = '%s.pdf' % filename + convert_fo_to_pdf(fo_file = out_file, out_file = out_pdf) + + +def clean(): + remove_paths(glob.glob('*.xml')) + remove_paths(glob.glob('*.xsl')) + remove_paths(glob.glob('*.fo')) + remove_paths(glob.glob('*.pdf')) + +def rm_path(the_path): + try: + os.remove(the_path) + except OSError: + pass + +def remove_paths(list_of_paths): + for the_path in list_of_paths: + rm_path(the_path) + +def full(): + # main() + if verbose: + sys.stderr.write('In FULL mode\n') + clean() + script_path = os.path.abspath(os.path.join('scripts', 'docutils_to_fo.py')) + script_command = 'python %s ' % script_path + current_dir = os.getcwd() + os.chdir('test_files') + rst_files = glob.glob('*.rst') + convert_to_xml(rst_files) + xsl_trans = ['xsltproc', 'saxon', 'xalan', 'lxml',] + for xsl_tran in xsl_trans: + if verbose: + sys.stderr.write('Transforming to FO with %s\n' % (xsl_tran)) + convert_to_fo(xsl_transform = xsl_tran) + if xsl_tran != 'lxml': + remove_paths(glob.glob('*.fo')) + convert_to_pdf() + test_docutils_to_fo_script(script_command) + clean() + os.chdir(current_dir) + if verbose: + sys.stderr.write('\n\nSUCCESS!\n') + + +def main(): + script_path = os.path.abspath(os.path.join('scripts', 'docutils_to_fo.py')) + script_command = 'python %s ' % script_path + current_dir = os.getcwd() + os.chdir('test_files') + if not arg.no_rst: + rst_files = glob.glob('*.rst') + convert_to_xml(rst_files) + if not arg.no_fo: + convert_to_fo(xsl_transform = arg.xsl_transform[0]) + if PDF: + convert_to_pdf() + for fo_file in glob.glob('*.fo'): + os.remove(fo_file) + test_docutils_to_fo_script(script_command) + #if arg.clean: + # clean() + clean() + os.chdir(current_dir) + +try: + import locale + locale.setlocale(locale.LC_ALL, '') +except: + pass + +if FULL: + full() +else: + main() + diff --git a/sandbox/paultremblay/python_interface/test_files/admonition.rst b/sandbox/paultremblay/python_interface/test_files/admonition.rst new file mode 100644 index 000000000..8026a64e4 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/admonition.rst @@ -0,0 +1,79 @@ +.. attention:: + + Make sure Admonitions are specially marked "topics" that can appear anywhere + an ordinary body element can. They contain arbitrary body elements. + Typically, an admonition is rendered as an offset block in a document, + sometimes outlined or shaded, with a title matching the admonition type. For + +Paragraph text + +.. caution:: + + first para + + second para + +Paragraph text + +.. danger:: + + first para + + second para + +Paragraph text + +.. error:: + + first para + + second para + +Paragraph text + +.. hint:: + + first para + + second para + +Paragraph text + +.. important:: + + first para + + second para + +Paragraph text + +.. note:: + + first para + + second para + +Paragraph text + +.. tip:: + + first para + + second para + +Paragraph text + +.. warning:: + + first para + + second para + +Paragraph text + + +.. admonition:: custom + + first para + + second para diff --git a/sandbox/paultremblay/python_interface/test_files/badaman_treasure_chest.png b/sandbox/paultremblay/python_interface/test_files/badaman_treasure_chest.png Binary files differnew file mode 100644 index 000000000..8dfe96218 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/badaman_treasure_chest.png diff --git a/sandbox/paultremblay/python_interface/test_files/badaman_treasure_chest.svg b/sandbox/paultremblay/python_interface/test_files/badaman_treasure_chest.svg new file mode 100644 index 000000000..f3c94a5b5 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/badaman_treasure_chest.svg @@ -0,0 +1,2223 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.1" + width="539.13574" + height="583.03931" + id="svg59948"> + <defs + id="defs59950"> + <linearGradient + x1="-591.9881" + y1="596.0116" + x2="-191.41371" + y2="770.94598" + id="linearGradient5544" + xlink:href="#linearGradient4288" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4288"> + <stop + id="stop4290" + style="stop-color:#28170b;stop-opacity:1" + offset="0" /> + <stop + id="stop4292" + style="stop-color:#28170b;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="24.160318" + y1="643.25085" + x2="-302.004" + y2="636.17224" + id="linearGradient5546" + xlink:href="#linearGradient4298" + gradientUnits="userSpaceOnUse" /> + + <linearGradient + id="linearGradient4298"> + <stop + id="stop4300" + style="stop-color:#28170b;stop-opacity:1" + offset="0" /> + <stop + id="stop4302" + style="stop-color:#28170b;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="1.3670095" + y1="646.57666" + x2="-89.771828" + y2="546.05579" + id="linearGradient5548" + xlink:href="#linearGradient4308" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4308"> + <stop + id="stop4310" + style="stop-color:#28170b;stop-opacity:1" + offset="0" /> + <stop + id="stop4312" + style="stop-color:#28170b;stop-opacity:0" + offset="1" /> + </linearGradient> + + <linearGradient + x1="106.95468" + y1="565.45325" + x2="98.391373" + y2="485.37598" + id="linearGradient5550" + xlink:href="#linearGradient4318" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4318"> + <stop + id="stop4320" + style="stop-color:#28170b;stop-opacity:1" + offset="0" /> + <stop + id="stop4322" + style="stop-color:#28170b;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-49.437981" + y1="407.13318" + x2="-1.2676413" + y2="377.97742" + id="linearGradient5552" + xlink:href="#linearGradient4328" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.87672205,0,0,1,-14.92819,0)" /> + <linearGradient + id="linearGradient4328"> + <stop + id="stop4330" + style="stop-color:#28170b;stop-opacity:1" + offset="0" /> + <stop + id="stop4332" + style="stop-color:#28170b;stop-opacity:0" + offset="1" /> + + </linearGradient> + <linearGradient + x1="-35.173885" + y1="359.95712" + x2="-37.924351" + y2="302.6282" + id="linearGradient5554" + xlink:href="#linearGradient4346" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4346"> + <stop + id="stop4348" + style="stop-color:#784421;stop-opacity:1" + offset="0" /> + <stop + id="stop4350" + style="stop-color:#784421;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-68.123146" + y1="346.03271" + x2="16.13443" + y2="444.63202" + id="linearGradient5556" + xlink:href="#linearGradient4356" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.89262888,0,0,1,-13.001972,0)" /> + <linearGradient + id="linearGradient4356"> + <stop + id="stop4358" + style="stop-color:#784421;stop-opacity:1" + offset="0" /> + + <stop + id="stop4360" + style="stop-color:#784421;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-136.90518" + y1="364.03339" + x2="-171.13147" + y2="437.55652" + id="linearGradient5558" + xlink:href="#linearGradient4372" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4372"> + <stop + id="stop4374" + style="stop-color:#110904;stop-opacity:1" + offset="0" /> + <stop + id="stop4376" + style="stop-color:#110904;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-302.96609" + y1="653.05542" + x2="-195.21664" + y2="446.43002" + id="linearGradient5560" + xlink:href="#linearGradient4384" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4384"> + + <stop + id="stop4386" + style="stop-color:#784421;stop-opacity:1" + offset="0" /> + <stop + id="stop4388" + style="stop-color:#784421;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-223.10474" + y1="830.52509" + x2="-258.59866" + y2="597.27924" + id="linearGradient5562" + xlink:href="#linearGradient4396" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4396"> + <stop + id="stop4398" + style="stop-color:#2b2200;stop-opacity:1" + offset="0" /> + <stop + id="stop4400" + style="stop-color:#2b2200;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-223.10474" + y1="830.52509" + x2="-258.59866" + y2="597.27924" + id="linearGradient5564" + xlink:href="#linearGradient4396" + gradientUnits="userSpaceOnUse" /> + + <linearGradient + x1="-223.10474" + y1="830.52509" + x2="-258.59866" + y2="597.27924" + id="linearGradient5566" + xlink:href="#linearGradient4396" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-248.77097,-149.12154)" /> + <linearGradient + x1="-223.10474" + y1="830.52509" + x2="-258.59866" + y2="597.27924" + id="linearGradient5568" + xlink:href="#linearGradient4396" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-248.77097,-149.12154)" /> + <linearGradient + x1="-223.10474" + y1="830.52509" + x2="-258.59866" + y2="597.27924" + id="linearGradient5570" + xlink:href="#linearGradient4396" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,-0.90979902,0,1,261.77123,-319.08475)" /> + <linearGradient + x1="-223.10474" + y1="830.52509" + x2="-258.59866" + y2="597.27924" + id="linearGradient5572" + xlink:href="#linearGradient4396" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,-0.90979902,0,1,261.77123,-319.08475)" /> + <linearGradient + x1="-548.57062" + y1="291.35492" + x2="-467.00208" + y2="639.14154" + id="linearGradient5574" + xlink:href="#linearGradient3255" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient3255"> + <stop + id="stop3257" + style="stop-color:#c87137;stop-opacity:1" + offset="0" /> + <stop + id="stop3259" + style="stop-color:#784421;stop-opacity:1" + offset="1" /> + </linearGradient> + + <linearGradient + x1="-60.055931" + y1="421.32675" + x2="-78.879433" + y2="435.66843" + id="linearGradient5576" + xlink:href="#linearGradient4339" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4339"> + <stop + id="stop4341" + style="stop-color:#d38d5f;stop-opacity:1" + offset="0" /> + <stop + id="stop4343" + style="stop-color:#28170b;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-581.73578" + y1="514.54785" + x2="-290.41974" + y2="740.42987" + id="linearGradient5578" + xlink:href="#linearGradient3265" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient3265"> + <stop + id="stop3267" + style="stop-color:#28170b;stop-opacity:1" + offset="0" /> + <stop + id="stop3269" + style="stop-color:#28170b;stop-opacity:0" + offset="1" /> + + </linearGradient> + <linearGradient + x1="-581.73578" + y1="514.54785" + x2="-290.41974" + y2="740.42987" + id="linearGradient5580" + xlink:href="#linearGradient3265" + gradientUnits="userSpaceOnUse" /> + <linearGradient + x1="-548.57062" + y1="291.35492" + x2="-467.00208" + y2="639.14154" + id="linearGradient5582" + xlink:href="#linearGradient3255" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(265.32172,136.24629)" /> + <linearGradient + x1="-581.73578" + y1="514.54785" + x2="-290.41974" + y2="740.42987" + id="linearGradient5584" + xlink:href="#linearGradient3265" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(270.69987,134.45358)" /> + <linearGradient + x1="-111.55237" + y1="493.33273" + x2="-83.664268" + y2="413.47137" + id="linearGradient5586" + xlink:href="#linearGradient4249" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4249"> + <stop + id="stop4251" + style="stop-color:#28170b;stop-opacity:1" + offset="0" /> + <stop + id="stop4253" + style="stop-color:#28170b;stop-opacity:0" + offset="1" /> + </linearGradient> + + <linearGradient + x1="-392.96854" + y1="177.69025" + x2="-202.82248" + y2="290.51025" + id="linearGradient5588" + xlink:href="#linearGradient4261" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4261"> + <stop + id="stop4263" + style="stop-color:#2b1100;stop-opacity:1" + offset="0" /> + <stop + id="stop4265" + style="stop-color:#2b1100;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-201.55484" + y1="448.9653" + x2="-206.6254" + y2="319.66599" + id="linearGradient5590" + xlink:href="#linearGradient4271" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-2.535281,-2.5352803)" /> + <linearGradient + id="linearGradient4271"> + <stop + id="stop4273" + style="stop-color:#2b1100;stop-opacity:1" + offset="0" /> + <stop + id="stop4275" + style="stop-color:#2b1100;stop-opacity:0" + offset="1" /> + + </linearGradient> + <linearGradient + x1="-244.6546" + y1="705.02869" + x2="-240.85168" + y2="777.28424" + id="linearGradient5592" + xlink:href="#linearGradient4281" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4281"> + <stop + id="stop4283" + style="stop-color:#aa8800;stop-opacity:1" + offset="0" /> + <stop + id="stop4285" + style="stop-color:#aa8800;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-380.29214" + y1="598.54688" + x2="-390.43326" + y2="612.49097" + id="linearGradient5594" + xlink:href="#linearGradient4291" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-2.535281,0.63382024)" /> + <linearGradient + id="linearGradient4291"> + <stop + id="stop4293" + style="stop-color:#d4aa00;stop-opacity:1" + offset="0" /> + + <stop + id="stop4295" + style="stop-color:#d4aa00;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-471.48389" + y1="251.91522" + x2="-243.80916" + y2="272.53143" + id="linearGradient5596" + xlink:href="#linearGradient4349" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4349"> + <stop + id="stop4351" + style="stop-color:#e3dbdb;stop-opacity:1" + offset="0" /> + <stop + id="stop4353" + style="stop-color:#e3dbdb;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-380.29214" + y1="598.54688" + x2="-390.43326" + y2="612.49097" + id="linearGradient5598" + xlink:href="#linearGradient4291" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(92.220854,-350.8195)" /> + <linearGradient + x1="-556.63782" + y1="530.68231" + x2="-510.02722" + y2="571.01837" + id="linearGradient5600" + xlink:href="#linearGradient4359" + gradientUnits="userSpaceOnUse" /> + + <linearGradient + id="linearGradient4359"> + <stop + id="stop4361" + style="stop-color:#e3dbdb;stop-opacity:1" + offset="0" /> + <stop + id="stop4363" + style="stop-color:#e3dbdb;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-556.63782" + y1="530.68231" + x2="-510.02722" + y2="571.01837" + id="linearGradient5602" + xlink:href="#linearGradient4359" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,1.8352942,250.08365,-267.67422)" /> + <linearGradient + x1="-556.63782" + y1="530.68231" + x2="-510.02722" + y2="571.01837" + id="linearGradient5604" + xlink:href="#linearGradient4359" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,1.8352942,511.81995,-342.96822)" /> + <linearGradient + x1="-556.63782" + y1="530.68231" + x2="-510.02722" + y2="571.01837" + id="linearGradient5606" + xlink:href="#linearGradient4359" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.83133366,263.52901,240.53548)" /> + <linearGradient + x1="-374.67734" + y1="575.50012" + x2="-390.81174" + y2="610.45813" + id="linearGradient5608" + xlink:href="#linearGradient4388" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4388"> + + <stop + id="stop4390" + style="stop-color:#ffffff;stop-opacity:1" + offset="0" /> + <stop + id="stop4392" + style="stop-color:#b3b3b3;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-374.67734" + y1="575.50012" + x2="-390.81174" + y2="610.45813" + id="linearGradient5610" + xlink:href="#linearGradient4388" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(115.63008,-338.82301)" /> + <linearGradient + x1="-374.67734" + y1="575.50012" + x2="-390.81174" + y2="610.45813" + id="linearGradient5612" + xlink:href="#linearGradient4388" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(115.63008,-338.82301)" /> + <linearGradient + x1="-21.549887" + y1="360.23047" + x2="-58.311459" + y2="405.86554" + id="linearGradient5614" + xlink:href="#linearGradient4404" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4404"> + <stop + id="stop4406" + style="stop-color:#deaa87;stop-opacity:1" + offset="0" /> + <stop + id="stop4408" + style="stop-color:#deaa87;stop-opacity:0" + offset="1" /> + + </linearGradient> + <linearGradient + x1="-543.81775" + y1="495.86801" + x2="-193.94899" + y2="656.8584" + id="linearGradient5616" + xlink:href="#linearGradient4414" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4414"> + <stop + id="stop4416" + style="stop-color:#d38d5f;stop-opacity:1" + offset="0" /> + <stop + id="stop4418" + style="stop-color:#d38d5f;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-392.96854" + y1="184.02844" + x2="-235.78113" + y2="454.03589" + id="linearGradient5618" + xlink:href="#linearGradient4426" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4426"> + <stop + id="stop4428" + style="stop-color:#deaa87;stop-opacity:1" + offset="0" /> + + <stop + id="stop4430" + style="stop-color:#deaa87;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-207.57613" + y1="440.09183" + x2="-211.37904" + y2="446.43002" + id="linearGradient5620" + xlink:href="#linearGradient5210" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient5210"> + <stop + id="stop5212" + style="stop-color:#554400;stop-opacity:1" + offset="0" /> + <stop + id="stop5214" + style="stop-color:#554400;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-207.57613" + y1="440.09183" + x2="-211.37904" + y2="446.43002" + id="linearGradient5622" + xlink:href="#linearGradient5210" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(117.25674,69.086406)" /> + <linearGradient + x1="-543.81775" + y1="495.86801" + x2="-193.94899" + y2="656.8584" + id="linearGradient5624" + xlink:href="#linearGradient4414" + gradientUnits="userSpaceOnUse" /> + + <linearGradient + x1="-313.74103" + y1="399.52734" + x2="-247.82372" + y2="713.90216" + id="linearGradient5626" + xlink:href="#linearGradient5450" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient5450"> + <stop + id="stop5452" + style="stop-color:#241c1c;stop-opacity:1" + offset="0" /> + <stop + id="stop5454" + style="stop-color:#241c1c;stop-opacity:0" + offset="1" /> + </linearGradient> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter58545"> + <feMorphology + id="feMorphology58547" + radius="4" + in="SourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur58549" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + id="feComposite58551" /> + + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter29017"> + <feMorphology + id="feMorphology29019" + radius="4" + in="SourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur29021" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + result="fbSourceGraphic" + id="feComposite29023" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix58513" /> + <feMorphology + id="feMorphology58515" + radius="4" + in="fbSourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur58517" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="fbSourceGraphic" + id="feComposite58519" /> + + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter58505"> + <feMorphology + id="feMorphology58507" + radius="4" + in="SourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur58509" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + id="feComposite58511" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter58489"> + <feMorphology + id="feMorphology58491" + radius="4" + in="SourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur58493" + in="result0" + stdDeviation="8" + result="result91" /> + + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + id="feComposite58495" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter58481"> + <feMorphology + id="feMorphology58483" + radius="4" + in="SourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur58485" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + id="feComposite58487" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter29001"> + <feMorphology + id="feMorphology29003" + radius="4" + in="SourceGraphic" + result="result0" /> + + <feGaussianBlur + id="feGaussianBlur29005" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + result="fbSourceGraphic" + id="feComposite29007" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix58473" /> + <feMorphology + id="feMorphology58475" + radius="4" + in="fbSourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur58477" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="fbSourceGraphic" + id="feComposite58479" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter28993"> + <feMorphology + id="feMorphology28995" + radius="4" + in="SourceGraphic" + result="result0" /> + + <feGaussianBlur + id="feGaussianBlur28997" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + result="fbSourceGraphic" + id="feComposite28999" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix58465" /> + <feMorphology + id="feMorphology58467" + radius="4" + in="fbSourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur58469" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="fbSourceGraphic" + id="feComposite58471" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter28969"> + <feMorphology + id="feMorphology28971" + radius="4" + in="SourceGraphic" + result="result0" /> + + <feGaussianBlur + id="feGaussianBlur28973" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + result="fbSourceGraphic" + id="feComposite28975" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix58441" /> + <feMorphology + id="feMorphology58443" + radius="4" + in="fbSourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur58445" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="fbSourceGraphic" + id="feComposite58447" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter28945"> + <feMorphology + id="feMorphology28947" + radius="4" + in="SourceGraphic" + result="result0" /> + + <feGaussianBlur + id="feGaussianBlur28949" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + result="fbSourceGraphic" + id="feComposite28951" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix58417" /> + <feMorphology + id="feMorphology58419" + radius="4" + in="fbSourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur58421" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="fbSourceGraphic" + id="feComposite58423" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter28937"> + <feMorphology + id="feMorphology28939" + radius="4" + in="SourceGraphic" + result="result0" /> + + <feGaussianBlur + id="feGaussianBlur28941" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + result="fbSourceGraphic" + id="feComposite28943" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix58409" /> + <feMorphology + id="feMorphology58411" + radius="4" + in="fbSourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur58413" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="fbSourceGraphic" + id="feComposite58415" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter46457"> + <feMorphology + id="feMorphology46459" + radius="4" + in="SourceGraphic" + result="result0" /> + + <feGaussianBlur + id="feGaussianBlur46461" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + result="fbSourceGraphic" + id="feComposite46463" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix57841" /> + <feMorphology + id="feMorphology57843" + radius="4" + in="fbSourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur57845" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="fbSourceGraphic" + id="feComposite57847" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter46345"> + <feMorphology + id="feMorphology46347" + radius="4" + in="SourceGraphic" + result="result0" /> + + <feGaussianBlur + id="feGaussianBlur46349" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + result="fbSourceGraphic" + id="feComposite46351" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix57729" /> + <feMorphology + id="feMorphology57731" + radius="4" + in="fbSourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur57733" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="fbSourceGraphic" + id="feComposite57735" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter46329"> + <feMorphology + id="feMorphology46331" + radius="4" + in="SourceGraphic" + result="result0" /> + + <feGaussianBlur + id="feGaussianBlur46333" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + result="fbSourceGraphic" + id="feComposite46335" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix57713" /> + <feMorphology + id="feMorphology57715" + radius="4" + in="fbSourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur57717" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="fbSourceGraphic" + id="feComposite57719" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter46185"> + <feMorphology + id="feMorphology46187" + radius="4" + in="SourceGraphic" + result="result0" /> + + <feGaussianBlur + id="feGaussianBlur46189" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + result="fbSourceGraphic" + id="feComposite46191" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix57569" /> + <feMorphology + id="feMorphology57571" + radius="4" + in="fbSourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur57573" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="fbSourceGraphic" + id="feComposite57575" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter45689"> + <feMorphology + id="feMorphology45691" + radius="4" + in="SourceGraphic" + result="result0" /> + + <feGaussianBlur + id="feGaussianBlur45693" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + result="fbSourceGraphic" + id="feComposite45695" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix57073" /> + <feMorphology + id="feMorphology57075" + radius="4" + in="fbSourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur57077" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="fbSourceGraphic" + id="feComposite57079" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter25961"> + <feMorphology + id="feMorphology25963" + radius="4" + in="SourceGraphic" + result="result0" /> + + <feGaussianBlur + id="feGaussianBlur25965" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + id="feComposite25967" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter25849"> + <feMorphology + id="feMorphology25851" + radius="4" + in="SourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur25853" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + id="feComposite25855" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter25817"> + + <feMorphology + id="feMorphology25819" + radius="4" + in="SourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur25821" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + id="feComposite25823" /> + </filter> + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter25793"> + <feMorphology + id="feMorphology25795" + radius="4" + in="SourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur25797" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + id="feComposite25799" /> + </filter> + + <filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter25721"> + <feMorphology + id="feMorphology25723" + radius="4" + in="SourceGraphic" + result="result0" /> + <feGaussianBlur + id="feGaussianBlur25725" + in="result0" + stdDeviation="8" + result="result91" /> + <feComposite + in2="result91" + operator="in" + in="SourceGraphic" + id="feComposite25727" /> + </filter> + <linearGradient + x1="-56.614231" + y1="598.30231" + x2="-15.517232" + y2="660.70007" + id="linearGradient59561" + xlink:href="#linearGradient59555" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient59555"> + <stop + id="stop59557" + style="stop-color:#502d16;stop-opacity:1" + offset="0" /> + <stop + id="stop59559" + style="stop-color:#502d16;stop-opacity:0" + offset="1" /> + + </linearGradient> + <linearGradient + x1="100.90053" + y1="536.12476" + x2="89.21386" + y2="576.13824" + id="linearGradient59571" + xlink:href="#linearGradient59565" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient59565"> + <stop + id="stop59567" + style="stop-color:#2b1100;stop-opacity:1" + offset="0" /> + <stop + id="stop59569" + style="stop-color:#2b1100;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="-267.43448" + y1="591.51343" + x2="-245.16379" + y2="651.9624" + id="linearGradient59581" + xlink:href="#linearGradient59575" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient59575"> + <stop + id="stop59577" + style="stop-color:#2b1100;stop-opacity:1" + offset="0" /> + + <stop + id="stop59579" + style="stop-color:#2b1100;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="439.24951" + y1="529.87463" + x2="445.15491" + y2="536.62366" + id="linearGradient59593" + xlink:href="#linearGradient59587" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0148148,0,0,1.0148148,-572.57187,-194.55476)" /> + <linearGradient + id="linearGradient59587"> + <stop + id="stop59589" + style="stop-color:#806600;stop-opacity:1" + offset="0" /> + <stop + id="stop59591" + style="stop-color:#806600;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="439.24951" + y1="529.87463" + x2="445.15491" + y2="536.62366" + id="linearGradient59595" + xlink:href="#linearGradient59587" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0148148,0,0,1.0148148,-572.57187,-194.55476)" /> + <linearGradient + x1="439.53073" + y1="536.34247" + x2="431.09442" + y2="526.21893" + id="linearGradient59607" + xlink:href="#linearGradient59601" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0148148,0,0,1.0148148,-572.57187,-194.55476)" /> + + <linearGradient + id="linearGradient59601"> + <stop + id="stop59603" + style="stop-color:#d4aa00;stop-opacity:1" + offset="0" /> + <stop + id="stop59605" + style="stop-color:#d4aa00;stop-opacity:0" + offset="1" /> + </linearGradient> + <linearGradient + x1="439.53073" + y1="536.34247" + x2="431.09442" + y2="526.21893" + id="linearGradient59609" + xlink:href="#linearGradient59601" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0148148,0,0,1.0148148,-572.57187,-194.55476)" /> + <linearGradient + x1="168.62079" + y1="365.55066" + x2="170.21155" + y2="367.53909" + id="linearGradient59645" + xlink:href="#linearGradient59639" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient59639"> + <stop + id="stop59641" + style="stop-color:#806600;stop-opacity:1" + offset="0" /> + <stop + id="stop59643" + style="stop-color:#806600;stop-opacity:0" + offset="1" /> + + </linearGradient> + <linearGradient + x1="426.32422" + y1="668.98846" + x2="409.62122" + y2="853.51691" + id="linearGradient59663" + xlink:href="#linearGradient59657" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient59657"> + <stop + id="stop59659" + style="stop-color:#ffffff;stop-opacity:1" + offset="0" /> + <stop + id="stop59661" + style="stop-color:#ffffff;stop-opacity:0" + offset="1" /> + </linearGradient> + <filter + color-interpolation-filters="sRGB" + id="filter62209"> + <feGaussianBlur + stdDeviation="12.178856" + id="feGaussianBlur62211" /> + </filter> + + <linearGradient + x1="100.90053" + y1="536.12476" + x2="89.21386" + y2="576.13824" + id="linearGradient3522" + xlink:href="#linearGradient59565" + gradientUnits="userSpaceOnUse" /> + </defs> + <metadata + id="metadata59953"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(-107.28772,-22.072074)" + id="g3389"> + <g + id="layer1"> + <g + id="g62213"> + <path + d="m 147.89139,397.38879 -29.57828,17.74697 261.76777,159.7227 229.23166,-75.42461 16.26805,-57.67764 L 325.36106,270.2022 z" + transform="matrix(0.95299806,0,0,0.94197307,22.390983,36.077023)" + id="path61407" + style="fill:#4d4d4d;stroke:none;filter:url(#filter62209)" /> + <g + transform="matrix(0.86792019,0,0,0.86792019,109.15404,-281.76566)" + id="g59819"> + <path + d="m -1081.4216,590.67297 274.58639,0 0,307.50479 -274.58639,0 z" + transform="matrix(0.94915439,-0.31481097,0.85895303,0.51205439,566.49774,186.4423)" + id="rect3161" + style="opacity:0.55;fill:#000000;fill-opacity:1;stroke:none" /> + + <path + d="m -913.00513,404.57053 274.58643,0 0,307.50479 -274.58643,0 z" + transform="matrix(0.94915439,-0.31481097,0.85895303,0.51205439,566.49774,186.4423)" + id="rect3165" + style="opacity:0.55;fill:#000000;fill-opacity:1;stroke:none" /> + <path + d="m 801.46552,-1199.5044 308.67688,0 0,270.0236 -308.67688,0 z" + transform="matrix(-0.85863387,-0.51258939,-0.5798344,-0.81473435,566.49774,186.4423)" + id="rect3169" + style="opacity:0.55;fill:#000000;fill-opacity:1;stroke:none" /> + <path + d="m 718.06976,-1123.932 306.95374,0 0,270.02908 -306.95374,0 z" + transform="matrix(-0.85863387,-0.51258939,-0.5798344,-0.81473435,566.49774,186.4423)" + id="rect3171" + style="opacity:0.55;fill:#000000;fill-opacity:1;stroke:none" /> + <path + d="m -268.59728,563.39264 276.1901462,3.8472 0,148.79529 -277.1392562,-3.26284 z" + transform="matrix(0.94442161,-0.32873671,0,1,566.49774,186.4423)" + id="rect3173" + style="fill:#623e30;fill-opacity:1;stroke:none" /> + <path + d="m -518.09448,494.828 263.52902,156.86251 0,147.89894 -263.52902,-156.86251 z" + transform="translate(566.49774,186.4423)" + id="rect3176" + style="fill:#795439;fill-opacity:1;stroke:none" /> + <path + d="m -15.830293,499.02476 63.865477,111.40401 -66.149551,74.78247 -152.262493,-6.80002 z" + transform="matrix(0.86156968,0.50763932,-0.50372027,0.86386682,566.49774,186.4423)" + id="rect3179" + style="fill:#45271d;fill-opacity:1;stroke:none" /> + <path + d="m -107.03944,324.5411 c -6.04696,3.25233 -6.97305,2.08819 -11.50992,5.5874 -2.77153,2.13763 0.30727,12.4024 -2.54439,14.4534 L 34.091879,543.79649 C 41.255331,511.18094 40.74419,458.98692 28.272347,423.32228 5.4570509,358.07937 -72.182156,305.79327 -107.03944,324.5411 z" + transform="translate(566.49774,186.4423)" + id="path3182" + style="fill:#623e30;fill-opacity:1;stroke:none" /> + <path + d="m -356.21652,163.63749 c -6.64711,0.0737 -13.20622,1.15371 -19.59375,3.28125 -3.051,1.01622 -5.98334,2.24404 -8.8125,3.6875 l 155.21875,217.96875 c 7.10693,-31.0894 5.34218,-69.08451 -7.03125,-107.40625 -22.63527,-70.10366 -73.25145,-118.0475 -119.78125,-117.53125 z" + transform="translate(566.49774,186.4423)" + id="path3188" + style="opacity:0.55;fill:#000000;fill-opacity:1;stroke:none" /> + <path + d="m -135.4218,320.16046 292.82773,-14.73107 c -36.35259,-1.05497 -66.500369,9.94771 -76.933719,35.63262 l -307.979671,12.8814 c 31.24955,-46.90488 73.50202,-31.84091 92.08566,-33.78295 z" + transform="matrix(0.83603273,0.54867958,-0.54867958,0.83603273,566.49774,186.4423)" + id="rect3190" + style="fill:#28170b;fill-opacity:1;stroke:none" /> + + <path + d="M -119.84933,328.79375 34.957926,544.12764 6.2744955,566.53657 -148.1071,347.61725 z" + transform="translate(566.49774,186.4423)" + id="rect3193" + style="fill:#784421;fill-opacity:1;stroke:none" /> + <path + d="M -245.17589,401.54228 -29.461387,533.33839 -158.18485,362.23181 -374.7957,221.47212 z" + transform="translate(566.49774,186.4423)" + id="path3196" + style="opacity:0.55;fill:#000000;fill-opacity:1;stroke:none" /> + <path + d="m -17.023707,497.65083 65.058891,112.77793 122.331666,0.34047 93.37466,-114.0507 z" + transform="matrix(0.86156968,0.50763932,-0.50372027,0.86386682,566.49774,186.4423)" + id="path3198" + style="fill:#372017;fill-opacity:1;stroke:none" /> + <path + d="M -260.85418,409.66616 -518.09115,494.81252 -254.5745,652.57917 5.3776063,565.6547 z m -4.46875,13.46875 L -24.216139,562.7172 -251.262,639.14167 -488.52865,499.46877 z" + transform="translate(566.49774,186.4423)" + id="rect3200" + style="fill:#110904;fill-opacity:1;stroke:none" /> + <path + d="m -266.13885,551.8259 99.49565,58.7114 -83.88862,29.50056 -100.76096,-60.87306 z" + transform="translate(566.49774,186.4423)" + id="rect3210" + style="fill:#22140f;fill-opacity:1;stroke:none" /> + <path + d="m -384.78619,170.33868 265.09197,158.29007 -28.68343,22.40893 -265.61704,-162.19241 z" + transform="translate(566.49774,186.4423)" + id="path3981" + style="fill:#593218;fill-opacity:1;stroke:none" /> + <path + d="M -412.66605,189.80378 -254.04842,412.7295 9.6078295,570.57325 -146.9403,349.36005 z m 33.39895,29.87469 222.41979,140.50214 129.337444,176.23966 -216.726054,-132.91355 z" + transform="translate(566.49774,186.4423)" + id="path3985" + style="fill:#110904;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -375.22159,223.32529 147.68012,93.17158 c 0,0 3.1691,23.45135 2.53528,32.32483 -0.63382,8.87349 -0.63382,31.69101 -3.1691,36.76158 -2.53528,5.07056 -14.57787,18.38078 -14.57787,18.38078 z" + transform="translate(566.49774,186.4423)" + id="path3990" + style="fill:#45271d;fill-opacity:1;stroke:none" /> + <path + d="m -225.64001,318.39833 70.98787,43.7336 125.496408,172.39911 -212.963608,-129.93316 12.04259,-14.57786 c 0,0 6.3382,-19.01461 5.07056,-24.08517 -1.26764,-5.07056 1.90146,-24.71899 0.63382,-31.05719 -1.26764,-6.33821 -1.26764,-16.47933 -1.26764,-16.47933 z" + transform="translate(566.49774,186.4423)" + id="path3992" + style="fill:#372017;fill-opacity:1;stroke:none" /> + + <path + d="m -518.09448,494.828 263.52902,156.86251 0,147.89894 -263.52902,-156.86251 z" + transform="translate(566.49774,186.4423)" + id="path4286" + style="fill:url(#linearGradient5544);fill-opacity:1;stroke:none" /> + <path + d="m -268.59728,563.39264 276.1901462,3.8472 0,148.79529 -277.1392562,-3.26284 z" + transform="matrix(0.94442161,-0.32873671,0,1,566.49774,186.4423)" + id="path4296" + style="fill:url(#linearGradient5546);fill-opacity:1;stroke:none" /> + <path + d="m -15.830293,499.02476 63.865477,111.40401 -66.149551,74.78247 -152.262493,-6.80002 z" + transform="matrix(0.86156968,0.50763932,-0.50372027,0.86386682,566.49774,186.4423)" + id="path4306" + style="fill:url(#linearGradient5548);fill-opacity:1;stroke:none" /> + <path + d="m -17.023707,497.65083 65.058891,112.77793 122.331666,0.34047 93.37466,-114.0507 z" + transform="matrix(0.86156968,0.50763932,-0.50372027,0.86386682,566.49774,186.4423)" + id="path4316" + style="fill:url(#linearGradient5550);fill-opacity:1;stroke:none" /> + <path + d="m -96.189364,320.5 c -5.827676,0.0738 -11.578186,1.15371 -17.178276,3.28125 -2.67488,1.01622 -5.24572,2.24404 -7.72611,3.6875 L 34.638377,541.63458 c 6.2308,-31.0894 2.782149,-73.52125 -8.065912,-111.84299 C 6.7276267,359.68793 -55.395666,319.98375 -96.189364,320.5 z" + transform="translate(566.49774,186.4423)" + id="path4326" + style="fill:url(#linearGradient5552);fill-opacity:1;stroke:none" /> + <path + d="m -135.4218,320.16046 292.82773,-14.73107 c -36.35259,-1.05497 -66.500369,9.94771 -76.933719,35.63262 l -307.979671,12.8814 c 31.24955,-46.90488 73.50202,-31.84091 92.08566,-33.78295 z" + transform="matrix(0.83603273,0.54867958,-0.54867958,0.83603273,566.49774,186.4423)" + id="path4344" + style="fill:url(#linearGradient5554);fill-opacity:1;stroke:none" /> + <path + d="m -95.737511,320.5 c -5.933409,0.0738 -11.788249,1.15371 -17.489949,3.28125 -2.72341,1.01622 -5.3409,2.24404 -7.86629,3.6875 L 33.938315,542.90222 c 6.343848,-31.0894 7.937687,-61.47867 -3.107196,-99.80041 C 10.626225,372.99815 -54.203671,319.98375 -95.737511,320.5 z" + transform="translate(566.49774,186.4423)" + id="path4354" + style="fill:url(#linearGradient5556);fill-opacity:1;stroke:none" /> + <path + d="M -412.66605,189.80378 -254.04842,412.7295 9.6078295,570.57325 -146.9403,349.36005 z m 33.39895,29.87469 222.41979,140.50214 129.337444,176.23966 -216.726054,-132.91355 z" + transform="translate(566.49774,186.4423)" + id="path4366" + style="fill:#774421;fill-opacity:1;stroke:none" /> + <path + d="m -375.22159,223.32529 147.68012,93.17158 c 0,0 3.1691,23.45135 2.53528,32.32483 -0.63382,8.87349 -0.63382,31.69101 -3.1691,36.76158 -2.53528,5.07056 -14.57787,18.38078 -14.57787,18.38078 z" + transform="translate(566.49774,186.4423)" + id="path4368" + style="fill:#301b0f;fill-opacity:1;stroke:none" /> + + <path + d="m -225.64001,318.39833 70.98787,43.7336 125.496408,172.39911 -212.963608,-129.93316 12.04259,-14.57786 c 0,0 6.3382,-19.01461 5.07056,-24.08517 -1.26764,-5.07056 1.90146,-24.71899 0.63382,-31.05719 -1.26764,-6.33821 -1.26764,-16.47933 -1.26764,-16.47933 z" + transform="translate(566.49774,186.4423)" + id="path4370" + style="fill:url(#linearGradient5558);fill-opacity:1;stroke:none" /> + <path + d="M -260.85418,409.66616 -518.09115,494.81252 -254.5745,652.57917 5.3776063,565.6547 z m -4.46875,13.46875 L -24.216139,562.7172 -251.262,639.14167 -488.52865,499.46877 z" + transform="translate(566.49774,186.4423)" + id="path4380" + style="fill:#110904;fill-opacity:1;stroke:none" /> + <path + d="M -260.85418,409.66616 -518.09115,494.81252 -254.5745,652.57917 5.3776063,565.6547 z m -4.46875,13.46875 L -24.216139,562.7172 -251.262,639.14167 -488.52865,499.46877 z" + transform="translate(566.49774,186.4423)" + id="path4382" + style="fill:url(#linearGradient5560);fill-opacity:1;stroke:none" /> + <path + d="m -269.37361,644.49885 15.21169,8.87348 20.28225,-6.97202 -1.90146,148.63085 -17.74697,6.3382 -16.79624,-10.14112 z" + transform="translate(566.49774,186.4423)" + id="path4392" + style="fill:#aa8800;stroke:none" /> + <path + d="m -269.37361,644.18193 14.57787,9.1904 20.91607,-6.97202 -1.90146,148.63085 -18.06388,6.3382 -16.47933,-10.45803 z" + transform="translate(566.49774,186.4423)" + id="path4394" + style="fill:url(#linearGradient5562);fill-opacity:1;stroke:#786721;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -254.47883,653.37232 0.63382,-0.3169 19.96534,-6.65511 -1.90146,148.63085 -18.06388,6.3382 -0.63382,-0.63382 z" + transform="translate(566.49774,186.4423)" + id="path4404" + style="fill:url(#linearGradient5564);fill-opacity:1;stroke:none" /> + <path + d="m -518.7784,495.37731 15.84551,8.87348 0.55459,0.47537 -1.82223,146.88784 0.63382,0.31691 -16.16242,-9.82421 z" + transform="translate(566.49774,186.4423)" + id="path3181" + style="fill:#aa8800;stroke:none" /> + <path + d="m -518.7784,495.06039 15.21169,9.1904 0.95073,1.26764 -1.34687,146.01634 -5.38747,-3.24833 -10.37881,-6.49665 z" + transform="translate(566.49774,186.4423)" + id="path3183" + style="fill:url(#linearGradient5566);fill-opacity:1;stroke:#786721;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -503.2498,504.25078 0.71305,0.71306 0.0792,0.15845 -1.743,146.49171 0.55459,0.15845 0.39614,-0.15845 z" + transform="translate(566.49774,186.4423)" + id="path3185" + style="fill:url(#linearGradient5568);fill-opacity:1;stroke:none" /> + + <path + d="m -8.2361977,571.0666 15.84551,-5.54275 0.55459,-0.0292 -1.82223,148.5457 0.63382,-0.25974 -16.16242,4.88034 z" + transform="translate(566.49774,186.4423)" + id="path3191" + style="fill:#aa8800;stroke:none" /> + <path + d="m -8.2361977,570.74968 15.21169,-4.64918 0.95073,0.40267 -1.34687,147.24172 -5.38747,1.65318 -10.37881,2.94598 z" + transform="translate(566.49774,186.4423)" + id="path3193" + style="fill:url(#linearGradient5570);fill-opacity:1;stroke:#786721;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m 7.2924023,565.81217 0.71305,0.0643 0.0792,0.0864 -1.743,148.07749 0.55459,-0.34612 0.39614,-0.51886 z" + transform="translate(566.49774,186.4423)" + id="path3195" + style="fill:url(#linearGradient5572);fill-opacity:1;stroke:none" /> + <path + d="m -498.3307,509.14335 224.98566,136.24629 0,139.73524 -224.98566,-136.24629 z" + transform="translate(566.49774,186.4423)" + id="path3219" + style="fill:url(#linearGradient5574);fill-opacity:1;stroke:none" /> + <path + d="m -403.22692,566.98836 55.95449,31.55721 -2.53528,37.61422 -54.05303,-33.45867 z" + transform="translate(566.49774,186.4423)" + id="path3223" + style="fill:#554400;fill-opacity:1;stroke:none" /> + <path + d="M -120.28999,331.75472 32.090737,541.5023 6.9927363,563.81475 -142.69892,350.48174 z" + transform="translate(566.49774,186.4423)" + id="path3251" + style="fill:url(#linearGradient5576);fill-opacity:1;stroke:none" /> + <path + d="m -498.3307,626.56614 224.98566,20.61621 0,137.94253 -224.98566,-136.24629 z" + transform="translate(566.49774,186.4423)" + id="path3263" + style="fill:url(#linearGradient5578);fill-opacity:1;stroke:none" /> + <path + d="m -499.22706,509.14335 225.88202,269.80351 0,6.17802 -224.98566,-136.24629 z" + transform="translate(566.49774,186.4423)" + id="path3273" + style="fill:url(#linearGradient5580);fill-opacity:1;stroke:none" /> + <path + d="M -231.21627,647.18235 -11.608744,575.47378 -117.37889,681.14745 -233.45716,791.84756 z" + transform="translate(566.49774,186.4423)" + id="path4239" + style="fill:url(#linearGradient5582);fill-opacity:1;stroke:none" /> + + <path + d="m -231.21626,648.52689 217.814801,67.67497 -220.055691,75.6457 -0.44818,10e-6 z" + transform="translate(566.49774,186.4423)" + id="path4243" + style="fill:url(#linearGradient5584);fill-opacity:1;stroke:none" /> + <path + d="M -119.84933,328.79375 34.957926,544.12764 6.2744955,566.53657 -148.1071,347.61725 z" + transform="translate(566.49774,186.4423)" + id="path4247" + style="fill:url(#linearGradient5586);fill-opacity:1;stroke:none" /> + <path + d="m -384.78619,170.33868 265.09197,158.29007 -28.68343,22.40893 -265.61704,-162.19241 z" + transform="translate(566.49774,186.4423)" + id="path4259" + style="fill:url(#linearGradient5588);fill-opacity:1;stroke:none" /> + <path + d="M -415.20134,187.26851 -256.58371,410.19423 7.072549,568.03798 -149.47559,346.82478 z M -381.80239,217.1432 -159.3826,357.64534 -30.045147,533.885 -246.77121,400.97145 z" + transform="translate(566.49774,186.4423)" + id="path4269" + style="fill:url(#linearGradient5590);fill-opacity:1;stroke:none" /> + <path + d="m -254.47883,653.37232 0.63382,-0.3169 19.96534,-6.65511 -1.90146,148.63085 -18.06388,6.3382 -0.63382,-0.63382 z" + transform="translate(566.49774,186.4423)" + id="path4279" + style="fill:url(#linearGradient5592);fill-opacity:1;stroke:none" /> + <path + d="m -405.7622,567.62218 55.95449,31.55721 -2.53528,37.61422 -54.05303,-33.45867 z" + transform="translate(566.49774,186.4423)" + id="path4289" + style="fill:url(#linearGradient5594);fill-opacity:1;stroke:none" /> + <path + d="m -312.56613,175.74076 c 213.565122,124.60735 143.67657,111.32782 193.35062,155.05387 l -25.99435,17.03079 -268.66714,-158.8634 c 26.78718,-17.63816 51.77405,-38.90028 101.31087,-13.22126 z" + transform="translate(566.49774,186.4423)" + id="path4345" + style="fill:url(#linearGradient5596);fill-opacity:1;stroke:none" /> + <path + d="m -289.45618,227.26071 54.36994,33.45867 -21.23298,22.40254 -53.41921,-32.19103 z" + transform="translate(566.49774,186.4423)" + id="path4303" + style="fill:url(#linearGradient5598);fill-opacity:1;stroke:none" /> + <path + d="m -518.9908,497.51708 17.03079,10.75628 -0.89636,65.43407 -13.44535,-38.54336 z" + transform="translate(566.49774,186.4423)" + id="rect4357" + style="fill:url(#linearGradient5600);fill-opacity:1;stroke:none" /> + + <path + d="m -268.90715,645.41601 14.34172,10.77737 -0.89636,137.12155 -12.54899,-30.40233 z" + transform="translate(566.49774,186.4423)" + id="path4369" + style="fill:url(#linearGradient5602);fill-opacity:1;stroke:none" /> + <path + d="m -7.170854,570.12201 c 6.48446413,5.84545 17.47345,-4.07493 15.2380772,32.28994 L 6.274506,718.02093 -5.3781312,679.55138 z" + transform="translate(566.49774,186.4423)" + id="path4373" + style="fill:url(#linearGradient5604);fill-opacity:1;stroke:none" /> + <path + d="m -255.46179,654.13818 20.61622,-6.90838 0,29.30842 c -7.44935,3.51594 -17.1918,27.89021 -19.71985,33.48931 z" + transform="translate(566.49774,186.4423)" + id="path4377" + style="fill:url(#linearGradient5606);fill-opacity:1;stroke:none" /> + <path + d="m -405.77285,566.71664 -0.40625,22.625 c 3.31508,3.07614 7.71734,6.0296 13.5625,8.5625 13.66427,5.92118 29.85949,6.29072 42.5,5.21875 l 0.3125,-4.84375 -55.96875,-31.5625 z" + transform="translate(566.49774,186.4423)" + id="path4381" + style="fill:url(#linearGradient5608);fill-opacity:1;stroke:none" /> + <path + d="m -289.24641,228.34181 c -7.71187,7.50238 -6.69597,15.27013 -1.30261,22.17682 3.31508,3.07614 7.71734,7.59823 13.5625,10.13113 13.66427,5.92118 19.1032,11.44477 31.74371,10.3728 l 8.8279,-9.9978 z" + transform="translate(566.49774,186.4423)" + id="path4396" + style="fill:url(#linearGradient5610);fill-opacity:1;stroke:none" /> + <path + d="m -289.24641,228.34181 c -7.71187,7.50238 -6.69597,15.27013 -1.30261,22.17682 3.31508,3.07614 7.71734,7.59823 13.5625,10.13113 13.66427,5.92118 19.1032,11.44477 31.74371,10.3728 l 8.8279,-9.9978 z" + transform="translate(566.49774,186.4423)" + id="path4400" + style="fill:url(#linearGradient5612);fill-opacity:1;stroke:none" /> + <path + d="m -95.737511,320.5 c -5.933409,0.0738 -11.788249,1.15371 -17.489949,3.28125 -2.72341,1.01622 -5.3409,2.24404 -7.86629,3.6875 L 33.938315,542.90222 c 6.343848,-31.0894 7.937687,-61.47867 -3.107196,-99.80041 C 10.626225,372.99815 -54.203671,319.98375 -95.737511,320.5 z" + transform="translate(566.49774,186.4423)" + id="path4402" + style="fill:url(#linearGradient5614);fill-opacity:1;stroke:none" /> + <path + d="M -260.85418,409.66616 -518.09115,494.81252 -254.5745,652.57917 5.3776063,565.6547 z m -4.46875,13.46875 L -24.216139,562.7172 -251.262,639.14167 -488.52865,499.46877 z" + transform="translate(566.49774,186.4423)" + id="path4412" + style="fill:url(#linearGradient5616);fill-opacity:1;stroke:none" /> + <path + d="M -415.20134,187.26851 -256.58371,410.19423 7.072549,568.03798 -149.47559,346.82478 z M -381.80239,217.1432 -159.3826,357.64534 -30.045147,533.885 -246.77121,400.97145 z" + transform="translate(566.49774,186.4423)" + id="path4424" + style="fill:url(#linearGradient5618);fill-opacity:1;stroke:none" /> + + <path + d="m -227.22456,432.8029 4.43675,-1.58455 -1.26764,-5.38747 -0.95074,-4.43675 46.26888,27.57118 0.95073,8.87349 -9.5073,4.11983 -44.36742,-26.62045 -0.63382,-0.95073 z" + transform="translate(566.49774,186.4423)" + id="path5206" + style="fill:#d4aa00;stroke:#aa8800;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -227.22456,432.8029 4.43675,-1.58455 -1.26764,-5.38747 -0.95074,-4.43675 46.26888,27.57118 0.95073,8.87349 -9.5073,4.11983 -44.36742,-26.62045 -0.63382,-0.95073 z" + transform="translate(566.49774,186.4423)" + id="path5208" + style="fill:url(#linearGradient5620);fill-opacity:1;stroke:#aa8800;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -220.25253,436.60583 c 0,0.17503 -0.56754,0.31692 -1.26764,0.31692 -0.7001,0 -1.26764,-0.14189 -1.26764,-0.31692 0,-0.17502 0.56754,-0.31691 1.26764,-0.31691 0.7001,0 1.26764,0.14189 1.26764,0.31691 z" + transform="translate(566.49774,186.4423)" + id="path5220" + style="fill:#554400;fill-opacity:1;stroke:#aa8800;stroke-width:4.0999999;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" /> + <path + d="m -220.25253,436.60583 c 0,0.17503 -0.56754,0.31692 -1.26764,0.31692 -0.7001,0 -1.26764,-0.14189 -1.26764,-0.31692 0,-0.17502 0.56754,-0.31691 1.26764,-0.31691 0.7001,0 1.26764,0.14189 1.26764,0.31691 z" + transform="translate(599.45639,205.45691)" + id="path5222" + style="fill:#554400;fill-opacity:1;stroke:#aa8800;stroke-width:4.0999999;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" /> + <path + d="m -220.25253,436.60583 c 0,0.17503 -0.56754,0.31692 -1.26764,0.31692 -0.7001,0 -1.26764,-0.14189 -1.26764,-0.31692 0,-0.17502 0.56754,-0.31691 1.26764,-0.31691 0.7001,0 1.26764,0.14189 1.26764,0.31691 z" + transform="matrix(-0.47804546,-0.43985698,0.35830367,-1.7013094,93.96387,1266.8281)" + id="path5224" + style="fill:#554400;fill-opacity:1;stroke:#aa8800;stroke-width:4.0999999;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" /> + <path + d="m -220.25253,436.60583 c 0,0.17503 -0.56754,0.31692 -1.26764,0.31692 -0.7001,0 -1.26764,-0.14189 -1.26764,-0.31692 0,-0.17502 0.56754,-0.31691 1.26764,-0.31691 0.7001,0 1.26764,0.14189 1.26764,0.31691 z" + transform="translate(581.0756,194.52351)" + id="path5226" + style="fill:#554400;fill-opacity:1;stroke:#aa8800;stroke-width:4.0999999;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" /> + <path + d="m -220.25253,436.60583 c 0,0.17503 -0.56754,0.31692 -1.26764,0.31692 -0.7001,0 -1.26764,-0.14189 -1.26764,-0.31692 0,-0.17502 0.56754,-0.31691 1.26764,-0.31691 0.7001,0 1.26764,0.14189 1.26764,0.31691 z" + transform="matrix(-0.47804546,-0.43985698,0.35830367,-1.7013094,108.85865,1275.2262)" + id="path5230" + style="fill:#554400;fill-opacity:1;stroke:#aa8800;stroke-width:4.0999999;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" /> + <path + d="m -109.96782,501.88931 4.43675,-1.58455 -1.26764,-5.38747 -0.95074,-4.43675 46.268884,27.57118 0.95073,8.87349 -9.507301,4.11983 -44.367423,-26.62045 -0.63382,-0.95073 z" + transform="translate(566.49774,186.4423)" + id="path5232" + style="fill:#d4aa00;stroke:#aa8800;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -109.96782,501.88931 4.43675,-1.58455 -1.26764,-5.38747 -0.95074,-4.43675 46.268884,27.57118 0.95073,8.87349 -9.507301,4.11983 -44.367423,-26.62045 -0.63382,-0.95073 z" + transform="translate(566.49774,186.4423)" + id="path5234" + style="fill:url(#linearGradient5622);fill-opacity:1;stroke:#aa8800;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + + <path + d="m -220.25253,436.60583 c 0,0.17503 -0.56754,0.31692 -1.26764,0.31692 -0.7001,0 -1.26764,-0.14189 -1.26764,-0.31692 0,-0.17502 0.56754,-0.31691 1.26764,-0.31691 0.7001,0 1.26764,0.14189 1.26764,0.31691 z" + transform="translate(683.75448,255.52871)" + id="path5236" + style="fill:#554400;fill-opacity:1;stroke:#aa8800;stroke-width:4.0999999;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" /> + <path + d="m -220.25253,436.60583 c 0,0.17503 -0.56754,0.31692 -1.26764,0.31692 -0.7001,0 -1.26764,-0.14189 -1.26764,-0.31692 0,-0.17502 0.56754,-0.31691 1.26764,-0.31691 0.7001,0 1.26764,0.14189 1.26764,0.31691 z" + transform="translate(716.71313,274.54331)" + id="path5238" + style="fill:#554400;fill-opacity:1;stroke:#aa8800;stroke-width:4.0999999;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" /> + <path + d="m -220.25253,436.60583 c 0,0.17503 -0.56754,0.31692 -1.26764,0.31692 -0.7001,0 -1.26764,-0.14189 -1.26764,-0.31692 0,-0.17502 0.56754,-0.31691 1.26764,-0.31691 0.7001,0 1.26764,0.14189 1.26764,0.31691 z" + transform="matrix(-0.47804546,-0.43985698,0.35830367,-1.7013094,211.22061,1335.9145)" + id="path5240" + style="fill:#554400;fill-opacity:1;stroke:#aa8800;stroke-width:4.0999999;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" /> + <path + d="m -220.25253,436.60583 c 0,0.17503 -0.56754,0.31692 -1.26764,0.31692 -0.7001,0 -1.26764,-0.14189 -1.26764,-0.31692 0,-0.17502 0.56754,-0.31691 1.26764,-0.31691 0.7001,0 1.26764,0.14189 1.26764,0.31691 z" + transform="translate(698.33235,263.60991)" + id="path5242" + style="fill:#554400;fill-opacity:1;stroke:#aa8800;stroke-width:4.0999999;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" /> + <path + d="m -220.25253,436.60583 c 0,0.17503 -0.56754,0.31692 -1.26764,0.31692 -0.7001,0 -1.26764,-0.14189 -1.26764,-0.31692 0,-0.17502 0.56754,-0.31691 1.26764,-0.31691 0.7001,0 1.26764,0.14189 1.26764,0.31691 z" + transform="matrix(-0.47804546,-0.43985698,0.35830367,-1.7013094,226.11539,1344.3126)" + id="path5244" + style="fill:#554400;fill-opacity:1;stroke:#aa8800;stroke-width:4.0999999;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" /> + <path + d="M -260.85418,409.66616 -518.09115,494.81252 -254.5745,652.57917 5.3776063,565.6547 z m -4.46875,13.46875 L -24.216139,562.7172 -251.262,639.14167 -488.52865,499.46877 z" + transform="translate(566.49774,186.4423)" + id="path4422" + style="fill:url(#linearGradient5624);fill-opacity:1;stroke:none" /> + <path + d="M -260.85418,409.66616 -518.09115,494.81252 -254.5745,652.57917 5.3776063,565.6547 z m -4.46875,13.46875 L -24.216139,562.7172 -251.262,639.14167 -488.52865,499.46877 z" + transform="translate(566.49774,186.4423)" + id="path5446" + style="fill:url(#linearGradient5626);fill-opacity:1;stroke:none" /> + <path + d="m -381.01575,567.48158 26.14627,15.10644 -3.94133,1.47878 -26.77569,-15.32065 z" + transform="translate(566.49774,186.4423)" + id="path3538" + style="fill:#000000;fill-opacity:1;stroke:none" /> + <path + d="m -299.91097,261.03789 28.96459,17.99741 -5.9054,6.74904 -28.9646,-18.84105 z" + transform="translate(566.49774,186.4423)" + id="path3544" + style="fill:#e3dbdb;stroke:#808080;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + + <path + d="m -271.22759,279.31651 -0.84363,4.21815 -5.06177,5.34298 -28.68339,-18.84104 -0.56242,-2.24968 28.9646,18.27863 z" + transform="translate(566.49774,186.4423)" + id="path3546" + style="fill:#916f6f;stroke:#999999;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -250.20568,616.15321 c 5.08762,7.63142 2.5875,4.83717 6.74904,8.9987 0.74989,0.7499 1.58718,1.42156 2.24967,2.24968 0.60262,0.75328 2.05515,3.61978 3.37452,4.49936 0.69759,0.46506 1.65684,0.53199 2.24968,1.12484 0.26512,0.26512 -0.26513,0.85971 0,1.12483 0.26512,0.26513 0.85971,0.26513 1.12483,0 0.26513,-0.26512 0.26513,-0.85971 0,-1.12483 -0.26512,-0.26513 -0.85971,0.26512 -1.12483,0 -0.26513,-0.26513 0,-0.7499 0,-1.12484 l -21.37194,4.49935" + transform="translate(566.49774,186.4423)" + id="path9067" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter58545)" /> + <path + d="m -255.82326,616.68318 17.99742,7.87387 c 1.49978,2.24968 2.99957,4.49936 4.49935,6.74903" + transform="translate(566.49774,186.4423)" + id="path9075" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter29017)" /> + <path + d="m -244.03145,636.54657 -1.12484,-19.12226" + transform="translate(566.49774,186.4423)" + id="path9077" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter58505)" /> + <path + d="m -240.73918,617.7457 -4.49935,17.99742 c -5.24547,0 -3.00146,0 -6.74903,0" + transform="translate(566.49774,186.4423)" + id="path9081" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter58489)" /> + <path + d="M -239.33868,637.21188 -251.7119,615.83995" + transform="translate(566.49774,186.4423)" + id="path9083" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter58481)" /> + <path + d="m -247.53449,620.38832 3.37452,12.37322" + transform="translate(566.49774,186.4423)" + id="path9085" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter29001)" /> + <path + d="m -249.65471,617.69658 c 1.2299,2.82234 1.12484,5.05341 1.12484,7.87387 0,0.37494 -0.16768,0.78947 0,1.12484 0.23714,0.47427 0.8877,0.65056 1.12484,1.12483 0.33536,0.67073 -0.33536,1.57896 0,2.24968 2.34065,4.68131 -0.0776,-1.20249 2.24968,1.12484 0.26512,0.26513 0,0.74989 0,1.12484 0.74989,0.37495 1.49978,0.74989 2.24968,1.12484" + transform="translate(566.49774,186.4423)" + id="path9087" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter28993)" /> + <path + d="m -241.92129,631.83656 c 4.24464,-5.4827 -2.57914,-4.36289 -3.37452,-6.74903 -0.23714,-0.71141 0,-1.49978 0,-2.24968 -0.37495,-0.74989 -0.74989,-1.49978 -1.12484,-2.24967" + transform="translate(566.49774,186.4423)" + id="path9093" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter28969)" /> + + <path + d="m -247.76023,630.25833 2.24967,-6.74903" + transform="translate(566.49774,186.4423)" + id="path9099" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter28945)" /> + <path + d="m -249.7987,616.40629 8.99871,17.99742" + transform="translate(566.49774,186.4423)" + id="path9101" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter28937)" /> + <path + d="m -121.3739,542.93523 17.99742,7.87387 c 1.49978,2.24968 2.99957,4.49936 4.499345,6.74903" + transform="translate(566.49774,186.4423)" + id="path9721" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter46457)" /> + <path + d="m -113.95137,541.6099 c 5.08762,7.63142 2.5875,4.83717 6.74904,8.9987 0.74989,0.7499 1.58718,1.42156 2.24967,2.24968 0.60262,0.75328 2.05515,3.61978 3.37452,4.49936 0.69759,0.46506 1.656841,0.53199 2.249681,1.12484 0.26512,0.26512 -0.26513,0.85971 0,1.12483 0.26512,0.26513 0.85971,0.26513 1.12483,0 0.26513,-0.26512 0.26513,-0.85971 0,-1.12483 -0.26512,-0.26513 -0.85971,0.26512 -1.12483,0 -0.26513,-0.26513 0,-0.7499 0,-1.12484 l -21.371941,4.49935" + transform="translate(566.49774,186.4423)" + id="path9749" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter46345)" /> + <path + d="m -118.84902,544.56057 17.99742,7.87387 c 1.499779,2.24968 2.999569,4.49936 4.499349,6.74903" + transform="translate(566.49774,186.4423)" + id="path9753" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter46329)" /> + <path + d="m -118.80867,545.00466 17.99742,7.87387 c 1.499779,2.24968 2.999569,4.49936 4.499349,6.74903" + transform="translate(566.49774,186.4423)" + id="path9789" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter46185)" /> + <path + d="m -69.871888,564.29781 -26.99612,-1.12484" + transform="translate(566.49774,186.4423)" + id="path9913" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter45689)" /> + <path + d="m -152.65239,578.76027 c 5.08762,7.63142 2.5875,4.83717 6.74904,8.9987 0.74989,0.7499 1.58718,1.42156 2.24967,2.24968 0.60262,0.75328 2.05515,3.61978 3.37452,4.49936 0.69759,0.46506 1.65684,0.53199 2.24968,1.12484 0.26512,0.26512 -0.26513,0.85971 0,1.12483 0.26512,0.26513 0.85971,0.26513 1.12483,0 0.26513,-0.26512 0.26513,-0.85971 0,-1.12483 -0.26512,-0.26513 -0.85971,0.26512 -1.12483,0 -0.26513,-0.26513 0,-0.7499 0,-1.12484 l -21.37194,4.49935" + transform="translate(566.49774,186.4423)" + id="path10207" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter25961)" /> + <path + d="m -154.02665,578.6742 c 5.08762,7.63142 2.5875,4.83717 6.74904,8.9987 0.74989,0.7499 1.58718,1.42156 2.24967,2.24968 0.60262,0.75328 2.05515,3.61978 3.37452,4.49936 0.69759,0.46506 1.65684,0.53199 2.24968,1.12484 0.26512,0.26512 -0.26513,0.85971 0,1.12483 0.26512,0.26513 0.85971,0.26513 1.12483,0 0.26513,-0.26512 0.26513,-0.85971 0,-1.12483 -0.26512,-0.26513 -0.85971,0.26512 -1.12483,0 -0.26513,-0.26513 0,-0.7499 0,-1.12484 l -21.37194,4.49935" + transform="translate(566.49774,186.4423)" + id="path10235" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter25849)" /> + + <path + d="m -150.74662,598.93107 -1.12484,-19.12226" + transform="translate(566.49774,186.4423)" + id="path10243" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter25817)" /> + <path + d="m -143.8974,600.268 -12.37322,-21.37193" + transform="translate(566.49774,186.4423)" + id="path10249" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter25793)" /> + <path + d="m -155.3627,578.43575 c 5.08762,7.63142 2.5875,4.83717 6.74904,8.9987 0.74989,0.7499 1.58718,1.42156 2.24967,2.24968 0.60262,0.75328 2.05515,3.61978 3.37452,4.49936 0.69759,0.46506 1.65684,0.53199 2.24968,1.12484 0.26512,0.26512 -0.26513,0.85971 0,1.12483 0.26512,0.26513 0.85971,0.26513 1.12483,0 0.26513,-0.26512 0.26513,-0.85971 0,-1.12483 -0.26512,-0.26513 -0.85971,0.26512 -1.12483,0 -0.26513,-0.26513 0,-0.7499 0,-1.12484 l -21.37194,4.49935" + transform="translate(566.49774,186.4423)" + id="path10267" + style="fill:none;stroke:#554400;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter25721)" /> + <path + d="m -15.830293,499.02476 63.865477,111.40401 -66.149551,74.78247 -152.262493,-6.80002 z" + transform="matrix(0.86156968,0.50763932,-0.50372027,0.86386682,566.49774,186.4423)" + id="path59553" + style="fill:url(#linearGradient59561);fill-opacity:1;stroke:none" /> + <path + d="m -17.023707,497.65083 65.058891,112.77793 122.331666,0.34047 93.37466,-114.0507 z" + transform="matrix(0.86156968,0.50763932,-0.50372027,0.86386682,566.49774,186.4423)" + id="path59563" + style="fill:url(#linearGradient3522);fill-opacity:1;stroke:none" /> + <path + d="m -266.13885,551.8259 99.49565,58.7114 -83.88862,29.50056 -100.76096,-60.87306 z" + transform="translate(566.49774,186.4423)" + id="path59573" + style="fill:url(#linearGradient59581);fill-opacity:1;stroke:none" /> + <g + transform="translate(566.49774,186.4423)" + id="g59611"> + <path + d="m -125.71574,325.75461 -24.81294,20.28561 5.16429,3.12253 0.85612,1.71225 3.03414,5.20297 23.27189,-23.16885 0.10871,-0.13424 -2.44318,-4.15913 z" + id="path59583" + style="fill:url(#linearGradient59593);fill-opacity:1;stroke:none" /> + <path + d="m -125.81516,325.30721 -20.33893,22.52262 0.7897,1.43234 0.85612,1.61283 3.13356,5.05384 23.27189,-22.37348 -1.08436,-0.33313 -1.34953,-4.60653 z" + id="path59585" + style="fill:url(#linearGradient59595);fill-opacity:1;stroke:none" /> + + <path + d="m -126.014,325.2575 -24.51468,20.58387 5.16429,3.32138 0.85612,1.71225 3.13356,5.15326 23.17247,-22.37348 -0.68667,-1.72504 -1.6478,-3.31404 z" + id="path59597" + style="fill:url(#linearGradient59607);fill-opacity:1;stroke:none" /> + <path + d="m -124.47296,325.00894 -26.25457,20.83243 5.36314,3.32138 0.85612,1.71225 2.98443,5.10355 23.3216,-22.67175 -0.0404,-0.48226 -2.29405,-4.20884 z" + id="path59599" + style="fill:url(#linearGradient59609);fill-opacity:1;stroke:none" /> + </g> + <path + d="m 186.91455,360.38067 -25.84989,18.29376 -9.14688,-4.37459 29.4291,-17.89608 z" + id="path59635" + style="fill:#b49000;fill-opacity:1;stroke:none" /> + <path + d="m 186.91455,360.38067 -25.84989,18.29376 -9.14688,-4.37459 29.4291,-17.89608 z" + id="path59637" + style="fill:url(#linearGradient59645);fill-opacity:1;stroke:none" /> + <path + d="M 64.425865,693.64533 63.630484,832.83701" + id="path59647" + style="fill:none;stroke:#d4aa00;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -255.50375,655.14391 -0.79538,139.19168" + transform="translate(566.49774,186.4423)" + id="path59649" + style="fill:none;stroke:#d4aa00;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -7.3448618,576.40119 -0.79538,139.19168" + transform="translate(566.49774,186.4423)" + id="path59651" + style="fill:none;stroke:#d4aa00;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m 257.70346,435.94187 52.49515,34.20138" + id="path59653" + style="fill:none;stroke:#aa8800;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + + <path + d="m 557.56212,868.62916 c 0,0 -63.63049,-17.49838 -97.03649,-14.31686 -33.40601,3.18152 -128.85173,72.37968 -128.85173,72.37968 l 3.18152,-92.26421 222.7067,-73.97043 z" + id="path59655" + style="fill:url(#linearGradient59663);fill-opacity:1;stroke:none" /> + <path + d="m 314.57321,826.07627 -1.98846,12.32841" + id="path59665" + style="fill:none;stroke:#28170b;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -487.95386,498.25498 -28.23603,-3.57921" + transform="translate(566.49774,186.4423)" + id="path59665-9" + style="fill:none;stroke:#28170b;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -264.45178,421.50071 2.78383,-10.73764" + transform="translate(566.49774,186.4423)" + id="path59685" + style="fill:none;stroke:#28170b;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m 308.409,596.01231 -2.71873,-0.78765 2.44198,1.58102 34.67698,20.88076" + id="path59687" + style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -176.72966,458.31846 69.5331,40.89939" + transform="translate(566.49774,186.4423)" + id="path59689" + style="fill:none;stroke:#ffffff;stroke-width:1.85811877px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -60.530102,527.59053 65.6695522,39.80106 2.6088532,-1.36678 1.9022268,4.70341" + transform="translate(566.49774,186.4423)" + id="path59691" + style="fill:none;stroke:#ffffff;stroke-width:1.21058726px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="m -227.22456,432.16908 4.43675,-1.58455 -1.26764,-5.38747 -0.95074,-4.43675 46.26888,27.57118 0.95073,8.87349 -9.5073,4.11983 -44.36742,-26.62045 -0.63382,-0.95073 z" + transform="translate(566.49774,186.4423)" + id="path5248" + style="opacity:0.55;fill:#000000;fill-opacity:1;stroke:none" /> + <path + d="m -110.60164,501.88931 4.43675,-1.58455 -1.26764,-5.38747 -0.95074,-4.43675 46.268884,27.57118 0.95073,8.87349 -9.5073,4.11983 -44.367424,-26.62045 -0.63382,-0.95073 z" + transform="translate(566.49774,186.4423)" + id="path5252" + style="opacity:0.55;fill:#000000;fill-opacity:1;stroke:none" /> + + <path + d="m 186.0202,781.97908 -0.98424,12.23263 1.96847,1.40605 1.19514,-12.86535 c 0.77824,-0.19365 1.53068,-0.39589 1.75757,-0.77332 0.29403,-0.70303 0.54037,-1.40605 0.2812,-2.10908 -0.11121,-0.75969 -0.59316,-1.39579 -1.26544,-1.96846 -0.77442,-0.39948 -1.37826,-0.62837 -1.96847,-0.84363 -1.6419,-0.1243 -1.44969,0.27544 -1.89817,0.49212 -0.81087,0.45929 -0.82755,1.11714 -0.91393,1.75756 -0.11879,0.96323 0.26624,1.17072 0.49212,1.61695 z" + id="path3536" + style="fill:#241c1c;stroke:#241c1c;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + </g> + </g> + </g> + </g> +</svg> + diff --git a/sandbox/paultremblay/python_interface/test_files/bibliographic_fields.rst b/sandbox/paultremblay/python_interface/test_files/bibliographic_fields.rst new file mode 100644 index 000000000..c91030f9c --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/bibliographic_fields.rst @@ -0,0 +1,22 @@ +.. $Id$ + + +:Author: Paul Tremblay +:Authors: David Goodger, Paul Tremlbay +:Organization: Open Source Software +:Contact: paulhtremblay@gmail.com +:Address: Paul Tremblay + 100 Market St. + Boston, MA, 01800 +:Version: .1 +:Uses: text processing + + documentation +:Status: Pending +:Date: $Date$ +:Copyright: This document is in the public domain +:Dedication: I dedicate this to all the hard working coders in + docutils, who have made text processing possible. +:Abstract: Just an example of bibliograhic fields. + +Text after. diff --git a/sandbox/paultremblay/python_interface/test_files/bibliographic_fields_toc.rst b/sandbox/paultremblay/python_interface/test_files/bibliographic_fields_toc.rst new file mode 100644 index 000000000..33986a6aa --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/bibliographic_fields_toc.rst @@ -0,0 +1,39 @@ +.. $Id$ + +.. role:: page-num + +:Author: Paul Tremblay +:Authors: David Goodger, Paul Tremlbay +:Organization: Open Source Software +:Contact: paulhtremblay@gmail.com +:Address: Paul Tremblay + 100 Market St. + Boston, MA, 01800 +:Version: .1 +:Uses: text processing + + documentation +:Status: Pending +:Date: $Date$ +:Copyright: This document is in the public domain +:Dedication: I dedicate this to all the hard working coders in + docutils, who have made text processing possible. +:Abstract: Just an example of bibliograhic fields. + +.. contents:: Table of Contents + +.. header:: + + A Christmas Carol + +.. footer:: + + Charles Dickens. + + -:page-num:`1`- + + +section +======== + +Text diff --git a/sandbox/paultremblay/python_interface/test_files/block.rst b/sandbox/paultremblay/python_interface/test_files/block.rst new file mode 100644 index 000000000..819ea9017 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/block.rst @@ -0,0 +1,36 @@ +This is an ordinary paragraph, introducing a block quote. + + "It is my business to know things. That is my trade." + + -- Sherlock Holmes + +Text after quote. + +In typesetting, block quotations can be distinguished from the +surrounding text by variation in typeface (often italic vs. roman), +type size, or by indentation. Often combinations of these methods are +used, but are not necessary. Block quotations are also visually +distinguished from preceding and following main text blocks by a white +line or half-line space.[3] + +Fielding hides his own opinions on the matter deep in Tom Jones: — + + Now, in reality, the world have paid too great a compliment to + critics, and have imagined them men of much greater profundity + than they really are. From this complaisance the critics have + been emboldened to assume a dictatorial power, and have so far + succeeded that they are now become the masters, and have the + assurance to give laws to those authors from whose + predecessors they originally received them. + + Now, in reality, the world have paid too great a compliment to + critics, and have imagined them men of much greater profundity + than they really are. From this complaisance the critics have + been emboldened to assume a dictatorial power, and have so far + succeeded that they are now become the masters, and have the + assurance to give laws to those authors from whose + predecessors they originally received them. + +Text after block quote + + diff --git a/sandbox/paultremblay/python_interface/test_files/bullet_list.rst b/sandbox/paultremblay/python_interface/test_files/bullet_list.rst new file mode 100644 index 000000000..adf457b86 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/bullet_list.rst @@ -0,0 +1,25 @@ +.. $Id$ + +This paragraph comes before the list. + +- This is the first bullet list item. The blank line above the + first list item is required; blank lines between list items + (such as below this paragraph) are optional. + +- This is the first paragraph in the second item in the list. + + This is the second paragraph in the second item in the list. + The blank line above this paragraph is required. The left edge + of this paragraph lines up with the paragraph above, both + indented relative to the bullet. + + - This is a sublist. The bullet lines up with the left edge of + the text blocks above. A sublist is a new list so requires a + blank line above and below. + + - second item sublist. + +- This is the third item of the main list. + +This paragraph is not part of the list. + diff --git a/sandbox/paultremblay/python_interface/test_files/citation.rst b/sandbox/paultremblay/python_interface/test_files/citation.rst new file mode 100644 index 000000000..2d3119ba4 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/citation.rst @@ -0,0 +1,7 @@ +Here is a citation reference: [CITESP]_. + + +.. [CITESP] (Esperdy, Gabrielle. 1999) + + + diff --git a/sandbox/paultremblay/python_interface/test_files/compound_paragraph.rst b/sandbox/paultremblay/python_interface/test_files/compound_paragraph.rst new file mode 100644 index 000000000..519c4aff9 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/compound_paragraph.rst @@ -0,0 +1,13 @@ +Paragraph before + +.. compound:: + + The 'rm' command is very dangerous. If you are logged + in as root and enter :: + + cd / + rm -rf * + + you will erase the entire contents of your file system. + +Paragraph before diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/abstract1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/abstract1.conf new file mode 100644 index 000000000..0701679e1 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/abstract1.conf @@ -0,0 +1,16 @@ +[FO] +abstract.page-break-before = true + +abstract-title.alignment = center +abstract-title.font-size = 24pt + + +abstract-paragraph.font-size = 10pt +abstract-paragraph.alignment = right +abstract-paragraph.font-style = italic +abstract-paragraph.background-color = blue + + + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/bibliographic_fields.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/bibliographic_fields.conf new file mode 100644 index 000000000..6d5fe6add --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/bibliographic_fields.conf @@ -0,0 +1,36 @@ + +[general] +trim-footnote-reference-space = true +[FO] + +bibliographic-fields.placement = with-body +bibliographic-fields.space-before = 20pt +bibliographic-fields.space-after = 20pt +bibliographic-fields.space-between-items = 30pt +bibliographic-fields.space-between-items = 30pt + + +bibliographic-fields.left-indent = 10mm +bibliographic-fields.right-indent = 10mm +bibliographic-fields.background-color = grey +bibliographic-fields.font= serif +bibliographic-fields.space-from-field = 2in +# change default font to normal +bibliographic-field.font-style = normal +# change all the fields from the default to lower case +bibliographic-fields.author-text = author +bibliographic-fields.authors-text = authors +bibliographic-fields.organization-text = organization +# change 'contact' to 'email' +bibliographic-fields.contact-text = email +bibliographic-fields.status-text = status +bibliographic-fields.copyright-text = copyright +bibliographic-fields.address-text = address +bibliographic-fields.revision-text = revision +bibliographic-fields.date-text = date +bibliographic-fields.padding = 5pt +bibliographic-fields-text.font-weight=bold +bibliographic-fields-paragraph.space-before = 12pt + +# params +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/bibliographic_fields2.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/bibliographic_fields2.conf new file mode 100644 index 000000000..2be8976f8 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/bibliographic_fields2.conf @@ -0,0 +1,32 @@ +[general] +trim-footnote-reference-space = true +[FO] + +bibliographic-fields.format = normal +address.space-before=24pt +author.font-style = bold +authors.alignment = center +contact.font-style = italic +copyright.color = red +date.background-color = blue +organization.font-size = 24pt +revision.alignment = center +status.alignment = right +version.font-style = bold-italic + +bibliographic-fields.author-text = +bibliographic-fields.authors-text = +bibliographic-fields.organization-text = +bibliographic-fields.contact-text = +bibliographic-fields.status-text = +bibliographic-fields.copyright-text = +bibliographic-fields.address-text = +bibliographic-fields.revision-text = +bibliographic-fields.date-text = + +bibliographic-field-custom1.color = green +bibliographic-field-custom2.color = red +bibliographic-field-custom1.text = country +bibliographic-field-custom2.text = uses +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/block_quote1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/block_quote1.conf new file mode 100644 index 000000000..1ccb5dfe6 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/block_quote1.conf @@ -0,0 +1,16 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +# commands +strict = True + +block-quote.space-before = 1in +block-quote.left-indent = 30mm +block-quote.right-indent = 30mm +block-quote-paragraph.space-before = 0pt +block-quote-paragraph.first-line-indent = 12pt +block-quote.attriubution-text = +block-quote-attribution.space-before = 12pt +block-quote-attribution.font-style = italic diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/bullet_list1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/bullet_list1.conf new file mode 100644 index 000000000..37f52c19e --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/bullet_list1.conf @@ -0,0 +1,25 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +bullet-list.font = Times +bullet-list.space-after = 20pt +bullet-list.space-before = 20pt +bullet-list.left-indent = 20pt +bullet-list.right-indent = 20pt +bullet-list.background-color = grey +bullet-list.space-between-items = 30pt +bullet-list.space-from-bullet = 3in +bullet-list-paragraph.space-before = 12pt +bullet-list-paragraph.font-style = italic +# level 2 +bullet-list-level2.space-before = 20pt +bullet-list-level2.left-indent = 40pt +bullet-list-level2.background-color = blue +bullet-list-level2.space-from-bullet = 1.5in +bullet-list-level2.text = † +bullet-list-level2.space-between-items = 50pt + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/dedication1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/dedication1.conf new file mode 100644 index 000000000..6fcf29df0 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/dedication1.conf @@ -0,0 +1,15 @@ +[FO] +abstract.placement = with-body +dedication.placement = with-body + +dedication.page-break-after = true +dedication-title.alignment = center +dedication-title.font-size = 24pt + +dedication-paragraph.font-size = 10pt +dedication-paragraph.alignment = right +dedication-paragraph.font-style = italic +dedication-paragraph.color = red + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/definition_list1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/definition_list1.conf new file mode 100644 index 000000000..533200ec0 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/definition_list1.conf @@ -0,0 +1,17 @@ +[general] +trim-footnote-reference-space = true +[FO] + +definition-list.space-after = 20pt +definition-list.space-before = 20pt +definition-list.left-indent = 20pt +definition-list.right-indent = 20pt +definition-list.background-color = grey +definition-list.space-between-items = 0pt +definition-list.space-below-term = 30pt +definition-list-definition.color = blue +definition-list-classifier.color = green +definition-list-paragraph.space-before = 0pt + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/enumerated_list1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/enumerated_list1.conf new file mode 100644 index 000000000..20d2ac1c4 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/enumerated_list1.conf @@ -0,0 +1,25 @@ +[general] +trim-footnote-reference-space = true +[FO] + + + +enumerated-list.space-after = 20pt +enumerated-list.space-before = 20pt +enumerated-list.left-indent = 20pt +enumerated-list.right-indent = 20pt +enumerated-list.background-color = grey +enumerated-list.space-between-items = 30pt +enumerated-list.space-from-number = 1in +enumerated-list-paragraph.space-before = 12pt +enumerated-list-paragraph.font-style = italic +enumerated-list-level2.space-before = 20pt +enumerated-list-level2.left-indent = 40pt +enumerated-list-level2.background-color = blue +enumerated-list-level2.space-from-number = 1.5in +enumerated-list-level2.space-between-items = 50pt + + + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/field_list1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/field_list1.conf new file mode 100644 index 000000000..dc882f810 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/field_list1.conf @@ -0,0 +1,20 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +field-list.space-after = 20pt +field-list.space-before = 20pt +field-list.left-indent = 20pt +field-list.right-indent = 20pt +field-list.background-color = grey +field-list.space-between-items = 0pt +field-list.space-from-name = 2in +# same as above +# field-list.space-from-label = 1in +field-list-paragraph.space-before = 12pt +field-list-paragraph.font-style = italic +field-name.color = blue + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/front1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/front1.conf new file mode 100644 index 000000000..638acf570 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/front1.conf @@ -0,0 +1,5 @@ +[FO] + +title-subtitle.placement = with-toc +bibliographic-fields.placement = with-front +dedication.placement = with-front diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/front2.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/front2.conf new file mode 100644 index 000000000..937b77051 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/front2.conf @@ -0,0 +1,2 @@ +[FO] +front.order = title, abstract, dedication, toc, bibliographic diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer2.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer2.conf new file mode 100644 index 000000000..d39de25f3 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer2.conf @@ -0,0 +1,6 @@ +[FO] +header.font-style = bold +header.height = 1in +footer.height = 1in +header.space-before = 2in +footer.space-before = -.1in diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer3.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer3.conf new file mode 100644 index 000000000..139ce9833 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer3.conf @@ -0,0 +1,10 @@ +[FO] + + +# create a blue backgroud color for all paragraphs +header.background-color = blue +# create different formatting for each paragraph +header-paragraph.font-style = bold + +footer-paragraph.font-style = bold-italic + diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer4.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer4.conf new file mode 100644 index 000000000..da8b449b7 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer4.conf @@ -0,0 +1,11 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +# commands +strict = True +body-header.color = red +body-footer.color = red +first-header.background-color = red +first-footer.background-color = red diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer5.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer5.conf new file mode 100644 index 000000000..42555c76b --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer5.conf @@ -0,0 +1,12 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +# commands +strict = True + +odd-header.color = red +odd-footer.color = red +even-header.background-color = red +even-footer.background-color = red diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer6.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer6.conf new file mode 100644 index 000000000..aafdd8b46 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer6.conf @@ -0,0 +1,13 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +# commands +strict = True + +odd-header.color = red +odd-footer.color = red +even-header.background-color = red +even-footer.background-color = red +document.page-layout = first-odd-even diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer7.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer7.conf new file mode 100644 index 000000000..df4ce4f30 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer7.conf @@ -0,0 +1,14 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +# commands +strict = True + +odd-header.color = red +odd-footer.color = red +even-header.background-color = red +even-footer.background-color = red +header-paragraph.font-style = bold +footer-paragraph.font-style = italic diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer_toc1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer_toc1.conf new file mode 100644 index 000000000..647ec1e1e --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer_toc1.conf @@ -0,0 +1,12 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +# commands +strict = True + +toc-body-header.color = red +toc-body-footer.color = red +toc-first-header.background-color = red +toc-first-footer.background-color = red diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer_toc2.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer_toc2.conf new file mode 100644 index 000000000..dc061d945 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer_toc2.conf @@ -0,0 +1,12 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +# commands +strict = True + +toc-odd-header.color = red +toc-odd-footer.color = red +toc-even-header.background-color = red +toc-even-footer.background-color = red diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer_toc3.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer_toc3.conf new file mode 100644 index 000000000..647ec1e1e --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/header_footer_toc3.conf @@ -0,0 +1,12 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +# commands +strict = True + +toc-body-header.color = red +toc-body-footer.color = red +toc-first-header.background-color = red +toc-first-footer.background-color = red diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/line_block1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/line_block1.conf new file mode 100644 index 000000000..26daae8ae --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/line_block1.conf @@ -0,0 +1,17 @@ +[general] +trim-footnote-reference-space = true +[FO] + +line-block.number = 5 +line-block.space-before = 24pt +line-block.font-size = 10pt +line-block.line-spacing = 1 +line-level1.left-indent = 15mm +line-level2.left-indent = 25mm +line-level3.left-indent = 35mm +line-level4.left-indent = 45mm +line-level5.left-indent = 55mm +stanza-title.font-style = bold-italic + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/literal_block1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/literal_block1.conf new file mode 100644 index 000000000..2a3be3570 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/literal_block1.conf @@ -0,0 +1,7 @@ +[general] +trim-footnote-reference-space = true +[FO] +literal-block.background-color = red + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/margins_first_odd_even.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/margins_first_odd_even.conf new file mode 100644 index 000000000..0286ffbba --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/margins_first_odd_even.conf @@ -0,0 +1,18 @@ +[FO] + +odd-page.top-margin = 1in +odd-page.bottom-margin = 1in +odd-page.right-margin = 1in +odd-page.left-margin = 2in + +even-page.top-margin = 1in +even-page.bottom-margin = 1in +even-page.right-margin = 2in +even-page.left-margin = 1in + +first-page.top-margin = 3in +first-page.bottom-margin = 1in +first-page.right-margin = .8in +first-page.left-margin = 2in + + diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/margins_simple.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/margins_simple.conf new file mode 100644 index 000000000..3094a7e77 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/margins_simple.conf @@ -0,0 +1,5 @@ +[FO] +page.top-margin = .75in +page.bottom-margin = .75in +page.right-margin = .75in +page.left-margin = .75in diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/option_list1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/option_list1.conf new file mode 100644 index 000000000..8890bf8ab --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/option_list1.conf @@ -0,0 +1,20 @@ +[general] +trim-footnote-reference-space = true +[FO] + +option-list.format = list +option-list.space-after = 20pt +option-list.space-before = 20pt +option-list.left-indent = 20pt +option-list.right-indent = 20pt +option-list.background-color = grey +option-list.space-between-items = 30pt +option-list.space-from-option = 3in +options-list.separator = : +options.font-size = xx-small +option.color = blue +option-argument.color = green +option-list-body.font-style = italic +option-list-paragraph.space-before = 12pt +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/option_list2.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/option_list2.conf new file mode 100644 index 000000000..373348076 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/option_list2.conf @@ -0,0 +1,21 @@ +[general] +trim-footnote-reference-space = true +[FO] + +option-list.format = definition +option-list.space-after = 20pt +option-list.padding = 10pt +option-list.space-before = 20pt +option-list.left-indent = 20pt +option-list.right-indent = 20pt +option-list.background-color = grey +option-list.space-between-items = 0pt +options-list.separator = : +options.font-size = xx-small +option.color = blue +option-argument.color = green +option-list-body.font-style = italic +option-list-paragraph.space-before = 2in +option-list.space-below-option = 20pt +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/page_number1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/page_number1.conf new file mode 100644 index 000000000..01ead96b1 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/page_number1.conf @@ -0,0 +1,29 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +bibliographic-fields.placement = with-front +abstract.placement = with-front +dedication.placement = with-toc +toc.placement = with-toc +toc.page-break-after = true +toc-title.alignment = left +toc-title.font-size = 24pt +toc-entry1.left-indent = 10mm +toc-entry1.space-after = 5pt +toc-entry2.left-indent = 20mm +toc-entry3.left-indent = 30mm +toc-entry4.left-indent = 40mm +toc-entry5.left-indent = 50mm + +# toc now start on page 3 +toc-section.start-page = 3 +# body starts on page 15 +body-section.start-page = 15 + +toc-section.page-format = I +body-section.page-format = A + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/paper_size.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/paper_size.conf new file mode 100644 index 000000000..3bcdb3fad --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/paper_size.conf @@ -0,0 +1,3 @@ +[FO] +paper-size.height = 11in +paper-size.width = 8.5in diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph1.conf new file mode 100644 index 000000000..396f112d0 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph1.conf @@ -0,0 +1,2 @@ +[FO] +paragraph.page-break-before = yes diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph2.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph2.conf new file mode 100644 index 000000000..396f112d0 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph2.conf @@ -0,0 +1,2 @@ +[FO] +paragraph.page-break-before = yes diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph3.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph3.conf new file mode 100644 index 000000000..f32fdf5ae --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph3.conf @@ -0,0 +1,14 @@ +[FO] +paragraph.space-before = 12pt +paragraph.space-after = 12pt +paragraph.first-line-indent = 12pt +paragraph.font = sans-serif +paragraph.font-size = 12pt +paragraph.font-style = bold-italic +paragraph.color = red +paragraph.background-color = red +paragraph.left-indent = 12pt +paragraph.right-indent = 12pt +# paragraph.border = solid black 1px +paragraph.border-bottom = solid black 1px +paragraph.alignment = center diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph4.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph4.conf new file mode 100644 index 000000000..e5fa83240 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph4.conf @@ -0,0 +1,5 @@ +[FO] + +paragraph.keep-on-same-page = yes + + diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph5.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph5.conf new file mode 100644 index 000000000..2a580cbe5 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/paragraph5.conf @@ -0,0 +1,4 @@ +[FO] + +first-paragraph.first-line-indent = 12pt +paragraph.first-line-indent = 12pt diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/section1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/section1.conf new file mode 100644 index 000000000..e0fb3fc3f --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/section1.conf @@ -0,0 +1,33 @@ +[general] +trim-footnote-reference-space = true +[FO] + +heading1.font-size = 30pt +heading1.font-style = bold +heading2.font-size = 24pt +heading2.font-style = normal +# etc. +heading7.font-size = medium +heading7.font-style = bold + +# (I.), (II.), (III.), etc +heading1.number-format = (I.) + +# i.), ii.), etc +heading2.number-format = i.) + +# .1., .2., .3., etc +heading3.number-format = .1. + +# a, b, c, etc +heading4.number-format = a + +# A, B, C., etc +heading5.number-format = A + +headings.inherit-sections-number = False + +transition.text = + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/table1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/table1.conf new file mode 100644 index 000000000..c65a91729 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/table1.conf @@ -0,0 +1,33 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +# commands +strict = True +table.space-after = 1in +table.space-before = 1in +table.width = 5in +table-header.font-style = bold +table-header.color = white +table-header.background-color = blue +table-header.alignment = center +table-header-cell.border-bottom = 3 px black solid +table-header-cell.vertical-alignment = bottom +table-header-cell.padding-bottom = 0em +table-body.font-style = normal +table-body.color = green +table-body.background-color = red +table-body.alignment = left +table-body.font-style = normal +table-body.color = green +table-body.background-color = red +table-body.alignment = left +# set the vertical alingment to bottom +# get rid of padding on bottom +table-cell.padding-bottom = 0em +# vertically align text with bottom +table-cell.vertical-alignment = bottom +table-cell.border = .5px solid green +table.column-widths = 10, 40 + diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/title1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/title1.conf new file mode 100644 index 000000000..abb14717d --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/title1.conf @@ -0,0 +1,9 @@ +[FO] + +title-subtitle.placement = with-front +title-subtitle.alignment = center +title-subtitle.space-before = 2in +title.font-size = 24pt +title.space-after = 24pt +subtitle.font-size = 18pt +title-subtitle.page-break-after = true diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/toc1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/toc1.conf new file mode 100644 index 000000000..2ec68dc96 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/toc1.conf @@ -0,0 +1,22 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +bibliographic-fields.placement = with-body +abstract.placement = with-body +dedication.placement = with-body +toc.placement = with-body +toc.page-break-after = true +toc-title.alignment = left +toc-title.font-size = 24pt +toc-entry1.left-indent = 10mm +toc-entry2.left-indent = 20mm +toc-entry3.left-indent = 30mm +toc-entry4.left-indent = 40mm +toc-entry5.left-indent = 50mm +toc-default.space-after = 24pt + + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/conf_files/transition1.conf b/sandbox/paultremblay/python_interface/test_files/conf_files/transition1.conf new file mode 100644 index 000000000..b4b99acca --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/conf_files/transition1.conf @@ -0,0 +1,13 @@ +[general] +trim-footnote-reference-space = true +[FO] + + +transition.text = 999 +transition.space-before = 24pt +transition.space-after = 24pt +# change the default alignment from center +transition.alignment = left + +# commands +strict = True diff --git a/sandbox/paultremblay/python_interface/test_files/container.rst b/sandbox/paultremblay/python_interface/test_files/container.rst new file mode 100644 index 000000000..27939d25b --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/container.rst @@ -0,0 +1,9 @@ +before paragraph + +.. container:: custom + + This paragraph might be rendered in a custom way. + + second para + +after paragraph diff --git a/sandbox/paultremblay/python_interface/test_files/definition_list.rst b/sandbox/paultremblay/python_interface/test_files/definition_list.rst new file mode 100644 index 000000000..4cc68ed0c --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/definition_list.rst @@ -0,0 +1,20 @@ +.. $Id$ + +Text before list. + +term 1 + Definition 1. + +term 2 + Definition 2, paragraph 1. + + Definition 2, paragraph 2. + +term 3 : classifier + Definition 3. + +term 4 : classifier one : classifier two + Definition 4. + +Text after list. + diff --git a/sandbox/paultremblay/python_interface/test_files/doctest_blocks.rst b/sandbox/paultremblay/python_interface/test_files/doctest_blocks.rst new file mode 100644 index 000000000..1daba1b83 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/doctest_blocks.rst @@ -0,0 +1,11 @@ +This is an ordinary paragraph. + +>>> print 'this is a Doctest block' +this is a Doctest block + +The following is a literal block:: + + >>> This is not recognized as a doctest block by + reStructuredText. It *will* be recognized by the doctest + module, though! + diff --git a/sandbox/paultremblay/python_interface/test_files/endnotes.rst b/sandbox/paultremblay/python_interface/test_files/endnotes.rst new file mode 100644 index 000000000..ed8b36ce4 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/endnotes.rst @@ -0,0 +1,74 @@ +The Modernize Main Street campaign created during the Depression years +represented a significant effort to revitalize the central business dis- +tricts of American communities [#note1]_. + +Promoted through trade journals and design competitions, the +idea of updating commercial buildings with modern materials and streamlined +design was therefore, one way of renewing citizen’s interest in +consumption [#note2]_. + +Prior to the 1920s, most American citizens tended to “make do” and reuse +material goods instead of purchasing new items each year [#note4]_. + +Advertising strategies to convince people to buy products that were not +absolute necessities for daily life (or were absolutely needed at the time) +soon became the focus of marketing executives [#note5]_. + +Popular magazines with mass distribution like *Ladies’ Home Journal* and *The +Saturday Evening Post* dis- played suggestive advertisements instilling a +desire for consumable products. Marketing ideas based on planned obsolescence +and repackaged goods encour- aged a development of this “modern” consumer +culture [#note6]_. + +An increased cultural emphasis on consumption as a capitalist value challenged +Puritan morals which began to decline by the end of the 1920s [#note7]_. + + +1938 [*]_. $112,457,506 + +1939 [*]_. $112,457,506 + +.. Year Amount +.. 1933 $33,000,000 +.. 1934 $37,861,600 +.. 1935 $69,036,398 +.. 1936 $97,310,000 +.. 1937 $124,536,283 +.. 1939 $126,159,914 +.. 1940 $130,101,332 +.. 1941 $133,987,740 + + +.. [*] There was a recession in 1938 which dampened spending on modernizing. + The 1938 figure, however, was still above the spending of 1936. + +.. [*] second ere was a recession in 1938 which dampened spending on modernizing. + The 1938 figure, however, was still above the spending of 1936. + +.. class:: endnotes +.. rubric:: Endnotes + + +.. [#note1] Esperdy, Gabrielle. “Modernizing Main Street: Everyday Architecture and + the New Deal.” Dissertation. (The City University of New York, 1999). Ann + Arbor, Michigan: UMI, 2000, 327. + + para NOTE + +.. [#note2] Gebhard, David. *Art Deco in America*. (New York: John Wiley and Sons, + 1996), 14. + + +.. [#note4] Horowitz, Daniel. *The Morality of Spending: Attitudes Towards the + Consumer Society in America, 1875-1940*. Baltimore: John Hopkins University + Press, 1985, 114. + +.. [#note5] Filene, Edward A. *The Next Steps in Retailing*. (New York: Harper and + Brothers, Inc., 1937): 2 + +.. [#note6] Ewan, Stuart. *All Consuming Images: The Politics of Style in Contemporary + Culture*. New York: Basic Books, Inc., 1988, 47. + +.. [#note7] Horowitz, Daniel. *The Morality of Spending: Attitudes Towards the Con- + sumer Society in America, 1875-1940*, 134-135. + diff --git a/sandbox/paultremblay/python_interface/test_files/enumerated_list.rst b/sandbox/paultremblay/python_interface/test_files/enumerated_list.rst new file mode 100644 index 000000000..e31d754c8 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/enumerated_list.rst @@ -0,0 +1,72 @@ +.. $Id$ + +.. example of enumerated list + +Follows an Arabic list + +(1) first item + + second para first item + +(2) second item + +(3) third item + +Follows a lower Roman list + +(i) first item + + second para first item + +(ii) second item + +(iii) third item + +Follows an upper Roman list + +(I) first item + + second para first item + +(II) second item + +(III) third item + +Follows an upper Alphabetic list + +(A) first item + second para first item +(B) second item +(C) third item + +Follows a lower Alphabetic list + +(a) first item + + second para first item + +(b) second item + +(c) third item + + +Follows an Arabic list + +(#) first item + + second para first item + +(#) second item + +(#) third item + +Follows a nested list. + +1. Item 1 initial text. + + a) Item 1a. + b) Item 1b. + +2. a) Item 2a. + b) Item 2b. + diff --git a/sandbox/paultremblay/python_interface/test_files/epigraph.rst b/sandbox/paultremblay/python_interface/test_files/epigraph.rst new file mode 100644 index 000000000..96fcbd769 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/epigraph.rst @@ -0,0 +1,14 @@ +paragrah text + +.. epigraph:: + + + The depression, which brought so many changes in retailing, favored these types + of retail outlets (chain stores). The consumers had their eyes on prices. They + still wanted things. They desired to keep up their standards of living with reduced + incomes. Shopping was a job that the consumer was willing to work at. + + --Edward A. Filene, 1937 + + +paragrah text diff --git a/sandbox/paultremblay/python_interface/test_files/field_lists.rst b/sandbox/paultremblay/python_interface/test_files/field_lists.rst new file mode 100644 index 000000000..69e5b5790 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/field_lists.rst @@ -0,0 +1,22 @@ +.. $Id$ + +.. example Field List file + +Example of Fields List + +:Indentation: Since the field marker may be quite long, the second + and subsequent lines of the field body do not have to line up + with the first line, but they must be indented relative to the + field name marker, and they must line up with each other. +:Parameter i: integer + +:Test list arg: foo + + first + + second + + third + +Text after field list. + diff --git a/sandbox/paultremblay/python_interface/test_files/figure.rst b/sandbox/paultremblay/python_interface/test_files/figure.rst new file mode 100644 index 000000000..4b16edab7 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/figure.rst @@ -0,0 +1,21 @@ +.. figure:: badaman_treasure_chest.png + :scale: 50% + :alt: map to buried treasure + :figwidth: 100% + + This is the caption of the figure (a simple paragraph). + + The legend consists of all elements after the caption. In this + case, the legend consists of this paragraph and the following + table: + + +-----------------------+-----------------------+ + | Symbol | Meaning | + +=======================+=======================+ + | .. image:: tent.png | Campground | + +-----------------------+-----------------------+ + | .. image:: waves.png | Lake | + +-----------------------+-----------------------+ + | .. image:: peak.png | Mountain | + +-----------------------+-----------------------+ + diff --git a/sandbox/paultremblay/python_interface/test_files/first_paragraph.rst b/sandbox/paultremblay/python_interface/test_files/first_paragraph.rst new file mode 100644 index 000000000..297da12ad --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/first_paragraph.rst @@ -0,0 +1,147 @@ +.. $Id$ + +.. role:: page-num + +:Author: Paul Tremblay +:Authors: David Goodger, Paul Tremlbay +:Organization: Open Source Software +:Contact: paulhtremblay@gmail.com +:Address: Paul Tremblay + 100 Market St. + Boston, MA, 01800 +:Version: .1 +:Uses: text processing + + documentation +:Status: Pending +:Date: $Date$ +:Copyright: This document is in the public domain +:Dedication: I dedicate this to all the hard working coders in + docutils, who have made text processing possible. +:Abstract: Just an example of bibliograhic fields. + +.. contents:: Table of Contents + +.. header:: + + A Christmas Carol + +.. footer:: + + Charles Dickens. + + -:page-num:`1`- + +.. comment + +.. yet again + +first para + +.. comment + +second para + +second para + +.. attention:: + + Make sure Admonitions are specially marked "topics" that can appear anywhere + an ordinary body element can. They contain arbitrary body elements. + Typically, an admonition is rendered as an offset block in a document, + sometimes outlined or shaded, with a title matching the admonition type. For + +First + +Second + +.. caution:: + + first para + + second para + +First + +Second + +.. danger:: + + first para + + second para + +First + +Second + +.. error:: + + first para + + second para + +First + +Second + +.. hint:: + + first para + + second para + +First + +Second + +.. important:: + + first para + + second para + +First + +Second + +.. note:: + + first para + + second para + +First + +Second + +.. tip:: + + first para + + second para + +First + +Second + +.. warning:: + + first para + + second para + +First + +Second + + +.. admonition:: custom + + first para + + second para + +First + +Second diff --git a/sandbox/paultremblay/python_interface/test_files/footnotes.rst b/sandbox/paultremblay/python_interface/test_files/footnotes.rst new file mode 100644 index 000000000..c096bbd5c --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/footnotes.rst @@ -0,0 +1,71 @@ +The Modernize Main Street campaign created during the Depression years +represented a significant effort to revitalize the central business dis- +tricts of American communities [#note1]_. + +Promoted through trade journals and design competitions, the +idea of updating commercial buildings with modern materials and streamlined +design was therefore, one way of renewing citizen’s interest in +consumption [#note2]_. + +Prior to the 1920s, most American citizens tended to “make do” and reuse +material goods instead of purchasing new items each year [#note4]_. + +Advertising strategies to convince people to buy products that were not +absolute necessities for daily life (or were absolutely needed at the time) +soon became the focus of marketing executives [#note5]_. + +Popular magazines with mass distribution like *Ladies’ Home Journal* and *The +Saturday Evening Post* dis- played suggestive advertisements instilling a +desire for consumable products. Marketing ideas based on planned obsolescence +and repackaged goods encour- aged a development of this “modern” consumer +culture [#note6]_. + +An increased cultural emphasis on consumption as a capitalist value challenged +Puritan morals which began to decline by the end of the 1920s [#note7]_. + + +1938 [*]_. $112,457,506 + +1939 [*]_. $112,457,506 + +.. Year Amount +.. 1933 $33,000,000 +.. 1934 $37,861,600 +.. 1935 $69,036,398 +.. 1936 $97,310,000 +.. 1937 $124,536,283 +.. 1939 $126,159,914 +.. 1940 $130,101,332 +.. 1941 $133,987,740 + + +.. [*] There was a recession in 1938 which dampened spending on modernizing. + The 1938 figure, however, was still above the spending of 1936. + +.. [*] second ere was a recession in 1938 which dampened spending on modernizing. + The 1938 figure, however, was still above the spending of 1936. + + +.. [#note1] Esperdy, Gabrielle. “Modernizing Main Street: Everyday Architecture and + the New Deal.” Dissertation. (The City University of New York, 1999). Ann + Arbor, Michigan: UMI, 2000, 327. + + para NOTE + +.. [#note2] Gebhard, David. *Art Deco in America*. (New York: John Wiley and Sons, + 1996), 14. + + +.. [#note4] Horowitz, Daniel. *The Morality of Spending: Attitudes Towards the + Consumer Society in America, 1875-1940*. Baltimore: John Hopkins University + Press, 1985, 114. + +.. [#note5] Filene, Edward A. *The Next Steps in Retailing*. (New York: Harper and + Brothers, Inc., 1937): 2 + +.. [#note6] Ewan, Stuart. *All Consuming Images: The Politics of Style in Contemporary + Culture*. New York: Basic Books, Inc., 1988, 47. + +.. [#note7] Horowitz, Daniel. *The Morality of Spending: Attitudes Towards the Con- + sumer Society in America, 1875-1940*, 134-135. + diff --git a/sandbox/paultremblay/python_interface/test_files/front_body.rst b/sandbox/paultremblay/python_interface/test_files/front_body.rst new file mode 100644 index 000000000..2973da28c --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/front_body.rst @@ -0,0 +1,75 @@ +.. $Id$ + +############# +Main Title +############# + +Subtitle +^^^^^^^^^ + +:Organization: Open Source Software +:Author: Paul Tremblay +:Authors: David Goodger, Paul Tremlbay +:Contact: paulhtremblay@gmail.com +:Address: Paul Tremblay + 100 Market St. + Boston, MA, 01800 +:Version: .1 +:Uses: text processing + + documentation +:Status: Pending +:Date: $Date$ +:Copyright: This document is in the public domain +:Abstract: Just an example of bibliograhic fields. +:Dedication: I dedicate this to all the hard working coders in + docutils, who have made text processing possible. + +.. role:: page-num + +.. header:: + + Header + +.. footer:: + + Footer + + -:page-num:`1`- + + +.. sectnum:: + +.. contents:: Table of Contents + + +Stave I: Marley's Ghost +========================== + +text + +subtitle +---------- + +text + + +Stave II: The First of the Three Spirits +=========================================== + +text + +Stave III: The Second of the Three Spirits +=========================================== + +text + +Stave IV: The Last of the Spirits +=================================== + +text + +Stave V: The End of It +========================== + +text diff --git a/sandbox/paultremblay/python_interface/test_files/header_footer.rst b/sandbox/paultremblay/python_interface/test_files/header_footer.rst new file mode 100644 index 000000000..c2131c41a --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/header_footer.rst @@ -0,0 +1,963 @@ +.. $Id:$ + +.. set up roles, etc. + +.. role:: page-num + +.. header:: + + A Christmas Carol + +.. footer:: + + Charles Dickens. + + -:page-num:`1`- + +MARLEY was dead: to begin with. There is no doubt +whatever about that. The register of his burial was +signed by the clergyman, the clerk, the undertaker, +and the chief mourner. Scrooge signed it: and +Scrooge's name was good upon 'Change, for anything he +chose to put his hand to. Old Marley was as dead as a +door-nail. + +Mind! I don't mean to say that I know, of my +own knowledge, what there is particularly dead about +a door-nail. I might have been inclined, myself, to +regard a coffin-nail as the deadest piece of ironmongery +in the trade. But the wisdom of our ancestors +is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that +Marley was as dead as a door-nail. + +Scrooge knew he was dead? Of course he did. +How could it be otherwise? Scrooge and he were +partners for I don't know how many years. Scrooge +was his sole executor, his sole administrator, his sole +assign, his sole residuary legatee, his sole friend, and +sole mourner. And even Scrooge was not so dreadfully +cut up by the sad event, but that he was an excellent +man of business on the very day of the funeral, +and solemnised it with an undoubted bargain. + +The mention of Marley's funeral brings me back to +the point I started from. There is no doubt that Marley +was dead. This must be distinctly understood, or +nothing wonderful can come of the story I am going +to relate. If we were not perfectly convinced that +Hamlet's Father died before the play began, there +would be nothing more remarkable in his taking a +stroll at night, in an easterly wind, upon his own ramparts, +than there would be in any other middle-aged +gentleman rashly turning out after dark in a breezy +spot--say Saint Paul's Churchyard for instance-- +literally to astonish his son's weak mind. + +Scrooge never painted out Old Marley's name. +There it stood, years afterwards, above the warehouse +door: Scrooge and Marley. The firm was known as +Scrooge and Marley. Sometimes people new to the +business called Scrooge Scrooge, and sometimes Marley, +but he answered to both names. It was all the +same to him. + +Oh! But he was a tight-fisted hand at the grind-stone, +Scrooge! a squeezing, wrenching, grasping, scraping, +clutching, covetous, old sinner! Hard and sharp as flint, +from which no steel had ever struck out generous fire; +secret, and self-contained, and solitary as an oyster. The +cold within him froze his old features, nipped his pointed +nose, shrivelled his cheek, stiffened his gait; made his +eyes red, his thin lips blue; and spoke out shrewdly in his +grating voice. A frosty rime was on his head, and on his +eyebrows, and his wiry chin. He carried his own low +temperature always about with him; he iced his office in +the dog-days; and didn't thaw it one degree at Christmas. + +External heat and cold had little influence on +Scrooge. No warmth could warm, no wintry weather +chill him. No wind that blew was bitterer than he, +no falling snow was more intent upon its purpose, no +pelting rain less open to entreaty. Foul weather didn't +know where to have him. The heaviest rain, and +snow, and hail, and sleet, could boast of the advantage +over him in only one respect. They often "came down" +handsomely, and Scrooge never did. + +Nobody ever stopped him in the street to say, with +gladsome looks, "My dear Scrooge, how are you? +When will you come to see me?" No beggars implored +him to bestow a trifle, no children asked him +what it was o'clock, no man or woman ever once in all +his life inquired the way to such and such a place, of +Scrooge. Even the blind men's dogs appeared to +know him; and when they saw him coming on, would +tug their owners into doorways and up courts; and +then would wag their tails as though they said, "No +eye at all is better than an evil eye, dark master!" + +But what did Scrooge care! It was the very thing +he liked. To edge his way along the crowded paths +of life, warning all human sympathy to keep its distance, +was what the knowing ones call "nuts" to Scrooge. + +Once upon a time--of all the good days in the year, +on Christmas Eve--old Scrooge sat busy in his +counting-house. It was cold, bleak, biting weather: foggy +withal: and he could hear the people in the court outside, +go wheezing up and down, beating their hands +upon their breasts, and stamping their feet upon the +pavement stones to warm them. The city clocks had +only just gone three, but it was quite dark already-- +it had not been light all day--and candles were flaring +in the windows of the neighbouring offices, like +ruddy smears upon the palpable brown air. The fog +came pouring in at every chink and keyhole, and was +so dense without, that although the court was of the +narrowest, the houses opposite were mere phantoms. +To see the dingy cloud come drooping down, obscuring +everything, one might have thought that Nature +lived hard by, and was brewing on a large scale. + +The door of Scrooge's counting-house was open +that he might keep his eye upon his clerk, who in a +dismal little cell beyond, a sort of tank, was copying +letters. Scrooge had a very small fire, but the clerk's +fire was so very much smaller that it looked like one +coal. But he couldn't replenish it, for Scrooge kept +the coal-box in his own room; and so surely as the +clerk came in with the shovel, the master predicted +that it would be necessary for them to part. Wherefore +the clerk put on his white comforter, and tried to +warm himself at the candle; in which effort, not being +a man of a strong imagination, he failed. + +"A merry Christmas, uncle! God save you!" cried +a cheerful voice. It was the voice of Scrooge's +nephew, who came upon him so quickly that this was +the first intimation he had of his approach. + +"Bah!" said Scrooge, "Humbug!" + +He had so heated himself with rapid walking in the +fog and frost, this nephew of Scrooge's, that he was +all in a glow; his face was ruddy and handsome; his +eyes sparkled, and his breath smoked again. + +"Christmas a humbug, uncle!" said Scrooge's +nephew. "You don't mean that, I am sure?" + +"I do," said Scrooge. "Merry Christmas! What +right have you to be merry? What reason have you +to be merry? You're poor enough." + +"Come, then," returned the nephew gaily. "What +right have you to be dismal? What reason have you +to be morose? You're rich enough." + +Scrooge having no better answer ready on the spur +of the moment, said, "Bah!" again; and followed it up +with "Humbug." + +"Don't be cross, uncle!" said the nephew. + +"What else can I be," returned the uncle, "when I +live in such a world of fools as this? Merry Christmas! +Out upon merry Christmas! What's Christmas +time to you but a time for paying bills without +money; a time for finding yourself a year older, but +not an hour richer; a time for balancing your books +and having every item in 'em through a round dozen +of months presented dead against you? If I could +work my will," said Scrooge indignantly, "every idiot +who goes about with 'Merry Christmas' on his lips, +should be boiled with his own pudding, and buried +with a stake of holly through his heart. He should!" + +"Uncle!" pleaded the nephew. + +"Nephew!" returned the uncle sternly, "keep Christmas +in your own way, and let me keep it in mine." + +"Keep it!" repeated Scrooge's nephew. "But you +don't keep it." + +"Let me leave it alone, then," said Scrooge. "Much +good may it do you! Much good it has ever done +you!" + +"There are many things from which I might have +derived good, by which I have not profited, I dare +say," returned the nephew. "Christmas among the +rest. But I am sure I have always thought of Christmas +time, when it has come round--apart from the +veneration due to its sacred name and origin, if anything +belonging to it can be apart from that--as a +good time; a kind, forgiving, charitable, pleasant +time; the only time I know of, in the long calendar +of the year, when men and women seem by one consent +to open their shut-up hearts freely, and to think +of people below them as if they really were +fellow-passengers to the grave, and not another race +of creatures bound on other journeys. And therefore, +uncle, though it has never put a scrap of gold or +silver in my pocket, I believe that it has done me +good, and will do me good; and I say, God bless it!" + +The clerk in the Tank involuntarily applauded. +Becoming immediately sensible of the impropriety, +he poked the fire, and extinguished the last frail spark +for ever. + +"Let me hear another sound from you," said +Scrooge, "and you'll keep your Christmas by losing +your situation! You're quite a powerful speaker, +sir," he added, turning to his nephew. "I wonder you +don't go into Parliament." + +"Don't be angry, uncle. Come! Dine with us to-morrow." + +Scrooge said that he would see him--yes, indeed he +did. He went the whole length of the expression, +and said that he would see him in that extremity first. + +"But why?" cried Scrooge's nephew. "Why?" + +"Why did you get married?" said Scrooge. + +"Because I fell in love." + +"Because you fell in love!" growled Scrooge, as if +that were the only one thing in the world more ridiculous +than a merry Christmas. "Good afternoon!" + +"Nay, uncle, but you never came to see me before +that happened. Why give it as a reason for not +coming now?" + +"Good afternoon," said Scrooge. + +"I want nothing from you; I ask nothing of you; +why cannot we be friends?" + +"Good afternoon," said Scrooge. + +"I am sorry, with all my heart, to find you so +resolute. We have never had any quarrel, to which I +have been a party. But I have made the trial in +homage to Christmas, and I'll keep my Christmas +humour to the last. So A Merry Christmas, uncle!" + +"Good afternoon!" said Scrooge. + +"And A Happy New Year!" + +"Good afternoon!" said Scrooge. + +His nephew left the room without an angry word, +notwithstanding. He stopped at the outer door to +bestow the greetings of the season on the clerk, who, +cold as he was, was warmer than Scrooge; for he returned +them cordially. + +"There's another fellow," muttered Scrooge; who +overheard him: "my clerk, with fifteen shillings a +week, and a wife and family, talking about a merry +Christmas. I'll retire to Bedlam." + +This lunatic, in letting Scrooge's nephew out, had +let two other people in. They were portly gentlemen, +pleasant to behold, and now stood, with their hats off, +in Scrooge's office. They had books and papers in +their hands, and bowed to him. + +"Scrooge and Marley's, I believe," said one of the +gentlemen, referring to his list. "Have I the pleasure +of addressing Mr. Scrooge, or Mr. Marley?" + +"Mr. Marley has been dead these seven years," +Scrooge replied. "He died seven years ago, this very +night." + +"We have no doubt his liberality is well represented +by his surviving partner," said the gentleman, presenting +his credentials. + +It certainly was; for they had been two kindred +spirits. At the ominous word "liberality," Scrooge +frowned, and shook his head, and handed the credentials +back. + +"At this festive season of the year, Mr. Scrooge," +said the gentleman, taking up a pen, "it is more than +usually desirable that we should make some slight +provision for the Poor and destitute, who suffer +greatly at the present time. Many thousands are in +want of common necessaries; hundreds of thousands +are in want of common comforts, sir." + +"Are there no prisons?" asked Scrooge. + +"Plenty of prisons," said the gentleman, laying down +the pen again. + +"And the Union workhouses?" demanded Scrooge. +"Are they still in operation?" + +"They are. Still," returned the gentleman, "I wish +I could say they were not." + +"The Treadmill and the Poor Law are in full vigour, +then?" said Scrooge. + +"Both very busy, sir." + +"Oh! I was afraid, from what you said at first, +that something had occurred to stop them in their +useful course," said Scrooge. "I'm very glad to +hear it." + +"Under the impression that they scarcely furnish +Christian cheer of mind or body to the multitude," +returned the gentleman, "a few of us are endeavouring +to raise a fund to buy the Poor some meat and drink, +and means of warmth. We choose this time, because +it is a time, of all others, when Want is keenly felt, +and Abundance rejoices. What shall I put you down +for?" + +"Nothing!" Scrooge replied. + +"You wish to be anonymous?" + +"I wish to be left alone," said Scrooge. "Since you +ask me what I wish, gentlemen, that is my answer. +I don't make merry myself at Christmas and I can't +afford to make idle people merry. I help to support +the establishments I have mentioned--they cost +enough; and those who are badly off must go there." + +"Many can't go there; and many would rather die." + +"If they would rather die," said Scrooge, "they had +better do it, and decrease the surplus population. +Besides--excuse me--I don't know that." + +"But you might know it," observed the gentleman. + +"It's not my business," Scrooge returned. "It's +enough for a man to understand his own business, and +not to interfere with other people's. Mine occupies +me constantly. Good afternoon, gentlemen!" + +Seeing clearly that it would be useless to pursue +their point, the gentlemen withdrew. Scrooge resumed +his labours with an improved opinion of himself, +and in a more facetious temper than was usual +with him. + +Meanwhile the fog and darkness thickened so, that +people ran about with flaring links, proffering their +services to go before horses in carriages, and conduct +them on their way. The ancient tower of a church, +whose gruff old bell was always peeping slily down +at Scrooge out of a Gothic window in the wall, became +invisible, and struck the hours and quarters in the +clouds, with tremulous vibrations afterwards as if +its teeth were chattering in its frozen head up there. +The cold became intense. In the main street, at the +corner of the court, some labourers were repairing +the gas-pipes, and had lighted a great fire in a brazier, +round which a party of ragged men and boys were +gathered: warming their hands and winking their +eyes before the blaze in rapture. The water-plug +being left in solitude, its overflowings sullenly congealed, +and turned to misanthropic ice. The brightness +of the shops where holly sprigs and berries +crackled in the lamp heat of the windows, made pale +faces ruddy as they passed. Poulterers' and grocers' +trades became a splendid joke: a glorious pageant, +with which it was next to impossible to believe that +such dull principles as bargain and sale had anything +to do. The Lord Mayor, in the stronghold of the +mighty Mansion House, gave orders to his fifty cooks +and butlers to keep Christmas as a Lord Mayor's +household should; and even the little tailor, whom he +had fined five shillings on the previous Monday for +being drunk and bloodthirsty in the streets, stirred up +to-morrow's pudding in his garret, while his lean +wife and the baby sallied out to buy the beef. + +Foggier yet, and colder. Piercing, searching, biting +cold. If the good Saint Dunstan had but nipped +the Evil Spirit's nose with a touch of such weather +as that, instead of using his familiar weapons, then +indeed he would have roared to lusty purpose. The +owner of one scant young nose, gnawed and mumbled +by the hungry cold as bones are gnawed by dogs, +stooped down at Scrooge's keyhole to regale him with +a Christmas carol: but at the first sound of + +.. text ommitted here + +.. "God bless you, merry gentleman! +.. May nothing you dismay!" + +Scrooge seized the ruler with such energy of action, +that the singer fled in terror, leaving the keyhole to +the fog and even more congenial frost. + +At length the hour of shutting up the counting-house +arrived. With an ill-will Scrooge dismounted from his +stool, and tacitly admitted the fact to the expectant +clerk in the Tank, who instantly snuffed his candle out, +and put on his hat. + +"You'll want all day to-morrow, I suppose?" said +Scrooge. + +"If quite convenient, sir." + +"It's not convenient," said Scrooge, "and it's not +fair. If I was to stop half-a-crown for it, you'd +think yourself ill-used, I'll be bound?" + +The clerk smiled faintly. + +"And yet," said Scrooge, "you don't think me ill-used, +when I pay a day's wages for no work." + +The clerk observed that it was only once a year. + +"A poor excuse for picking a man's pocket every +twenty-fifth of December!" said Scrooge, buttoning +his great-coat to the chin. "But I suppose you must +have the whole day. Be here all the earlier next +morning." + +The clerk promised that he would; and Scrooge +walked out with a growl. The office was closed in a +twinkling, and the clerk, with the long ends of his +white comforter dangling below his waist (for he +boasted no great-coat), went down a slide on Cornhill, +at the end of a lane of boys, twenty times, in +honour of its being Christmas Eve, and then ran home +to Camden Town as hard as he could pelt, to play +at blindman's-buff. + +Scrooge took his melancholy dinner in his usual +melancholy tavern; and having read all the newspapers, and +beguiled the rest of the evening with his +banker's-book, went home to bed. He lived in +chambers which had once belonged to his deceased +partner. They were a gloomy suite of rooms, in a +lowering pile of building up a yard, where it had so +little business to be, that one could scarcely help +fancying it must have run there when it was a young +house, playing at hide-and-seek with other houses, +and forgotten the way out again. It was old enough +now, and dreary enough, for nobody lived in it but +Scrooge, the other rooms being all let out as offices. +The yard was so dark that even Scrooge, who knew +its every stone, was fain to grope with his hands. +The fog and frost so hung about the black old gateway +of the house, that it seemed as if the Genius of +the Weather sat in mournful meditation on the +threshold. + +Now, it is a fact, that there was nothing at all +particular about the knocker on the door, except that it +was very large. It is also a fact, that Scrooge had +seen it, night and morning, during his whole residence +in that place; also that Scrooge had as little of what +is called fancy about him as any man in the city of +London, even including--which is a bold word--the +corporation, aldermen, and livery. Let it also be +borne in mind that Scrooge had not bestowed one +thought on Marley, since his last mention of his +seven years' dead partner that afternoon. And then +let any man explain to me, if he can, how it happened +that Scrooge, having his key in the lock of the door, +saw in the knocker, without its undergoing any intermediate +process of change--not a knocker, but Marley's face. + +Marley's face. It was not in impenetrable shadow +as the other objects in the yard were, but had a +dismal light about it, like a bad lobster in a dark +cellar. It was not angry or ferocious, but looked +at Scrooge as Marley used to look: with ghostly +spectacles turned up on its ghostly forehead. The +hair was curiously stirred, as if by breath or hot air; +and, though the eyes were wide open, they were perfectly +motionless. That, and its livid colour, made it +horrible; but its horror seemed to be in spite of the +face and beyond its control, rather than a part of +its own expression. + +As Scrooge looked fixedly at this phenomenon, it +was a knocker again. + +To say that he was not startled, or that his blood +was not conscious of a terrible sensation to which it +had been a stranger from infancy, would be untrue. +But he put his hand upon the key he had relinquished, +turned it sturdily, walked in, and lighted his candle. + +He did pause, with a moment's irresolution, before +he shut the door; and he did look cautiously behind +it first, as if he half expected to be terrified with the +sight of Marley's pigtail sticking out into the hall. +But there was nothing on the back of the door, except +the screws and nuts that held the knocker on, so he +said "Pooh, pooh!" and closed it with a bang. + +The sound resounded through the house like thunder. +Every room above, and every cask in the wine-merchant's +cellars below, appeared to have a separate peal +of echoes of its own. Scrooge was not a man to +be frightened by echoes. He fastened the door, and +walked across the hall, and up the stairs; slowly too: +trimming his candle as he went. + +You may talk vaguely about driving a coach-and-six +up a good old flight of stairs, or through a bad +young Act of Parliament; but I mean to say you +might have got a hearse up that staircase, and taken +it broadwise, with the splinter-bar towards the wall +and the door towards the balustrades: and done it +easy. There was plenty of width for that, and room +to spare; which is perhaps the reason why Scrooge +thought he saw a locomotive hearse going on before +him in the gloom. Half-a-dozen gas-lamps out of +the street wouldn't have lighted the entry too well, +so you may suppose that it was pretty dark with +Scrooge's dip. + +Up Scrooge went, not caring a button for that. +Darkness is cheap, and Scrooge liked it. But before +he shut his heavy door, he walked through his rooms +to see that all was right. He had just enough recollection +of the face to desire to do that. + +Sitting-room, bedroom, lumber-room. All as they +should be. Nobody under the table, nobody under +the sofa; a small fire in the grate; spoon and basin +ready; and the little saucepan of gruel (Scrooge had +a cold in his head) upon the hob. Nobody under the +bed; nobody in the closet; nobody in his dressing-gown, +which was hanging up in a suspicious attitude +against the wall. Lumber-room as usual. Old fire-guard, +old shoes, two fish-baskets, washing-stand on three +legs, and a poker. + +Quite satisfied, he closed his door, and locked +himself in; double-locked himself in, which was not his +custom. Thus secured against surprise, he took off +his cravat; put on his dressing-gown and slippers, and +his nightcap; and sat down before the fire to take +his gruel. + +It was a very low fire indeed; nothing on such a +bitter night. He was obliged to sit close to it, and +brood over it, before he could extract the least +sensation of warmth from such a handful of fuel. +The fireplace was an old one, built by some Dutch +merchant long ago, and paved all round with quaint +Dutch tiles, designed to illustrate the Scriptures. +There were Cains and Abels, Pharaoh's daughters; +Queens of Sheba, Angelic messengers descending +through the air on clouds like feather-beds, Abrahams, +Belshazzars, Apostles putting off to sea in butter-boats, +hundreds of figures to attract his thoughts; +and yet that face of Marley, seven years dead, came +like the ancient Prophet's rod, and swallowed up the +whole. If each smooth tile had been a blank at first, +with power to shape some picture on its surface from +the disjointed fragments of his thoughts, there would +have been a copy of old Marley's head on every one. + +"Humbug!" said Scrooge; and walked across the +room. + +After several turns, he sat down again. As he +threw his head back in the chair, his glance happened +to rest upon a bell, a disused bell, that hung in the +room, and communicated for some purpose now forgotten +with a chamber in the highest story of the +building. It was with great astonishment, and with +a strange, inexplicable dread, that as he looked, he +saw this bell begin to swing. It swung so softly in +the outset that it scarcely made a sound; but soon it +rang out loudly, and so did every bell in the house. + +This might have lasted half a minute, or a minute, +but it seemed an hour. The bells ceased as they had +begun, together. They were succeeded by a clanking +noise, deep down below; as if some person were +dragging a heavy chain over the casks in the +wine-merchant's cellar. Scrooge then remembered to have +heard that ghosts in haunted houses were described as +dragging chains. + +The cellar-door flew open with a booming sound, +and then he heard the noise much louder, on the floors +below; then coming up the stairs; then coming straight +towards his door. + +"It's humbug still!" said Scrooge. "I won't believe it." + +His colour changed though, when, without a pause, +it came on through the heavy door, and passed into +the room before his eyes. Upon its coming in, the +dying flame leaped up, as though it cried, "I know +him; Marley's Ghost!" and fell again. + +The same face: the very same. Marley in his pigtail, +usual waistcoat, tights and boots; the tassels on +the latter bristling, like his pigtail, and his coat-skirts, +and the hair upon his head. The chain he drew was +clasped about his middle. It was long, and wound +about him like a tail; and it was made (for Scrooge +observed it closely) of cash-boxes, keys, padlocks, +ledgers, deeds, and heavy purses wrought in steel. +His body was transparent; so that Scrooge, observing him, +and looking through his waistcoat, could see +the two buttons on his coat behind. + +Scrooge had often heard it said that Marley had no +bowels, but he had never believed it until now. + +No, nor did he believe it even now. Though he +looked the phantom through and through, and saw +it standing before him; though he felt the chilling +influence of its death-cold eyes; and marked the very +texture of the folded kerchief bound about its head +and chin, which wrapper he had not observed before; +he was still incredulous, and fought against his senses. + +"How now!" said Scrooge, caustic and cold as ever. +"What do you want with me?" + +"Much!"--Marley's voice, no doubt about it. + +"Who are you?" + +"Ask me who I was." + +"Who were you then?" said Scrooge, raising his +voice. "You're particular, for a shade." He was going +to say "to a shade," but substituted this, as more +appropriate. + +"In life I was your partner, Jacob Marley." + +"Can you--can you sit down?" asked Scrooge, looking +doubtfully at him. + +"I can." + +"Do it, then." + +Scrooge asked the question, because he didn't know +whether a ghost so transparent might find himself in +a condition to take a chair; and felt that in the event +of its being impossible, it might involve the necessity +of an embarrassing explanation. But the ghost sat +down on the opposite side of the fireplace, as if he +were quite used to it. + +"You don't believe in me," observed the Ghost. + +"I don't," said Scrooge. + +"What evidence would you have of my reality beyond that of +your senses?" + +"I don't know," said Scrooge. + +"Why do you doubt your senses?" + +"Because," said Scrooge, "a little thing affects them. +A slight disorder of the stomach makes them cheats. You may +be an undigested bit of beef, a blot of mustard, a crumb of +cheese, a fragment of an underdone potato. There's more of +gravy than of grave about you, whatever you are!" + +Scrooge was not much in the habit of cracking +jokes, nor did he feel, in his heart, by any means +waggish then. The truth is, that he tried to be +smart, as a means of distracting his own attention, +and keeping down his terror; for the spectre's voice +disturbed the very marrow in his bones. + +To sit, staring at those fixed glazed eyes, in silence +for a moment, would play, Scrooge felt, the very +deuce with him. There was something very awful, +too, in the spectre's being provided with an infernal +atmosphere of its own. Scrooge could not feel it +himself, but this was clearly the case; for though the +Ghost sat perfectly motionless, its hair, and skirts, +and tassels, were still agitated as by the hot vapour +from an oven. + +"You see this toothpick?" said Scrooge, returning +quickly to the charge, for the reason just assigned; +and wishing, though it were only for a second, to +divert the vision's stony gaze from himself. + +"I do," replied the Ghost. + +"You are not looking at it," said Scrooge. + +"But I see it," said the Ghost, "notwithstanding." + +"Well!" returned Scrooge, "I have but to swallow +this, and be for the rest of my days persecuted by a +legion of goblins, all of my own creation. Humbug, +I tell you! humbug!" + +At this the spirit raised a frightful cry, and shook +its chain with such a dismal and appalling noise, that +Scrooge held on tight to his chair, to save himself +from falling in a swoon. But how much greater was +his horror, when the phantom taking off the bandage +round its head, as if it were too warm to wear indoors, +its lower jaw dropped down upon its breast! + +Scrooge fell upon his knees, and clasped his hands +before his face. + +"Mercy!" he said. "Dreadful apparition, why do +you trouble me?" + +"Man of the worldly mind!" replied the Ghost, "do +you believe in me or not?" + +"I do," said Scrooge. "I must. But why do spirits +walk the earth, and why do they come to me?" + +"It is required of every man," the Ghost returned, +"that the spirit within him should walk abroad among +his fellowmen, and travel far and wide; and if that +spirit goes not forth in life, it is condemned to do so +after death. It is doomed to wander through the +world--oh, woe is me!--and witness what it cannot +share, but might have shared on earth, and turned to +happiness!" + +Again the spectre raised a cry, and shook its chain +and wrung its shadowy hands. + +"You are fettered," said Scrooge, trembling. "Tell +me why?" + +"I wear the chain I forged in life," replied the Ghost. +"I made it link by link, and yard by yard; I girded +it on of my own free will, and of my own free will I +wore it. Is its pattern strange to you?" + +Scrooge trembled more and more. + +"Or would you know," pursued the Ghost, "the +weight and length of the strong coil you bear yourself? +It was full as heavy and as long as this, seven +Christmas Eves ago. You have laboured on it, since. +It is a ponderous chain!" + +Scrooge glanced about him on the floor, in the +expectation of finding himself surrounded by some fifty +or sixty fathoms of iron cable: but he could see +nothing. + +"Jacob," he said, imploringly. "Old Jacob Marley, +tell me more. Speak comfort to me, Jacob!" + +"I have none to give," the Ghost replied. "It comes +from other regions, Ebenezer Scrooge, and is conveyed +by other ministers, to other kinds of men. Nor +can I tell you what I would. A very little more is +all permitted to me. I cannot rest, I cannot stay, I +cannot linger anywhere. My spirit never walked +beyond our counting-house--mark me!--in life my +spirit never roved beyond the narrow limits of our +money-changing hole; and weary journeys lie before +me!" + +It was a habit with Scrooge, whenever he became +thoughtful, to put his hands in his breeches pockets. +Pondering on what the Ghost had said, he did so now, +but without lifting up his eyes, or getting off his +knees. + +"You must have been very slow about it, Jacob," +Scrooge observed, in a business-like manner, though +with humility and deference. + +"Slow!" the Ghost repeated. + +"Seven years dead," mused Scrooge. "And travelling +all the time!" + +"The whole time," said the Ghost. "No rest, no +peace. Incessant torture of remorse." + +"You travel fast?" said Scrooge. + +"On the wings of the wind," replied the Ghost. + +"You might have got over a great quantity of +ground in seven years," said Scrooge. + +The Ghost, on hearing this, set up another cry, and +clanked its chain so hideously in the dead silence of +the night, that the Ward would have been justified in +indicting it for a nuisance. + +"Oh! captive, bound, and double-ironed," cried the +phantom, "not to know, that ages of incessant labour +by immortal creatures, for this earth must pass into +eternity before the good of which it is susceptible is +all developed. Not to know that any Christian spirit +working kindly in its little sphere, whatever it may +be, will find its mortal life too short for its vast +means of usefulness. Not to know that no space of +regret can make amends for one life's opportunity +misused! Yet such was I! Oh! such was I!" + +"But you were always a good man of business, +Jacob," faltered Scrooge, who now began to apply this +to himself. + +"Business!" cried the Ghost, wringing its hands +again. "Mankind was my business. The common +welfare was my business; charity, mercy, forbearance, +and benevolence, were, all, my business. The dealings +of my trade were but a drop of water in the +comprehensive ocean of my business!" + +It held up its chain at arm's length, as if that were +the cause of all its unavailing grief, and flung it +heavily upon the ground again. + +"At this time of the rolling year," the spectre said, +"I suffer most. Why did I walk through crowds of +fellow-beings with my eyes turned down, and never +raise them to that blessed Star which led the Wise +Men to a poor abode! Were there no poor homes to +which its light would have conducted me!" + +Scrooge was very much dismayed to hear the +spectre going on at this rate, and began to quake +exceedingly. + +"Hear me!" cried the Ghost. "My time is nearly +gone." + +"I will," said Scrooge. "But don't be hard upon +me! Don't be flowery, Jacob! Pray!" + +"How it is that I appear before you in a shape that +you can see, I may not tell. I have sat invisible +beside you many and many a day." + +It was not an agreeable idea. Scrooge shivered, +and wiped the perspiration from his brow. + +"That is no light part of my penance," pursued +the Ghost. "I am here to-night to warn you, that you +have yet a chance and hope of escaping my fate. A +chance and hope of my procuring, Ebenezer." + +"You were always a good friend to me," said +Scrooge. "Thank'ee!" + +"You will be haunted," resumed the Ghost, "by +Three Spirits." + +Scrooge's countenance fell almost as low as the +Ghost's had done. + +"Is that the chance and hope you mentioned, +Jacob?" he demanded, in a faltering voice. + +"It is." + +"I--I think I'd rather not," said Scrooge. + +"Without their visits," said the Ghost, "you cannot +hope to shun the path I tread. Expect the first to-morrow, +when the bell tolls One." + +"Couldn't I take 'em all at once, and have it over, +Jacob?" hinted Scrooge. + +"Expect the second on the next night at the same +hour. The third upon the next night when the last +stroke of Twelve has ceased to vibrate. Look to see +me no more; and look that, for your own sake, you +remember what has passed between us!" + +When it had said these words, the spectre took its +wrapper from the table, and bound it round its head, +as before. Scrooge knew this, by the smart sound its +teeth made, when the jaws were brought together +by the bandage. He ventured to raise his eyes again, +and found his supernatural visitor confronting him +in an erect attitude, with its chain wound over and +about its arm. + +The apparition walked backward from him; and at +every step it took, the window raised itself a little, +so that when the spectre reached it, it was wide open. + +It beckoned Scrooge to approach, which he did. +When they were within two paces of each other, +Marley's Ghost held up its hand, warning him to +come no nearer. Scrooge stopped. + +Not so much in obedience, as in surprise and fear: +for on the raising of the hand, he became sensible +of confused noises in the air; incoherent sounds of +lamentation and regret; wailings inexpressibly sorrowful and +self-accusatory. The spectre, after listening for a moment, +joined in the mournful dirge; and floated out upon the +bleak, dark night. + +Scrooge followed to the window: desperate in his +curiosity. He looked out. + +The air was filled with phantoms, wandering hither +and thither in restless haste, and moaning as they +went. Every one of them wore chains like Marley's +Ghost; some few (they might be guilty governments) +were linked together; none were free. Many had +been personally known to Scrooge in their lives. He +had been quite familiar with one old ghost, in a white +waistcoat, with a monstrous iron safe attached to +its ankle, who cried piteously at being unable to assist +a wretched woman with an infant, whom it saw below, +upon a door-step. The misery with them all was, +clearly, that they sought to interfere, for good, in +human matters, and had lost the power for ever. + +Whether these creatures faded into mist, or mist +enshrouded them, he could not tell. But they and +their spirit voices faded together; and the night became +as it had been when he walked home. + +Scrooge closed the window, and examined the door +by which the Ghost had entered. It was double-locked, +as he had locked it with his own hands, and +the bolts were undisturbed. He tried to say "Humbug!" +but stopped at the first syllable. And being, +from the emotion he had undergone, or the fatigues +of the day, or his glimpse of the Invisible World, or +the dull conversation of the Ghost, or the lateness of +the hour, much in need of repose; went straight to +bed, without undressing, and fell asleep upon the +instant. + + +STAVE II: THE FIRST OF THE THREE SPIRITS diff --git a/sandbox/paultremblay/python_interface/test_files/header_footer2.rst b/sandbox/paultremblay/python_interface/test_files/header_footer2.rst new file mode 100644 index 000000000..62f7c1b7e --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/header_footer2.rst @@ -0,0 +1,969 @@ +.. and example of having a different first header than the rest of the body. + +.. role:: page-num + +.. container:: first-header + + first header text + +.. container:: first-footer + + first footer text + +.. container:: body-header + + body header + +.. container:: body-footer + + body footer + + +MARLEY was dead: to begin with. There is no doubt +whatever about that. The register of his burial was +signed by the clergyman, the clerk, the undertaker, +and the chief mourner. Scrooge signed it: and +Scrooge's name was good upon 'Change, for anything he +chose to put his hand to. Old Marley was as dead as a +door-nail. + +Mind! I don't mean to say that I know, of my +own knowledge, what there is particularly dead about +a door-nail. I might have been inclined, myself, to +regard a coffin-nail as the deadest piece of ironmongery +in the trade. But the wisdom of our ancestors +is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that +Marley was as dead as a door-nail. + +Scrooge knew he was dead? Of course he did. +How could it be otherwise? Scrooge and he were +partners for I don't know how many years. Scrooge +was his sole executor, his sole administrator, his sole +assign, his sole residuary legatee, his sole friend, and +sole mourner. And even Scrooge was not so dreadfully +cut up by the sad event, but that he was an excellent +man of business on the very day of the funeral, +and solemnised it with an undoubted bargain. + +The mention of Marley's funeral brings me back to +the point I started from. There is no doubt that Marley +was dead. This must be distinctly understood, or +nothing wonderful can come of the story I am going +to relate. If we were not perfectly convinced that +Hamlet's Father died before the play began, there +would be nothing more remarkable in his taking a +stroll at night, in an easterly wind, upon his own ramparts, +than there would be in any other middle-aged +gentleman rashly turning out after dark in a breezy +spot--say Saint Paul's Churchyard for instance-- +literally to astonish his son's weak mind. + +Scrooge never painted out Old Marley's name. +There it stood, years afterwards, above the warehouse +door: Scrooge and Marley. The firm was known as +Scrooge and Marley. Sometimes people new to the +business called Scrooge Scrooge, and sometimes Marley, +but he answered to both names. It was all the +same to him. + +Oh! But he was a tight-fisted hand at the grind-stone, +Scrooge! a squeezing, wrenching, grasping, scraping, +clutching, covetous, old sinner! Hard and sharp as flint, +from which no steel had ever struck out generous fire; +secret, and self-contained, and solitary as an oyster. The +cold within him froze his old features, nipped his pointed +nose, shrivelled his cheek, stiffened his gait; made his +eyes red, his thin lips blue; and spoke out shrewdly in his +grating voice. A frosty rime was on his head, and on his +eyebrows, and his wiry chin. He carried his own low +temperature always about with him; he iced his office in +the dog-days; and didn't thaw it one degree at Christmas. + +External heat and cold had little influence on +Scrooge. No warmth could warm, no wintry weather +chill him. No wind that blew was bitterer than he, +no falling snow was more intent upon its purpose, no +pelting rain less open to entreaty. Foul weather didn't +know where to have him. The heaviest rain, and +snow, and hail, and sleet, could boast of the advantage +over him in only one respect. They often "came down" +handsomely, and Scrooge never did. + +Nobody ever stopped him in the street to say, with +gladsome looks, "My dear Scrooge, how are you? +When will you come to see me?" No beggars implored +him to bestow a trifle, no children asked him +what it was o'clock, no man or woman ever once in all +his life inquired the way to such and such a place, of +Scrooge. Even the blind men's dogs appeared to +know him; and when they saw him coming on, would +tug their owners into doorways and up courts; and +then would wag their tails as though they said, "No +eye at all is better than an evil eye, dark master!" + +But what did Scrooge care! It was the very thing +he liked. To edge his way along the crowded paths +of life, warning all human sympathy to keep its distance, +was what the knowing ones call "nuts" to Scrooge. + +Once upon a time--of all the good days in the year, +on Christmas Eve--old Scrooge sat busy in his +counting-house. It was cold, bleak, biting weather: foggy +withal: and he could hear the people in the court outside, +go wheezing up and down, beating their hands +upon their breasts, and stamping their feet upon the +pavement stones to warm them. The city clocks had +only just gone three, but it was quite dark already-- +it had not been light all day--and candles were flaring +in the windows of the neighbouring offices, like +ruddy smears upon the palpable brown air. The fog +came pouring in at every chink and keyhole, and was +so dense without, that although the court was of the +narrowest, the houses opposite were mere phantoms. +To see the dingy cloud come drooping down, obscuring +everything, one might have thought that Nature +lived hard by, and was brewing on a large scale. + +The door of Scrooge's counting-house was open +that he might keep his eye upon his clerk, who in a +dismal little cell beyond, a sort of tank, was copying +letters. Scrooge had a very small fire, but the clerk's +fire was so very much smaller that it looked like one +coal. But he couldn't replenish it, for Scrooge kept +the coal-box in his own room; and so surely as the +clerk came in with the shovel, the master predicted +that it would be necessary for them to part. Wherefore +the clerk put on his white comforter, and tried to +warm himself at the candle; in which effort, not being +a man of a strong imagination, he failed. + +"A merry Christmas, uncle! God save you!" cried +a cheerful voice. It was the voice of Scrooge's +nephew, who came upon him so quickly that this was +the first intimation he had of his approach. + +"Bah!" said Scrooge, "Humbug!" + +He had so heated himself with rapid walking in the +fog and frost, this nephew of Scrooge's, that he was +all in a glow; his face was ruddy and handsome; his +eyes sparkled, and his breath smoked again. + +"Christmas a humbug, uncle!" said Scrooge's +nephew. "You don't mean that, I am sure?" + +"I do," said Scrooge. "Merry Christmas! What +right have you to be merry? What reason have you +to be merry? You're poor enough." + +"Come, then," returned the nephew gaily. "What +right have you to be dismal? What reason have you +to be morose? You're rich enough." + +Scrooge having no better answer ready on the spur +of the moment, said, "Bah!" again; and followed it up +with "Humbug." + +"Don't be cross, uncle!" said the nephew. + +"What else can I be," returned the uncle, "when I +live in such a world of fools as this? Merry Christmas! +Out upon merry Christmas! What's Christmas +time to you but a time for paying bills without +money; a time for finding yourself a year older, but +not an hour richer; a time for balancing your books +and having every item in 'em through a round dozen +of months presented dead against you? If I could +work my will," said Scrooge indignantly, "every idiot +who goes about with 'Merry Christmas' on his lips, +should be boiled with his own pudding, and buried +with a stake of holly through his heart. He should!" + +"Uncle!" pleaded the nephew. + +"Nephew!" returned the uncle sternly, "keep Christmas +in your own way, and let me keep it in mine." + +"Keep it!" repeated Scrooge's nephew. "But you +don't keep it." + +"Let me leave it alone, then," said Scrooge. "Much +good may it do you! Much good it has ever done +you!" + +"There are many things from which I might have +derived good, by which I have not profited, I dare +say," returned the nephew. "Christmas among the +rest. But I am sure I have always thought of Christmas +time, when it has come round--apart from the +veneration due to its sacred name and origin, if anything +belonging to it can be apart from that--as a +good time; a kind, forgiving, charitable, pleasant +time; the only time I know of, in the long calendar +of the year, when men and women seem by one consent +to open their shut-up hearts freely, and to think +of people below them as if they really were +fellow-passengers to the grave, and not another race +of creatures bound on other journeys. And therefore, +uncle, though it has never put a scrap of gold or +silver in my pocket, I believe that it has done me +good, and will do me good; and I say, God bless it!" + +The clerk in the Tank involuntarily applauded. +Becoming immediately sensible of the impropriety, +he poked the fire, and extinguished the last frail spark +for ever. + +"Let me hear another sound from you," said +Scrooge, "and you'll keep your Christmas by losing +your situation! You're quite a powerful speaker, +sir," he added, turning to his nephew. "I wonder you +don't go into Parliament." + +"Don't be angry, uncle. Come! Dine with us to-morrow." + +Scrooge said that he would see him--yes, indeed he +did. He went the whole length of the expression, +and said that he would see him in that extremity first. + +"But why?" cried Scrooge's nephew. "Why?" + +"Why did you get married?" said Scrooge. + +"Because I fell in love." + +"Because you fell in love!" growled Scrooge, as if +that were the only one thing in the world more ridiculous +than a merry Christmas. "Good afternoon!" + +"Nay, uncle, but you never came to see me before +that happened. Why give it as a reason for not +coming now?" + +"Good afternoon," said Scrooge. + +"I want nothing from you; I ask nothing of you; +why cannot we be friends?" + +"Good afternoon," said Scrooge. + +"I am sorry, with all my heart, to find you so +resolute. We have never had any quarrel, to which I +have been a party. But I have made the trial in +homage to Christmas, and I'll keep my Christmas +humour to the last. So A Merry Christmas, uncle!" + +"Good afternoon!" said Scrooge. + +"And A Happy New Year!" + +"Good afternoon!" said Scrooge. + +His nephew left the room without an angry word, +notwithstanding. He stopped at the outer door to +bestow the greetings of the season on the clerk, who, +cold as he was, was warmer than Scrooge; for he returned +them cordially. + +"There's another fellow," muttered Scrooge; who +overheard him: "my clerk, with fifteen shillings a +week, and a wife and family, talking about a merry +Christmas. I'll retire to Bedlam." + +This lunatic, in letting Scrooge's nephew out, had +let two other people in. They were portly gentlemen, +pleasant to behold, and now stood, with their hats off, +in Scrooge's office. They had books and papers in +their hands, and bowed to him. + +"Scrooge and Marley's, I believe," said one of the +gentlemen, referring to his list. "Have I the pleasure +of addressing Mr. Scrooge, or Mr. Marley?" + +"Mr. Marley has been dead these seven years," +Scrooge replied. "He died seven years ago, this very +night." + +"We have no doubt his liberality is well represented +by his surviving partner," said the gentleman, presenting +his credentials. + +It certainly was; for they had been two kindred +spirits. At the ominous word "liberality," Scrooge +frowned, and shook his head, and handed the credentials +back. + +"At this festive season of the year, Mr. Scrooge," +said the gentleman, taking up a pen, "it is more than +usually desirable that we should make some slight +provision for the Poor and destitute, who suffer +greatly at the present time. Many thousands are in +want of common necessaries; hundreds of thousands +are in want of common comforts, sir." + +"Are there no prisons?" asked Scrooge. + +"Plenty of prisons," said the gentleman, laying down +the pen again. + +"And the Union workhouses?" demanded Scrooge. +"Are they still in operation?" + +"They are. Still," returned the gentleman, "I wish +I could say they were not." + +"The Treadmill and the Poor Law are in full vigour, +then?" said Scrooge. + +"Both very busy, sir." + +"Oh! I was afraid, from what you said at first, +that something had occurred to stop them in their +useful course," said Scrooge. "I'm very glad to +hear it." + +"Under the impression that they scarcely furnish +Christian cheer of mind or body to the multitude," +returned the gentleman, "a few of us are endeavouring +to raise a fund to buy the Poor some meat and drink, +and means of warmth. We choose this time, because +it is a time, of all others, when Want is keenly felt, +and Abundance rejoices. What shall I put you down +for?" + +"Nothing!" Scrooge replied. + +"You wish to be anonymous?" + +"I wish to be left alone," said Scrooge. "Since you +ask me what I wish, gentlemen, that is my answer. +I don't make merry myself at Christmas and I can't +afford to make idle people merry. I help to support +the establishments I have mentioned--they cost +enough; and those who are badly off must go there." + +"Many can't go there; and many would rather die." + +"If they would rather die," said Scrooge, "they had +better do it, and decrease the surplus population. +Besides--excuse me--I don't know that." + +"But you might know it," observed the gentleman. + +"It's not my business," Scrooge returned. "It's +enough for a man to understand his own business, and +not to interfere with other people's. Mine occupies +me constantly. Good afternoon, gentlemen!" + +Seeing clearly that it would be useless to pursue +their point, the gentlemen withdrew. Scrooge resumed +his labours with an improved opinion of himself, +and in a more facetious temper than was usual +with him. + +Meanwhile the fog and darkness thickened so, that +people ran about with flaring links, proffering their +services to go before horses in carriages, and conduct +them on their way. The ancient tower of a church, +whose gruff old bell was always peeping slily down +at Scrooge out of a Gothic window in the wall, became +invisible, and struck the hours and quarters in the +clouds, with tremulous vibrations afterwards as if +its teeth were chattering in its frozen head up there. +The cold became intense. In the main street, at the +corner of the court, some labourers were repairing +the gas-pipes, and had lighted a great fire in a brazier, +round which a party of ragged men and boys were +gathered: warming their hands and winking their +eyes before the blaze in rapture. The water-plug +being left in solitude, its overflowings sullenly congealed, +and turned to misanthropic ice. The brightness +of the shops where holly sprigs and berries +crackled in the lamp heat of the windows, made pale +faces ruddy as they passed. Poulterers' and grocers' +trades became a splendid joke: a glorious pageant, +with which it was next to impossible to believe that +such dull principles as bargain and sale had anything +to do. The Lord Mayor, in the stronghold of the +mighty Mansion House, gave orders to his fifty cooks +and butlers to keep Christmas as a Lord Mayor's +household should; and even the little tailor, whom he +had fined five shillings on the previous Monday for +being drunk and bloodthirsty in the streets, stirred up +to-morrow's pudding in his garret, while his lean +wife and the baby sallied out to buy the beef. + +Foggier yet, and colder. Piercing, searching, biting +cold. If the good Saint Dunstan had but nipped +the Evil Spirit's nose with a touch of such weather +as that, instead of using his familiar weapons, then +indeed he would have roared to lusty purpose. The +owner of one scant young nose, gnawed and mumbled +by the hungry cold as bones are gnawed by dogs, +stooped down at Scrooge's keyhole to regale him with +a Christmas carol: but at the first sound of + +.. text ommitted here + +.. "God bless you, merry gentleman! +.. May nothing you dismay!" + +Scrooge seized the ruler with such energy of action, +that the singer fled in terror, leaving the keyhole to +the fog and even more congenial frost. + +At length the hour of shutting up the counting-house +arrived. With an ill-will Scrooge dismounted from his +stool, and tacitly admitted the fact to the expectant +clerk in the Tank, who instantly snuffed his candle out, +and put on his hat. + +"You'll want all day to-morrow, I suppose?" said +Scrooge. + +"If quite convenient, sir." + +"It's not convenient," said Scrooge, "and it's not +fair. If I was to stop half-a-crown for it, you'd +think yourself ill-used, I'll be bound?" + +The clerk smiled faintly. + +"And yet," said Scrooge, "you don't think me ill-used, +when I pay a day's wages for no work." + +The clerk observed that it was only once a year. + +"A poor excuse for picking a man's pocket every +twenty-fifth of December!" said Scrooge, buttoning +his great-coat to the chin. "But I suppose you must +have the whole day. Be here all the earlier next +morning." + +The clerk promised that he would; and Scrooge +walked out with a growl. The office was closed in a +twinkling, and the clerk, with the long ends of his +white comforter dangling below his waist (for he +boasted no great-coat), went down a slide on Cornhill, +at the end of a lane of boys, twenty times, in +honour of its being Christmas Eve, and then ran home +to Camden Town as hard as he could pelt, to play +at blindman's-buff. + +Scrooge took his melancholy dinner in his usual +melancholy tavern; and having read all the newspapers, and +beguiled the rest of the evening with his +banker's-book, went home to bed. He lived in +chambers which had once belonged to his deceased +partner. They were a gloomy suite of rooms, in a +lowering pile of building up a yard, where it had so +little business to be, that one could scarcely help +fancying it must have run there when it was a young +house, playing at hide-and-seek with other houses, +and forgotten the way out again. It was old enough +now, and dreary enough, for nobody lived in it but +Scrooge, the other rooms being all let out as offices. +The yard was so dark that even Scrooge, who knew +its every stone, was fain to grope with his hands. +The fog and frost so hung about the black old gateway +of the house, that it seemed as if the Genius of +the Weather sat in mournful meditation on the +threshold. + +Now, it is a fact, that there was nothing at all +particular about the knocker on the door, except that it +was very large. It is also a fact, that Scrooge had +seen it, night and morning, during his whole residence +in that place; also that Scrooge had as little of what +is called fancy about him as any man in the city of +London, even including--which is a bold word--the +corporation, aldermen, and livery. Let it also be +borne in mind that Scrooge had not bestowed one +thought on Marley, since his last mention of his +seven years' dead partner that afternoon. And then +let any man explain to me, if he can, how it happened +that Scrooge, having his key in the lock of the door, +saw in the knocker, without its undergoing any intermediate +process of change--not a knocker, but Marley's face. + +Marley's face. It was not in impenetrable shadow +as the other objects in the yard were, but had a +dismal light about it, like a bad lobster in a dark +cellar. It was not angry or ferocious, but looked +at Scrooge as Marley used to look: with ghostly +spectacles turned up on its ghostly forehead. The +hair was curiously stirred, as if by breath or hot air; +and, though the eyes were wide open, they were perfectly +motionless. That, and its livid colour, made it +horrible; but its horror seemed to be in spite of the +face and beyond its control, rather than a part of +its own expression. + +As Scrooge looked fixedly at this phenomenon, it +was a knocker again. + +To say that he was not startled, or that his blood +was not conscious of a terrible sensation to which it +had been a stranger from infancy, would be untrue. +But he put his hand upon the key he had relinquished, +turned it sturdily, walked in, and lighted his candle. + +He did pause, with a moment's irresolution, before +he shut the door; and he did look cautiously behind +it first, as if he half expected to be terrified with the +sight of Marley's pigtail sticking out into the hall. +But there was nothing on the back of the door, except +the screws and nuts that held the knocker on, so he +said "Pooh, pooh!" and closed it with a bang. + +The sound resounded through the house like thunder. +Every room above, and every cask in the wine-merchant's +cellars below, appeared to have a separate peal +of echoes of its own. Scrooge was not a man to +be frightened by echoes. He fastened the door, and +walked across the hall, and up the stairs; slowly too: +trimming his candle as he went. + +You may talk vaguely about driving a coach-and-six +up a good old flight of stairs, or through a bad +young Act of Parliament; but I mean to say you +might have got a hearse up that staircase, and taken +it broadwise, with the splinter-bar towards the wall +and the door towards the balustrades: and done it +easy. There was plenty of width for that, and room +to spare; which is perhaps the reason why Scrooge +thought he saw a locomotive hearse going on before +him in the gloom. Half-a-dozen gas-lamps out of +the street wouldn't have lighted the entry too well, +so you may suppose that it was pretty dark with +Scrooge's dip. + +Up Scrooge went, not caring a button for that. +Darkness is cheap, and Scrooge liked it. But before +he shut his heavy door, he walked through his rooms +to see that all was right. He had just enough recollection +of the face to desire to do that. + +Sitting-room, bedroom, lumber-room. All as they +should be. Nobody under the table, nobody under +the sofa; a small fire in the grate; spoon and basin +ready; and the little saucepan of gruel (Scrooge had +a cold in his head) upon the hob. Nobody under the +bed; nobody in the closet; nobody in his dressing-gown, +which was hanging up in a suspicious attitude +against the wall. Lumber-room as usual. Old fire-guard, +old shoes, two fish-baskets, washing-stand on three +legs, and a poker. + +Quite satisfied, he closed his door, and locked +himself in; double-locked himself in, which was not his +custom. Thus secured against surprise, he took off +his cravat; put on his dressing-gown and slippers, and +his nightcap; and sat down before the fire to take +his gruel. + +It was a very low fire indeed; nothing on such a +bitter night. He was obliged to sit close to it, and +brood over it, before he could extract the least +sensation of warmth from such a handful of fuel. +The fireplace was an old one, built by some Dutch +merchant long ago, and paved all round with quaint +Dutch tiles, designed to illustrate the Scriptures. +There were Cains and Abels, Pharaoh's daughters; +Queens of Sheba, Angelic messengers descending +through the air on clouds like feather-beds, Abrahams, +Belshazzars, Apostles putting off to sea in butter-boats, +hundreds of figures to attract his thoughts; +and yet that face of Marley, seven years dead, came +like the ancient Prophet's rod, and swallowed up the +whole. If each smooth tile had been a blank at first, +with power to shape some picture on its surface from +the disjointed fragments of his thoughts, there would +have been a copy of old Marley's head on every one. + +"Humbug!" said Scrooge; and walked across the +room. + +After several turns, he sat down again. As he +threw his head back in the chair, his glance happened +to rest upon a bell, a disused bell, that hung in the +room, and communicated for some purpose now forgotten +with a chamber in the highest story of the +building. It was with great astonishment, and with +a strange, inexplicable dread, that as he looked, he +saw this bell begin to swing. It swung so softly in +the outset that it scarcely made a sound; but soon it +rang out loudly, and so did every bell in the house. + +This might have lasted half a minute, or a minute, +but it seemed an hour. The bells ceased as they had +begun, together. They were succeeded by a clanking +noise, deep down below; as if some person were +dragging a heavy chain over the casks in the +wine-merchant's cellar. Scrooge then remembered to have +heard that ghosts in haunted houses were described as +dragging chains. + +The cellar-door flew open with a booming sound, +and then he heard the noise much louder, on the floors +below; then coming up the stairs; then coming straight +towards his door. + +"It's humbug still!" said Scrooge. "I won't believe it." + +His colour changed though, when, without a pause, +it came on through the heavy door, and passed into +the room before his eyes. Upon its coming in, the +dying flame leaped up, as though it cried, "I know +him; Marley's Ghost!" and fell again. + +The same face: the very same. Marley in his pigtail, +usual waistcoat, tights and boots; the tassels on +the latter bristling, like his pigtail, and his coat-skirts, +and the hair upon his head. The chain he drew was +clasped about his middle. It was long, and wound +about him like a tail; and it was made (for Scrooge +observed it closely) of cash-boxes, keys, padlocks, +ledgers, deeds, and heavy purses wrought in steel. +His body was transparent; so that Scrooge, observing him, +and looking through his waistcoat, could see +the two buttons on his coat behind. + +Scrooge had often heard it said that Marley had no +bowels, but he had never believed it until now. + +No, nor did he believe it even now. Though he +looked the phantom through and through, and saw +it standing before him; though he felt the chilling +influence of its death-cold eyes; and marked the very +texture of the folded kerchief bound about its head +and chin, which wrapper he had not observed before; +he was still incredulous, and fought against his senses. + +"How now!" said Scrooge, caustic and cold as ever. +"What do you want with me?" + +"Much!"--Marley's voice, no doubt about it. + +"Who are you?" + +"Ask me who I was." + +"Who were you then?" said Scrooge, raising his +voice. "You're particular, for a shade." He was going +to say "to a shade," but substituted this, as more +appropriate. + +"In life I was your partner, Jacob Marley." + +"Can you--can you sit down?" asked Scrooge, looking +doubtfully at him. + +"I can." + +"Do it, then." + +Scrooge asked the question, because he didn't know +whether a ghost so transparent might find himself in +a condition to take a chair; and felt that in the event +of its being impossible, it might involve the necessity +of an embarrassing explanation. But the ghost sat +down on the opposite side of the fireplace, as if he +were quite used to it. + +"You don't believe in me," observed the Ghost. + +"I don't," said Scrooge. + +"What evidence would you have of my reality beyond that of +your senses?" + +"I don't know," said Scrooge. + +"Why do you doubt your senses?" + +"Because," said Scrooge, "a little thing affects them. +A slight disorder of the stomach makes them cheats. You may +be an undigested bit of beef, a blot of mustard, a crumb of +cheese, a fragment of an underdone potato. There's more of +gravy than of grave about you, whatever you are!" + +Scrooge was not much in the habit of cracking +jokes, nor did he feel, in his heart, by any means +waggish then. The truth is, that he tried to be +smart, as a means of distracting his own attention, +and keeping down his terror; for the spectre's voice +disturbed the very marrow in his bones. + +To sit, staring at those fixed glazed eyes, in silence +for a moment, would play, Scrooge felt, the very +deuce with him. There was something very awful, +too, in the spectre's being provided with an infernal +atmosphere of its own. Scrooge could not feel it +himself, but this was clearly the case; for though the +Ghost sat perfectly motionless, its hair, and skirts, +and tassels, were still agitated as by the hot vapour +from an oven. + +"You see this toothpick?" said Scrooge, returning +quickly to the charge, for the reason just assigned; +and wishing, though it were only for a second, to +divert the vision's stony gaze from himself. + +"I do," replied the Ghost. + +"You are not looking at it," said Scrooge. + +"But I see it," said the Ghost, "notwithstanding." + +"Well!" returned Scrooge, "I have but to swallow +this, and be for the rest of my days persecuted by a +legion of goblins, all of my own creation. Humbug, +I tell you! humbug!" + +At this the spirit raised a frightful cry, and shook +its chain with such a dismal and appalling noise, that +Scrooge held on tight to his chair, to save himself +from falling in a swoon. But how much greater was +his horror, when the phantom taking off the bandage +round its head, as if it were too warm to wear indoors, +its lower jaw dropped down upon its breast! + +Scrooge fell upon his knees, and clasped his hands +before his face. + +"Mercy!" he said. "Dreadful apparition, why do +you trouble me?" + +"Man of the worldly mind!" replied the Ghost, "do +you believe in me or not?" + +"I do," said Scrooge. "I must. But why do spirits +walk the earth, and why do they come to me?" + +"It is required of every man," the Ghost returned, +"that the spirit within him should walk abroad among +his fellowmen, and travel far and wide; and if that +spirit goes not forth in life, it is condemned to do so +after death. It is doomed to wander through the +world--oh, woe is me!--and witness what it cannot +share, but might have shared on earth, and turned to +happiness!" + +Again the spectre raised a cry, and shook its chain +and wrung its shadowy hands. + +"You are fettered," said Scrooge, trembling. "Tell +me why?" + +"I wear the chain I forged in life," replied the Ghost. +"I made it link by link, and yard by yard; I girded +it on of my own free will, and of my own free will I +wore it. Is its pattern strange to you?" + +Scrooge trembled more and more. + +"Or would you know," pursued the Ghost, "the +weight and length of the strong coil you bear yourself? +It was full as heavy and as long as this, seven +Christmas Eves ago. You have laboured on it, since. +It is a ponderous chain!" + +Scrooge glanced about him on the floor, in the +expectation of finding himself surrounded by some fifty +or sixty fathoms of iron cable: but he could see +nothing. + +"Jacob," he said, imploringly. "Old Jacob Marley, +tell me more. Speak comfort to me, Jacob!" + +"I have none to give," the Ghost replied. "It comes +from other regions, Ebenezer Scrooge, and is conveyed +by other ministers, to other kinds of men. Nor +can I tell you what I would. A very little more is +all permitted to me. I cannot rest, I cannot stay, I +cannot linger anywhere. My spirit never walked +beyond our counting-house--mark me!--in life my +spirit never roved beyond the narrow limits of our +money-changing hole; and weary journeys lie before +me!" + +It was a habit with Scrooge, whenever he became +thoughtful, to put his hands in his breeches pockets. +Pondering on what the Ghost had said, he did so now, +but without lifting up his eyes, or getting off his +knees. + +"You must have been very slow about it, Jacob," +Scrooge observed, in a business-like manner, though +with humility and deference. + +"Slow!" the Ghost repeated. + +"Seven years dead," mused Scrooge. "And travelling +all the time!" + +"The whole time," said the Ghost. "No rest, no +peace. Incessant torture of remorse." + +"You travel fast?" said Scrooge. + +"On the wings of the wind," replied the Ghost. + +"You might have got over a great quantity of +ground in seven years," said Scrooge. + +The Ghost, on hearing this, set up another cry, and +clanked its chain so hideously in the dead silence of +the night, that the Ward would have been justified in +indicting it for a nuisance. + +"Oh! captive, bound, and double-ironed," cried the +phantom, "not to know, that ages of incessant labour +by immortal creatures, for this earth must pass into +eternity before the good of which it is susceptible is +all developed. Not to know that any Christian spirit +working kindly in its little sphere, whatever it may +be, will find its mortal life too short for its vast +means of usefulness. Not to know that no space of +regret can make amends for one life's opportunity +misused! Yet such was I! Oh! such was I!" + +"But you were always a good man of business, +Jacob," faltered Scrooge, who now began to apply this +to himself. + +"Business!" cried the Ghost, wringing its hands +again. "Mankind was my business. The common +welfare was my business; charity, mercy, forbearance, +and benevolence, were, all, my business. The dealings +of my trade were but a drop of water in the +comprehensive ocean of my business!" + +It held up its chain at arm's length, as if that were +the cause of all its unavailing grief, and flung it +heavily upon the ground again. + +"At this time of the rolling year," the spectre said, +"I suffer most. Why did I walk through crowds of +fellow-beings with my eyes turned down, and never +raise them to that blessed Star which led the Wise +Men to a poor abode! Were there no poor homes to +which its light would have conducted me!" + +Scrooge was very much dismayed to hear the +spectre going on at this rate, and began to quake +exceedingly. + +"Hear me!" cried the Ghost. "My time is nearly +gone." + +"I will," said Scrooge. "But don't be hard upon +me! Don't be flowery, Jacob! Pray!" + +"How it is that I appear before you in a shape that +you can see, I may not tell. I have sat invisible +beside you many and many a day." + +It was not an agreeable idea. Scrooge shivered, +and wiped the perspiration from his brow. + +"That is no light part of my penance," pursued +the Ghost. "I am here to-night to warn you, that you +have yet a chance and hope of escaping my fate. A +chance and hope of my procuring, Ebenezer." + +"You were always a good friend to me," said +Scrooge. "Thank'ee!" + +"You will be haunted," resumed the Ghost, "by +Three Spirits." + +Scrooge's countenance fell almost as low as the +Ghost's had done. + +"Is that the chance and hope you mentioned, +Jacob?" he demanded, in a faltering voice. + +"It is." + +"I--I think I'd rather not," said Scrooge. + +"Without their visits," said the Ghost, "you cannot +hope to shun the path I tread. Expect the first to-morrow, +when the bell tolls One." + +"Couldn't I take 'em all at once, and have it over, +Jacob?" hinted Scrooge. + +"Expect the second on the next night at the same +hour. The third upon the next night when the last +stroke of Twelve has ceased to vibrate. Look to see +me no more; and look that, for your own sake, you +remember what has passed between us!" + +When it had said these words, the spectre took its +wrapper from the table, and bound it round its head, +as before. Scrooge knew this, by the smart sound its +teeth made, when the jaws were brought together +by the bandage. He ventured to raise his eyes again, +and found his supernatural visitor confronting him +in an erect attitude, with its chain wound over and +about its arm. + +The apparition walked backward from him; and at +every step it took, the window raised itself a little, +so that when the spectre reached it, it was wide open. + +It beckoned Scrooge to approach, which he did. +When they were within two paces of each other, +Marley's Ghost held up its hand, warning him to +come no nearer. Scrooge stopped. + +Not so much in obedience, as in surprise and fear: +for on the raising of the hand, he became sensible +of confused noises in the air; incoherent sounds of +lamentation and regret; wailings inexpressibly sorrowful and +self-accusatory. The spectre, after listening for a moment, +joined in the mournful dirge; and floated out upon the +bleak, dark night. + +Scrooge followed to the window: desperate in his +curiosity. He looked out. + +The air was filled with phantoms, wandering hither +and thither in restless haste, and moaning as they +went. Every one of them wore chains like Marley's +Ghost; some few (they might be guilty governments) +were linked together; none were free. Many had +been personally known to Scrooge in their lives. He +had been quite familiar with one old ghost, in a white +waistcoat, with a monstrous iron safe attached to +its ankle, who cried piteously at being unable to assist +a wretched woman with an infant, whom it saw below, +upon a door-step. The misery with them all was, +clearly, that they sought to interfere, for good, in +human matters, and had lost the power for ever. + +Whether these creatures faded into mist, or mist +enshrouded them, he could not tell. But they and +their spirit voices faded together; and the night became +as it had been when he walked home. + +Scrooge closed the window, and examined the door +by which the Ghost had entered. It was double-locked, +as he had locked it with his own hands, and +the bolts were undisturbed. He tried to say "Humbug!" +but stopped at the first syllable. And being, +from the emotion he had undergone, or the fatigues +of the day, or his glimpse of the Invisible World, or +the dull conversation of the Ghost, or the lateness of +the hour, much in need of repose; went straight to +bed, without undressing, and fell asleep upon the +instant. + + +STAVE II: THE FIRST OF THE THREE SPIRITS + diff --git a/sandbox/paultremblay/python_interface/test_files/header_footer3.rst b/sandbox/paultremblay/python_interface/test_files/header_footer3.rst new file mode 100644 index 000000000..ed3bcd7a7 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/header_footer3.rst @@ -0,0 +1,976 @@ +.. an example of having different headers on odd, even, and firt page + +.. role:: page-num + +.. container:: first-header + + first header text + +.. container:: first-footer + + first footer text + +.. container:: odd-header + + odd header + +.. container:: odd-footer + + odd footer + +.. container:: even-header + + even header + +.. container:: even-footer + + even footer + +MARLEY was dead: to begin with. There is no doubt +whatever about that. The register of his burial was +signed by the clergyman, the clerk, the undertaker, +and the chief mourner. Scrooge signed it: and +Scrooge's name was good upon 'Change, for anything he +chose to put his hand to. Old Marley was as dead as a +door-nail. + +Mind! I don't mean to say that I know, of my +own knowledge, what there is particularly dead about +a door-nail. I might have been inclined, myself, to +regard a coffin-nail as the deadest piece of ironmongery +in the trade. But the wisdom of our ancestors +is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that +Marley was as dead as a door-nail. + +Scrooge knew he was dead? Of course he did. +How could it be otherwise? Scrooge and he were +partners for I don't know how many years. Scrooge +was his sole executor, his sole administrator, his sole +assign, his sole residuary legatee, his sole friend, and +sole mourner. And even Scrooge was not so dreadfully +cut up by the sad event, but that he was an excellent +man of business on the very day of the funeral, +and solemnised it with an undoubted bargain. + +The mention of Marley's funeral brings me back to +the point I started from. There is no doubt that Marley +was dead. This must be distinctly understood, or +nothing wonderful can come of the story I am going +to relate. If we were not perfectly convinced that +Hamlet's Father died before the play began, there +would be nothing more remarkable in his taking a +stroll at night, in an easterly wind, upon his own ramparts, +than there would be in any other middle-aged +gentleman rashly turning out after dark in a breezy +spot--say Saint Paul's Churchyard for instance-- +literally to astonish his son's weak mind. + +Scrooge never painted out Old Marley's name. +There it stood, years afterwards, above the warehouse +door: Scrooge and Marley. The firm was known as +Scrooge and Marley. Sometimes people new to the +business called Scrooge Scrooge, and sometimes Marley, +but he answered to both names. It was all the +same to him. + +Oh! But he was a tight-fisted hand at the grind-stone, +Scrooge! a squeezing, wrenching, grasping, scraping, +clutching, covetous, old sinner! Hard and sharp as flint, +from which no steel had ever struck out generous fire; +secret, and self-contained, and solitary as an oyster. The +cold within him froze his old features, nipped his pointed +nose, shrivelled his cheek, stiffened his gait; made his +eyes red, his thin lips blue; and spoke out shrewdly in his +grating voice. A frosty rime was on his head, and on his +eyebrows, and his wiry chin. He carried his own low +temperature always about with him; he iced his office in +the dog-days; and didn't thaw it one degree at Christmas. + +External heat and cold had little influence on +Scrooge. No warmth could warm, no wintry weather +chill him. No wind that blew was bitterer than he, +no falling snow was more intent upon its purpose, no +pelting rain less open to entreaty. Foul weather didn't +know where to have him. The heaviest rain, and +snow, and hail, and sleet, could boast of the advantage +over him in only one respect. They often "came down" +handsomely, and Scrooge never did. + +Nobody ever stopped him in the street to say, with +gladsome looks, "My dear Scrooge, how are you? +When will you come to see me?" No beggars implored +him to bestow a trifle, no children asked him +what it was o'clock, no man or woman ever once in all +his life inquired the way to such and such a place, of +Scrooge. Even the blind men's dogs appeared to +know him; and when they saw him coming on, would +tug their owners into doorways and up courts; and +then would wag their tails as though they said, "No +eye at all is better than an evil eye, dark master!" + +But what did Scrooge care! It was the very thing +he liked. To edge his way along the crowded paths +of life, warning all human sympathy to keep its distance, +was what the knowing ones call "nuts" to Scrooge. + +Once upon a time--of all the good days in the year, +on Christmas Eve--old Scrooge sat busy in his +counting-house. It was cold, bleak, biting weather: foggy +withal: and he could hear the people in the court outside, +go wheezing up and down, beating their hands +upon their breasts, and stamping their feet upon the +pavement stones to warm them. The city clocks had +only just gone three, but it was quite dark already-- +it had not been light all day--and candles were flaring +in the windows of the neighbouring offices, like +ruddy smears upon the palpable brown air. The fog +came pouring in at every chink and keyhole, and was +so dense without, that although the court was of the +narrowest, the houses opposite were mere phantoms. +To see the dingy cloud come drooping down, obscuring +everything, one might have thought that Nature +lived hard by, and was brewing on a large scale. + +The door of Scrooge's counting-house was open +that he might keep his eye upon his clerk, who in a +dismal little cell beyond, a sort of tank, was copying +letters. Scrooge had a very small fire, but the clerk's +fire was so very much smaller that it looked like one +coal. But he couldn't replenish it, for Scrooge kept +the coal-box in his own room; and so surely as the +clerk came in with the shovel, the master predicted +that it would be necessary for them to part. Wherefore +the clerk put on his white comforter, and tried to +warm himself at the candle; in which effort, not being +a man of a strong imagination, he failed. + +"A merry Christmas, uncle! God save you!" cried +a cheerful voice. It was the voice of Scrooge's +nephew, who came upon him so quickly that this was +the first intimation he had of his approach. + +"Bah!" said Scrooge, "Humbug!" + +He had so heated himself with rapid walking in the +fog and frost, this nephew of Scrooge's, that he was +all in a glow; his face was ruddy and handsome; his +eyes sparkled, and his breath smoked again. + +"Christmas a humbug, uncle!" said Scrooge's +nephew. "You don't mean that, I am sure?" + +"I do," said Scrooge. "Merry Christmas! What +right have you to be merry? What reason have you +to be merry? You're poor enough." + +"Come, then," returned the nephew gaily. "What +right have you to be dismal? What reason have you +to be morose? You're rich enough." + +Scrooge having no better answer ready on the spur +of the moment, said, "Bah!" again; and followed it up +with "Humbug." + +"Don't be cross, uncle!" said the nephew. + +"What else can I be," returned the uncle, "when I +live in such a world of fools as this? Merry Christmas! +Out upon merry Christmas! What's Christmas +time to you but a time for paying bills without +money; a time for finding yourself a year older, but +not an hour richer; a time for balancing your books +and having every item in 'em through a round dozen +of months presented dead against you? If I could +work my will," said Scrooge indignantly, "every idiot +who goes about with 'Merry Christmas' on his lips, +should be boiled with his own pudding, and buried +with a stake of holly through his heart. He should!" + +"Uncle!" pleaded the nephew. + +"Nephew!" returned the uncle sternly, "keep Christmas +in your own way, and let me keep it in mine." + +"Keep it!" repeated Scrooge's nephew. "But you +don't keep it." + +"Let me leave it alone, then," said Scrooge. "Much +good may it do you! Much good it has ever done +you!" + +"There are many things from which I might have +derived good, by which I have not profited, I dare +say," returned the nephew. "Christmas among the +rest. But I am sure I have always thought of Christmas +time, when it has come round--apart from the +veneration due to its sacred name and origin, if anything +belonging to it can be apart from that--as a +good time; a kind, forgiving, charitable, pleasant +time; the only time I know of, in the long calendar +of the year, when men and women seem by one consent +to open their shut-up hearts freely, and to think +of people below them as if they really were +fellow-passengers to the grave, and not another race +of creatures bound on other journeys. And therefore, +uncle, though it has never put a scrap of gold or +silver in my pocket, I believe that it has done me +good, and will do me good; and I say, God bless it!" + +The clerk in the Tank involuntarily applauded. +Becoming immediately sensible of the impropriety, +he poked the fire, and extinguished the last frail spark +for ever. + +"Let me hear another sound from you," said +Scrooge, "and you'll keep your Christmas by losing +your situation! You're quite a powerful speaker, +sir," he added, turning to his nephew. "I wonder you +don't go into Parliament." + +"Don't be angry, uncle. Come! Dine with us to-morrow." + +Scrooge said that he would see him--yes, indeed he +did. He went the whole length of the expression, +and said that he would see him in that extremity first. + +"But why?" cried Scrooge's nephew. "Why?" + +"Why did you get married?" said Scrooge. + +"Because I fell in love." + +"Because you fell in love!" growled Scrooge, as if +that were the only one thing in the world more ridiculous +than a merry Christmas. "Good afternoon!" + +"Nay, uncle, but you never came to see me before +that happened. Why give it as a reason for not +coming now?" + +"Good afternoon," said Scrooge. + +"I want nothing from you; I ask nothing of you; +why cannot we be friends?" + +"Good afternoon," said Scrooge. + +"I am sorry, with all my heart, to find you so +resolute. We have never had any quarrel, to which I +have been a party. But I have made the trial in +homage to Christmas, and I'll keep my Christmas +humour to the last. So A Merry Christmas, uncle!" + +"Good afternoon!" said Scrooge. + +"And A Happy New Year!" + +"Good afternoon!" said Scrooge. + +His nephew left the room without an angry word, +notwithstanding. He stopped at the outer door to +bestow the greetings of the season on the clerk, who, +cold as he was, was warmer than Scrooge; for he returned +them cordially. + +"There's another fellow," muttered Scrooge; who +overheard him: "my clerk, with fifteen shillings a +week, and a wife and family, talking about a merry +Christmas. I'll retire to Bedlam." + +This lunatic, in letting Scrooge's nephew out, had +let two other people in. They were portly gentlemen, +pleasant to behold, and now stood, with their hats off, +in Scrooge's office. They had books and papers in +their hands, and bowed to him. + +"Scrooge and Marley's, I believe," said one of the +gentlemen, referring to his list. "Have I the pleasure +of addressing Mr. Scrooge, or Mr. Marley?" + +"Mr. Marley has been dead these seven years," +Scrooge replied. "He died seven years ago, this very +night." + +"We have no doubt his liberality is well represented +by his surviving partner," said the gentleman, presenting +his credentials. + +It certainly was; for they had been two kindred +spirits. At the ominous word "liberality," Scrooge +frowned, and shook his head, and handed the credentials +back. + +"At this festive season of the year, Mr. Scrooge," +said the gentleman, taking up a pen, "it is more than +usually desirable that we should make some slight +provision for the Poor and destitute, who suffer +greatly at the present time. Many thousands are in +want of common necessaries; hundreds of thousands +are in want of common comforts, sir." + +"Are there no prisons?" asked Scrooge. + +"Plenty of prisons," said the gentleman, laying down +the pen again. + +"And the Union workhouses?" demanded Scrooge. +"Are they still in operation?" + +"They are. Still," returned the gentleman, "I wish +I could say they were not." + +"The Treadmill and the Poor Law are in full vigour, +then?" said Scrooge. + +"Both very busy, sir." + +"Oh! I was afraid, from what you said at first, +that something had occurred to stop them in their +useful course," said Scrooge. "I'm very glad to +hear it." + +"Under the impression that they scarcely furnish +Christian cheer of mind or body to the multitude," +returned the gentleman, "a few of us are endeavouring +to raise a fund to buy the Poor some meat and drink, +and means of warmth. We choose this time, because +it is a time, of all others, when Want is keenly felt, +and Abundance rejoices. What shall I put you down +for?" + +"Nothing!" Scrooge replied. + +"You wish to be anonymous?" + +"I wish to be left alone," said Scrooge. "Since you +ask me what I wish, gentlemen, that is my answer. +I don't make merry myself at Christmas and I can't +afford to make idle people merry. I help to support +the establishments I have mentioned--they cost +enough; and those who are badly off must go there." + +"Many can't go there; and many would rather die." + +"If they would rather die," said Scrooge, "they had +better do it, and decrease the surplus population. +Besides--excuse me--I don't know that." + +"But you might know it," observed the gentleman. + +"It's not my business," Scrooge returned. "It's +enough for a man to understand his own business, and +not to interfere with other people's. Mine occupies +me constantly. Good afternoon, gentlemen!" + +Seeing clearly that it would be useless to pursue +their point, the gentlemen withdrew. Scrooge resumed +his labours with an improved opinion of himself, +and in a more facetious temper than was usual +with him. + +Meanwhile the fog and darkness thickened so, that +people ran about with flaring links, proffering their +services to go before horses in carriages, and conduct +them on their way. The ancient tower of a church, +whose gruff old bell was always peeping slily down +at Scrooge out of a Gothic window in the wall, became +invisible, and struck the hours and quarters in the +clouds, with tremulous vibrations afterwards as if +its teeth were chattering in its frozen head up there. +The cold became intense. In the main street, at the +corner of the court, some labourers were repairing +the gas-pipes, and had lighted a great fire in a brazier, +round which a party of ragged men and boys were +gathered: warming their hands and winking their +eyes before the blaze in rapture. The water-plug +being left in solitude, its overflowings sullenly congealed, +and turned to misanthropic ice. The brightness +of the shops where holly sprigs and berries +crackled in the lamp heat of the windows, made pale +faces ruddy as they passed. Poulterers' and grocers' +trades became a splendid joke: a glorious pageant, +with which it was next to impossible to believe that +such dull principles as bargain and sale had anything +to do. The Lord Mayor, in the stronghold of the +mighty Mansion House, gave orders to his fifty cooks +and butlers to keep Christmas as a Lord Mayor's +household should; and even the little tailor, whom he +had fined five shillings on the previous Monday for +being drunk and bloodthirsty in the streets, stirred up +to-morrow's pudding in his garret, while his lean +wife and the baby sallied out to buy the beef. + +Foggier yet, and colder. Piercing, searching, biting +cold. If the good Saint Dunstan had but nipped +the Evil Spirit's nose with a touch of such weather +as that, instead of using his familiar weapons, then +indeed he would have roared to lusty purpose. The +owner of one scant young nose, gnawed and mumbled +by the hungry cold as bones are gnawed by dogs, +stooped down at Scrooge's keyhole to regale him with +a Christmas carol: but at the first sound of + +.. text ommitted here + +.. "God bless you, merry gentleman! +.. May nothing you dismay!" + +Scrooge seized the ruler with such energy of action, +that the singer fled in terror, leaving the keyhole to +the fog and even more congenial frost. + +At length the hour of shutting up the counting-house +arrived. With an ill-will Scrooge dismounted from his +stool, and tacitly admitted the fact to the expectant +clerk in the Tank, who instantly snuffed his candle out, +and put on his hat. + +"You'll want all day to-morrow, I suppose?" said +Scrooge. + +"If quite convenient, sir." + +"It's not convenient," said Scrooge, "and it's not +fair. If I was to stop half-a-crown for it, you'd +think yourself ill-used, I'll be bound?" + +The clerk smiled faintly. + +"And yet," said Scrooge, "you don't think me ill-used, +when I pay a day's wages for no work." + +The clerk observed that it was only once a year. + +"A poor excuse for picking a man's pocket every +twenty-fifth of December!" said Scrooge, buttoning +his great-coat to the chin. "But I suppose you must +have the whole day. Be here all the earlier next +morning." + +The clerk promised that he would; and Scrooge +walked out with a growl. The office was closed in a +twinkling, and the clerk, with the long ends of his +white comforter dangling below his waist (for he +boasted no great-coat), went down a slide on Cornhill, +at the end of a lane of boys, twenty times, in +honour of its being Christmas Eve, and then ran home +to Camden Town as hard as he could pelt, to play +at blindman's-buff. + +Scrooge took his melancholy dinner in his usual +melancholy tavern; and having read all the newspapers, and +beguiled the rest of the evening with his +banker's-book, went home to bed. He lived in +chambers which had once belonged to his deceased +partner. They were a gloomy suite of rooms, in a +lowering pile of building up a yard, where it had so +little business to be, that one could scarcely help +fancying it must have run there when it was a young +house, playing at hide-and-seek with other houses, +and forgotten the way out again. It was old enough +now, and dreary enough, for nobody lived in it but +Scrooge, the other rooms being all let out as offices. +The yard was so dark that even Scrooge, who knew +its every stone, was fain to grope with his hands. +The fog and frost so hung about the black old gateway +of the house, that it seemed as if the Genius of +the Weather sat in mournful meditation on the +threshold. + +Now, it is a fact, that there was nothing at all +particular about the knocker on the door, except that it +was very large. It is also a fact, that Scrooge had +seen it, night and morning, during his whole residence +in that place; also that Scrooge had as little of what +is called fancy about him as any man in the city of +London, even including--which is a bold word--the +corporation, aldermen, and livery. Let it also be +borne in mind that Scrooge had not bestowed one +thought on Marley, since his last mention of his +seven years' dead partner that afternoon. And then +let any man explain to me, if he can, how it happened +that Scrooge, having his key in the lock of the door, +saw in the knocker, without its undergoing any intermediate +process of change--not a knocker, but Marley's face. + +Marley's face. It was not in impenetrable shadow +as the other objects in the yard were, but had a +dismal light about it, like a bad lobster in a dark +cellar. It was not angry or ferocious, but looked +at Scrooge as Marley used to look: with ghostly +spectacles turned up on its ghostly forehead. The +hair was curiously stirred, as if by breath or hot air; +and, though the eyes were wide open, they were perfectly +motionless. That, and its livid colour, made it +horrible; but its horror seemed to be in spite of the +face and beyond its control, rather than a part of +its own expression. + +As Scrooge looked fixedly at this phenomenon, it +was a knocker again. + +To say that he was not startled, or that his blood +was not conscious of a terrible sensation to which it +had been a stranger from infancy, would be untrue. +But he put his hand upon the key he had relinquished, +turned it sturdily, walked in, and lighted his candle. + +He did pause, with a moment's irresolution, before +he shut the door; and he did look cautiously behind +it first, as if he half expected to be terrified with the +sight of Marley's pigtail sticking out into the hall. +But there was nothing on the back of the door, except +the screws and nuts that held the knocker on, so he +said "Pooh, pooh!" and closed it with a bang. + +The sound resounded through the house like thunder. +Every room above, and every cask in the wine-merchant's +cellars below, appeared to have a separate peal +of echoes of its own. Scrooge was not a man to +be frightened by echoes. He fastened the door, and +walked across the hall, and up the stairs; slowly too: +trimming his candle as he went. + +You may talk vaguely about driving a coach-and-six +up a good old flight of stairs, or through a bad +young Act of Parliament; but I mean to say you +might have got a hearse up that staircase, and taken +it broadwise, with the splinter-bar towards the wall +and the door towards the balustrades: and done it +easy. There was plenty of width for that, and room +to spare; which is perhaps the reason why Scrooge +thought he saw a locomotive hearse going on before +him in the gloom. Half-a-dozen gas-lamps out of +the street wouldn't have lighted the entry too well, +so you may suppose that it was pretty dark with +Scrooge's dip. + +Up Scrooge went, not caring a button for that. +Darkness is cheap, and Scrooge liked it. But before +he shut his heavy door, he walked through his rooms +to see that all was right. He had just enough recollection +of the face to desire to do that. + +Sitting-room, bedroom, lumber-room. All as they +should be. Nobody under the table, nobody under +the sofa; a small fire in the grate; spoon and basin +ready; and the little saucepan of gruel (Scrooge had +a cold in his head) upon the hob. Nobody under the +bed; nobody in the closet; nobody in his dressing-gown, +which was hanging up in a suspicious attitude +against the wall. Lumber-room as usual. Old fire-guard, +old shoes, two fish-baskets, washing-stand on three +legs, and a poker. + +Quite satisfied, he closed his door, and locked +himself in; double-locked himself in, which was not his +custom. Thus secured against surprise, he took off +his cravat; put on his dressing-gown and slippers, and +his nightcap; and sat down before the fire to take +his gruel. + +It was a very low fire indeed; nothing on such a +bitter night. He was obliged to sit close to it, and +brood over it, before he could extract the least +sensation of warmth from such a handful of fuel. +The fireplace was an old one, built by some Dutch +merchant long ago, and paved all round with quaint +Dutch tiles, designed to illustrate the Scriptures. +There were Cains and Abels, Pharaoh's daughters; +Queens of Sheba, Angelic messengers descending +through the air on clouds like feather-beds, Abrahams, +Belshazzars, Apostles putting off to sea in butter-boats, +hundreds of figures to attract his thoughts; +and yet that face of Marley, seven years dead, came +like the ancient Prophet's rod, and swallowed up the +whole. If each smooth tile had been a blank at first, +with power to shape some picture on its surface from +the disjointed fragments of his thoughts, there would +have been a copy of old Marley's head on every one. + +"Humbug!" said Scrooge; and walked across the +room. + +After several turns, he sat down again. As he +threw his head back in the chair, his glance happened +to rest upon a bell, a disused bell, that hung in the +room, and communicated for some purpose now forgotten +with a chamber in the highest story of the +building. It was with great astonishment, and with +a strange, inexplicable dread, that as he looked, he +saw this bell begin to swing. It swung so softly in +the outset that it scarcely made a sound; but soon it +rang out loudly, and so did every bell in the house. + +This might have lasted half a minute, or a minute, +but it seemed an hour. The bells ceased as they had +begun, together. They were succeeded by a clanking +noise, deep down below; as if some person were +dragging a heavy chain over the casks in the +wine-merchant's cellar. Scrooge then remembered to have +heard that ghosts in haunted houses were described as +dragging chains. + +The cellar-door flew open with a booming sound, +and then he heard the noise much louder, on the floors +below; then coming up the stairs; then coming straight +towards his door. + +"It's humbug still!" said Scrooge. "I won't believe it." + +His colour changed though, when, without a pause, +it came on through the heavy door, and passed into +the room before his eyes. Upon its coming in, the +dying flame leaped up, as though it cried, "I know +him; Marley's Ghost!" and fell again. + +The same face: the very same. Marley in his pigtail, +usual waistcoat, tights and boots; the tassels on +the latter bristling, like his pigtail, and his coat-skirts, +and the hair upon his head. The chain he drew was +clasped about his middle. It was long, and wound +about him like a tail; and it was made (for Scrooge +observed it closely) of cash-boxes, keys, padlocks, +ledgers, deeds, and heavy purses wrought in steel. +His body was transparent; so that Scrooge, observing him, +and looking through his waistcoat, could see +the two buttons on his coat behind. + +Scrooge had often heard it said that Marley had no +bowels, but he had never believed it until now. + +No, nor did he believe it even now. Though he +looked the phantom through and through, and saw +it standing before him; though he felt the chilling +influence of its death-cold eyes; and marked the very +texture of the folded kerchief bound about its head +and chin, which wrapper he had not observed before; +he was still incredulous, and fought against his senses. + +"How now!" said Scrooge, caustic and cold as ever. +"What do you want with me?" + +"Much!"--Marley's voice, no doubt about it. + +"Who are you?" + +"Ask me who I was." + +"Who were you then?" said Scrooge, raising his +voice. "You're particular, for a shade." He was going +to say "to a shade," but substituted this, as more +appropriate. + +"In life I was your partner, Jacob Marley." + +"Can you--can you sit down?" asked Scrooge, looking +doubtfully at him. + +"I can." + +"Do it, then." + +Scrooge asked the question, because he didn't know +whether a ghost so transparent might find himself in +a condition to take a chair; and felt that in the event +of its being impossible, it might involve the necessity +of an embarrassing explanation. But the ghost sat +down on the opposite side of the fireplace, as if he +were quite used to it. + +"You don't believe in me," observed the Ghost. + +"I don't," said Scrooge. + +"What evidence would you have of my reality beyond that of +your senses?" + +"I don't know," said Scrooge. + +"Why do you doubt your senses?" + +"Because," said Scrooge, "a little thing affects them. +A slight disorder of the stomach makes them cheats. You may +be an undigested bit of beef, a blot of mustard, a crumb of +cheese, a fragment of an underdone potato. There's more of +gravy than of grave about you, whatever you are!" + +Scrooge was not much in the habit of cracking +jokes, nor did he feel, in his heart, by any means +waggish then. The truth is, that he tried to be +smart, as a means of distracting his own attention, +and keeping down his terror; for the spectre's voice +disturbed the very marrow in his bones. + +To sit, staring at those fixed glazed eyes, in silence +for a moment, would play, Scrooge felt, the very +deuce with him. There was something very awful, +too, in the spectre's being provided with an infernal +atmosphere of its own. Scrooge could not feel it +himself, but this was clearly the case; for though the +Ghost sat perfectly motionless, its hair, and skirts, +and tassels, were still agitated as by the hot vapour +from an oven. + +"You see this toothpick?" said Scrooge, returning +quickly to the charge, for the reason just assigned; +and wishing, though it were only for a second, to +divert the vision's stony gaze from himself. + +"I do," replied the Ghost. + +"You are not looking at it," said Scrooge. + +"But I see it," said the Ghost, "notwithstanding." + +"Well!" returned Scrooge, "I have but to swallow +this, and be for the rest of my days persecuted by a +legion of goblins, all of my own creation. Humbug, +I tell you! humbug!" + +At this the spirit raised a frightful cry, and shook +its chain with such a dismal and appalling noise, that +Scrooge held on tight to his chair, to save himself +from falling in a swoon. But how much greater was +his horror, when the phantom taking off the bandage +round its head, as if it were too warm to wear indoors, +its lower jaw dropped down upon its breast! + +Scrooge fell upon his knees, and clasped his hands +before his face. + +"Mercy!" he said. "Dreadful apparition, why do +you trouble me?" + +"Man of the worldly mind!" replied the Ghost, "do +you believe in me or not?" + +"I do," said Scrooge. "I must. But why do spirits +walk the earth, and why do they come to me?" + +"It is required of every man," the Ghost returned, +"that the spirit within him should walk abroad among +his fellowmen, and travel far and wide; and if that +spirit goes not forth in life, it is condemned to do so +after death. It is doomed to wander through the +world--oh, woe is me!--and witness what it cannot +share, but might have shared on earth, and turned to +happiness!" + +Again the spectre raised a cry, and shook its chain +and wrung its shadowy hands. + +"You are fettered," said Scrooge, trembling. "Tell +me why?" + +"I wear the chain I forged in life," replied the Ghost. +"I made it link by link, and yard by yard; I girded +it on of my own free will, and of my own free will I +wore it. Is its pattern strange to you?" + +Scrooge trembled more and more. + +"Or would you know," pursued the Ghost, "the +weight and length of the strong coil you bear yourself? +It was full as heavy and as long as this, seven +Christmas Eves ago. You have laboured on it, since. +It is a ponderous chain!" + +Scrooge glanced about him on the floor, in the +expectation of finding himself surrounded by some fifty +or sixty fathoms of iron cable: but he could see +nothing. + +"Jacob," he said, imploringly. "Old Jacob Marley, +tell me more. Speak comfort to me, Jacob!" + +"I have none to give," the Ghost replied. "It comes +from other regions, Ebenezer Scrooge, and is conveyed +by other ministers, to other kinds of men. Nor +can I tell you what I would. A very little more is +all permitted to me. I cannot rest, I cannot stay, I +cannot linger anywhere. My spirit never walked +beyond our counting-house--mark me!--in life my +spirit never roved beyond the narrow limits of our +money-changing hole; and weary journeys lie before +me!" + +It was a habit with Scrooge, whenever he became +thoughtful, to put his hands in his breeches pockets. +Pondering on what the Ghost had said, he did so now, +but without lifting up his eyes, or getting off his +knees. + +"You must have been very slow about it, Jacob," +Scrooge observed, in a business-like manner, though +with humility and deference. + +"Slow!" the Ghost repeated. + +"Seven years dead," mused Scrooge. "And travelling +all the time!" + +"The whole time," said the Ghost. "No rest, no +peace. Incessant torture of remorse." + +"You travel fast?" said Scrooge. + +"On the wings of the wind," replied the Ghost. + +"You might have got over a great quantity of +ground in seven years," said Scrooge. + +The Ghost, on hearing this, set up another cry, and +clanked its chain so hideously in the dead silence of +the night, that the Ward would have been justified in +indicting it for a nuisance. + +"Oh! captive, bound, and double-ironed," cried the +phantom, "not to know, that ages of incessant labour +by immortal creatures, for this earth must pass into +eternity before the good of which it is susceptible is +all developed. Not to know that any Christian spirit +working kindly in its little sphere, whatever it may +be, will find its mortal life too short for its vast +means of usefulness. Not to know that no space of +regret can make amends for one life's opportunity +misused! Yet such was I! Oh! such was I!" + +"But you were always a good man of business, +Jacob," faltered Scrooge, who now began to apply this +to himself. + +"Business!" cried the Ghost, wringing its hands +again. "Mankind was my business. The common +welfare was my business; charity, mercy, forbearance, +and benevolence, were, all, my business. The dealings +of my trade were but a drop of water in the +comprehensive ocean of my business!" + +It held up its chain at arm's length, as if that were +the cause of all its unavailing grief, and flung it +heavily upon the ground again. + +"At this time of the rolling year," the spectre said, +"I suffer most. Why did I walk through crowds of +fellow-beings with my eyes turned down, and never +raise them to that blessed Star which led the Wise +Men to a poor abode! Were there no poor homes to +which its light would have conducted me!" + +Scrooge was very much dismayed to hear the +spectre going on at this rate, and began to quake +exceedingly. + +"Hear me!" cried the Ghost. "My time is nearly +gone." + +"I will," said Scrooge. "But don't be hard upon +me! Don't be flowery, Jacob! Pray!" + +"How it is that I appear before you in a shape that +you can see, I may not tell. I have sat invisible +beside you many and many a day." + +It was not an agreeable idea. Scrooge shivered, +and wiped the perspiration from his brow. + +"That is no light part of my penance," pursued +the Ghost. "I am here to-night to warn you, that you +have yet a chance and hope of escaping my fate. A +chance and hope of my procuring, Ebenezer." + +"You were always a good friend to me," said +Scrooge. "Thank'ee!" + +"You will be haunted," resumed the Ghost, "by +Three Spirits." + +Scrooge's countenance fell almost as low as the +Ghost's had done. + +"Is that the chance and hope you mentioned, +Jacob?" he demanded, in a faltering voice. + +"It is." + +"I--I think I'd rather not," said Scrooge. + +"Without their visits," said the Ghost, "you cannot +hope to shun the path I tread. Expect the first to-morrow, +when the bell tolls One." + +"Couldn't I take 'em all at once, and have it over, +Jacob?" hinted Scrooge. + +"Expect the second on the next night at the same +hour. The third upon the next night when the last +stroke of Twelve has ceased to vibrate. Look to see +me no more; and look that, for your own sake, you +remember what has passed between us!" + +When it had said these words, the spectre took its +wrapper from the table, and bound it round its head, +as before. Scrooge knew this, by the smart sound its +teeth made, when the jaws were brought together +by the bandage. He ventured to raise his eyes again, +and found his supernatural visitor confronting him +in an erect attitude, with its chain wound over and +about its arm. + +The apparition walked backward from him; and at +every step it took, the window raised itself a little, +so that when the spectre reached it, it was wide open. + +It beckoned Scrooge to approach, which he did. +When they were within two paces of each other, +Marley's Ghost held up its hand, warning him to +come no nearer. Scrooge stopped. + +Not so much in obedience, as in surprise and fear: +for on the raising of the hand, he became sensible +of confused noises in the air; incoherent sounds of +lamentation and regret; wailings inexpressibly sorrowful and +self-accusatory. The spectre, after listening for a moment, +joined in the mournful dirge; and floated out upon the +bleak, dark night. + +Scrooge followed to the window: desperate in his +curiosity. He looked out. + +The air was filled with phantoms, wandering hither +and thither in restless haste, and moaning as they +went. Every one of them wore chains like Marley's +Ghost; some few (they might be guilty governments) +were linked together; none were free. Many had +been personally known to Scrooge in their lives. He +had been quite familiar with one old ghost, in a white +waistcoat, with a monstrous iron safe attached to +its ankle, who cried piteously at being unable to assist +a wretched woman with an infant, whom it saw below, +upon a door-step. The misery with them all was, +clearly, that they sought to interfere, for good, in +human matters, and had lost the power for ever. + +Whether these creatures faded into mist, or mist +enshrouded them, he could not tell. But they and +their spirit voices faded together; and the night became +as it had been when he walked home. + +Scrooge closed the window, and examined the door +by which the Ghost had entered. It was double-locked, +as he had locked it with his own hands, and +the bolts were undisturbed. He tried to say "Humbug!" +but stopped at the first syllable. And being, +from the emotion he had undergone, or the fatigues +of the day, or his glimpse of the Invisible World, or +the dull conversation of the Ghost, or the lateness of +the hour, much in need of repose; went straight to +bed, without undressing, and fell asleep upon the +instant. + + +STAVE II: THE FIRST OF THE THREE SPIRITS + diff --git a/sandbox/paultremblay/python_interface/test_files/header_footer4.rst b/sandbox/paultremblay/python_interface/test_files/header_footer4.rst new file mode 100644 index 000000000..7678fd729 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/header_footer4.rst @@ -0,0 +1,960 @@ +.. an example of suppressing the first page header and footer. + +.. role:: page-num + +.. container:: body-header + + body header + +.. container:: body-footer + + body footer + +MARLEY was dead: to begin with. There is no doubt +whatever about that. The register of his burial was +signed by the clergyman, the clerk, the undertaker, +and the chief mourner. Scrooge signed it: and +Scrooge's name was good upon 'Change, for anything he +chose to put his hand to. Old Marley was as dead as a +door-nail. + +Mind! I don't mean to say that I know, of my +own knowledge, what there is particularly dead about +a door-nail. I might have been inclined, myself, to +regard a coffin-nail as the deadest piece of ironmongery +in the trade. But the wisdom of our ancestors +is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that +Marley was as dead as a door-nail. + +Scrooge knew he was dead? Of course he did. +How could it be otherwise? Scrooge and he were +partners for I don't know how many years. Scrooge +was his sole executor, his sole administrator, his sole +assign, his sole residuary legatee, his sole friend, and +sole mourner. And even Scrooge was not so dreadfully +cut up by the sad event, but that he was an excellent +man of business on the very day of the funeral, +and solemnised it with an undoubted bargain. + +The mention of Marley's funeral brings me back to +the point I started from. There is no doubt that Marley +was dead. This must be distinctly understood, or +nothing wonderful can come of the story I am going +to relate. If we were not perfectly convinced that +Hamlet's Father died before the play began, there +would be nothing more remarkable in his taking a +stroll at night, in an easterly wind, upon his own ramparts, +than there would be in any other middle-aged +gentleman rashly turning out after dark in a breezy +spot--say Saint Paul's Churchyard for instance-- +literally to astonish his son's weak mind. + +Scrooge never painted out Old Marley's name. +There it stood, years afterwards, above the warehouse +door: Scrooge and Marley. The firm was known as +Scrooge and Marley. Sometimes people new to the +business called Scrooge Scrooge, and sometimes Marley, +but he answered to both names. It was all the +same to him. + +Oh! But he was a tight-fisted hand at the grind-stone, +Scrooge! a squeezing, wrenching, grasping, scraping, +clutching, covetous, old sinner! Hard and sharp as flint, +from which no steel had ever struck out generous fire; +secret, and self-contained, and solitary as an oyster. The +cold within him froze his old features, nipped his pointed +nose, shrivelled his cheek, stiffened his gait; made his +eyes red, his thin lips blue; and spoke out shrewdly in his +grating voice. A frosty rime was on his head, and on his +eyebrows, and his wiry chin. He carried his own low +temperature always about with him; he iced his office in +the dog-days; and didn't thaw it one degree at Christmas. + +External heat and cold had little influence on +Scrooge. No warmth could warm, no wintry weather +chill him. No wind that blew was bitterer than he, +no falling snow was more intent upon its purpose, no +pelting rain less open to entreaty. Foul weather didn't +know where to have him. The heaviest rain, and +snow, and hail, and sleet, could boast of the advantage +over him in only one respect. They often "came down" +handsomely, and Scrooge never did. + +Nobody ever stopped him in the street to say, with +gladsome looks, "My dear Scrooge, how are you? +When will you come to see me?" No beggars implored +him to bestow a trifle, no children asked him +what it was o'clock, no man or woman ever once in all +his life inquired the way to such and such a place, of +Scrooge. Even the blind men's dogs appeared to +know him; and when they saw him coming on, would +tug their owners into doorways and up courts; and +then would wag their tails as though they said, "No +eye at all is better than an evil eye, dark master!" + +But what did Scrooge care! It was the very thing +he liked. To edge his way along the crowded paths +of life, warning all human sympathy to keep its distance, +was what the knowing ones call "nuts" to Scrooge. + +Once upon a time--of all the good days in the year, +on Christmas Eve--old Scrooge sat busy in his +counting-house. It was cold, bleak, biting weather: foggy +withal: and he could hear the people in the court outside, +go wheezing up and down, beating their hands +upon their breasts, and stamping their feet upon the +pavement stones to warm them. The city clocks had +only just gone three, but it was quite dark already-- +it had not been light all day--and candles were flaring +in the windows of the neighbouring offices, like +ruddy smears upon the palpable brown air. The fog +came pouring in at every chink and keyhole, and was +so dense without, that although the court was of the +narrowest, the houses opposite were mere phantoms. +To see the dingy cloud come drooping down, obscuring +everything, one might have thought that Nature +lived hard by, and was brewing on a large scale. + +The door of Scrooge's counting-house was open +that he might keep his eye upon his clerk, who in a +dismal little cell beyond, a sort of tank, was copying +letters. Scrooge had a very small fire, but the clerk's +fire was so very much smaller that it looked like one +coal. But he couldn't replenish it, for Scrooge kept +the coal-box in his own room; and so surely as the +clerk came in with the shovel, the master predicted +that it would be necessary for them to part. Wherefore +the clerk put on his white comforter, and tried to +warm himself at the candle; in which effort, not being +a man of a strong imagination, he failed. + +"A merry Christmas, uncle! God save you!" cried +a cheerful voice. It was the voice of Scrooge's +nephew, who came upon him so quickly that this was +the first intimation he had of his approach. + +"Bah!" said Scrooge, "Humbug!" + +He had so heated himself with rapid walking in the +fog and frost, this nephew of Scrooge's, that he was +all in a glow; his face was ruddy and handsome; his +eyes sparkled, and his breath smoked again. + +"Christmas a humbug, uncle!" said Scrooge's +nephew. "You don't mean that, I am sure?" + +"I do," said Scrooge. "Merry Christmas! What +right have you to be merry? What reason have you +to be merry? You're poor enough." + +"Come, then," returned the nephew gaily. "What +right have you to be dismal? What reason have you +to be morose? You're rich enough." + +Scrooge having no better answer ready on the spur +of the moment, said, "Bah!" again; and followed it up +with "Humbug." + +"Don't be cross, uncle!" said the nephew. + +"What else can I be," returned the uncle, "when I +live in such a world of fools as this? Merry Christmas! +Out upon merry Christmas! What's Christmas +time to you but a time for paying bills without +money; a time for finding yourself a year older, but +not an hour richer; a time for balancing your books +and having every item in 'em through a round dozen +of months presented dead against you? If I could +work my will," said Scrooge indignantly, "every idiot +who goes about with 'Merry Christmas' on his lips, +should be boiled with his own pudding, and buried +with a stake of holly through his heart. He should!" + +"Uncle!" pleaded the nephew. + +"Nephew!" returned the uncle sternly, "keep Christmas +in your own way, and let me keep it in mine." + +"Keep it!" repeated Scrooge's nephew. "But you +don't keep it." + +"Let me leave it alone, then," said Scrooge. "Much +good may it do you! Much good it has ever done +you!" + +"There are many things from which I might have +derived good, by which I have not profited, I dare +say," returned the nephew. "Christmas among the +rest. But I am sure I have always thought of Christmas +time, when it has come round--apart from the +veneration due to its sacred name and origin, if anything +belonging to it can be apart from that--as a +good time; a kind, forgiving, charitable, pleasant +time; the only time I know of, in the long calendar +of the year, when men and women seem by one consent +to open their shut-up hearts freely, and to think +of people below them as if they really were +fellow-passengers to the grave, and not another race +of creatures bound on other journeys. And therefore, +uncle, though it has never put a scrap of gold or +silver in my pocket, I believe that it has done me +good, and will do me good; and I say, God bless it!" + +The clerk in the Tank involuntarily applauded. +Becoming immediately sensible of the impropriety, +he poked the fire, and extinguished the last frail spark +for ever. + +"Let me hear another sound from you," said +Scrooge, "and you'll keep your Christmas by losing +your situation! You're quite a powerful speaker, +sir," he added, turning to his nephew. "I wonder you +don't go into Parliament." + +"Don't be angry, uncle. Come! Dine with us to-morrow." + +Scrooge said that he would see him--yes, indeed he +did. He went the whole length of the expression, +and said that he would see him in that extremity first. + +"But why?" cried Scrooge's nephew. "Why?" + +"Why did you get married?" said Scrooge. + +"Because I fell in love." + +"Because you fell in love!" growled Scrooge, as if +that were the only one thing in the world more ridiculous +than a merry Christmas. "Good afternoon!" + +"Nay, uncle, but you never came to see me before +that happened. Why give it as a reason for not +coming now?" + +"Good afternoon," said Scrooge. + +"I want nothing from you; I ask nothing of you; +why cannot we be friends?" + +"Good afternoon," said Scrooge. + +"I am sorry, with all my heart, to find you so +resolute. We have never had any quarrel, to which I +have been a party. But I have made the trial in +homage to Christmas, and I'll keep my Christmas +humour to the last. So A Merry Christmas, uncle!" + +"Good afternoon!" said Scrooge. + +"And A Happy New Year!" + +"Good afternoon!" said Scrooge. + +His nephew left the room without an angry word, +notwithstanding. He stopped at the outer door to +bestow the greetings of the season on the clerk, who, +cold as he was, was warmer than Scrooge; for he returned +them cordially. + +"There's another fellow," muttered Scrooge; who +overheard him: "my clerk, with fifteen shillings a +week, and a wife and family, talking about a merry +Christmas. I'll retire to Bedlam." + +This lunatic, in letting Scrooge's nephew out, had +let two other people in. They were portly gentlemen, +pleasant to behold, and now stood, with their hats off, +in Scrooge's office. They had books and papers in +their hands, and bowed to him. + +"Scrooge and Marley's, I believe," said one of the +gentlemen, referring to his list. "Have I the pleasure +of addressing Mr. Scrooge, or Mr. Marley?" + +"Mr. Marley has been dead these seven years," +Scrooge replied. "He died seven years ago, this very +night." + +"We have no doubt his liberality is well represented +by his surviving partner," said the gentleman, presenting +his credentials. + +It certainly was; for they had been two kindred +spirits. At the ominous word "liberality," Scrooge +frowned, and shook his head, and handed the credentials +back. + +"At this festive season of the year, Mr. Scrooge," +said the gentleman, taking up a pen, "it is more than +usually desirable that we should make some slight +provision for the Poor and destitute, who suffer +greatly at the present time. Many thousands are in +want of common necessaries; hundreds of thousands +are in want of common comforts, sir." + +"Are there no prisons?" asked Scrooge. + +"Plenty of prisons," said the gentleman, laying down +the pen again. + +"And the Union workhouses?" demanded Scrooge. +"Are they still in operation?" + +"They are. Still," returned the gentleman, "I wish +I could say they were not." + +"The Treadmill and the Poor Law are in full vigour, +then?" said Scrooge. + +"Both very busy, sir." + +"Oh! I was afraid, from what you said at first, +that something had occurred to stop them in their +useful course," said Scrooge. "I'm very glad to +hear it." + +"Under the impression that they scarcely furnish +Christian cheer of mind or body to the multitude," +returned the gentleman, "a few of us are endeavouring +to raise a fund to buy the Poor some meat and drink, +and means of warmth. We choose this time, because +it is a time, of all others, when Want is keenly felt, +and Abundance rejoices. What shall I put you down +for?" + +"Nothing!" Scrooge replied. + +"You wish to be anonymous?" + +"I wish to be left alone," said Scrooge. "Since you +ask me what I wish, gentlemen, that is my answer. +I don't make merry myself at Christmas and I can't +afford to make idle people merry. I help to support +the establishments I have mentioned--they cost +enough; and those who are badly off must go there." + +"Many can't go there; and many would rather die." + +"If they would rather die," said Scrooge, "they had +better do it, and decrease the surplus population. +Besides--excuse me--I don't know that." + +"But you might know it," observed the gentleman. + +"It's not my business," Scrooge returned. "It's +enough for a man to understand his own business, and +not to interfere with other people's. Mine occupies +me constantly. Good afternoon, gentlemen!" + +Seeing clearly that it would be useless to pursue +their point, the gentlemen withdrew. Scrooge resumed +his labours with an improved opinion of himself, +and in a more facetious temper than was usual +with him. + +Meanwhile the fog and darkness thickened so, that +people ran about with flaring links, proffering their +services to go before horses in carriages, and conduct +them on their way. The ancient tower of a church, +whose gruff old bell was always peeping slily down +at Scrooge out of a Gothic window in the wall, became +invisible, and struck the hours and quarters in the +clouds, with tremulous vibrations afterwards as if +its teeth were chattering in its frozen head up there. +The cold became intense. In the main street, at the +corner of the court, some labourers were repairing +the gas-pipes, and had lighted a great fire in a brazier, +round which a party of ragged men and boys were +gathered: warming their hands and winking their +eyes before the blaze in rapture. The water-plug +being left in solitude, its overflowings sullenly congealed, +and turned to misanthropic ice. The brightness +of the shops where holly sprigs and berries +crackled in the lamp heat of the windows, made pale +faces ruddy as they passed. Poulterers' and grocers' +trades became a splendid joke: a glorious pageant, +with which it was next to impossible to believe that +such dull principles as bargain and sale had anything +to do. The Lord Mayor, in the stronghold of the +mighty Mansion House, gave orders to his fifty cooks +and butlers to keep Christmas as a Lord Mayor's +household should; and even the little tailor, whom he +had fined five shillings on the previous Monday for +being drunk and bloodthirsty in the streets, stirred up +to-morrow's pudding in his garret, while his lean +wife and the baby sallied out to buy the beef. + +Foggier yet, and colder. Piercing, searching, biting +cold. If the good Saint Dunstan had but nipped +the Evil Spirit's nose with a touch of such weather +as that, instead of using his familiar weapons, then +indeed he would have roared to lusty purpose. The +owner of one scant young nose, gnawed and mumbled +by the hungry cold as bones are gnawed by dogs, +stooped down at Scrooge's keyhole to regale him with +a Christmas carol: but at the first sound of + +.. text ommitted here + +.. "God bless you, merry gentleman! +.. May nothing you dismay!" + +Scrooge seized the ruler with such energy of action, +that the singer fled in terror, leaving the keyhole to +the fog and even more congenial frost. + +At length the hour of shutting up the counting-house +arrived. With an ill-will Scrooge dismounted from his +stool, and tacitly admitted the fact to the expectant +clerk in the Tank, who instantly snuffed his candle out, +and put on his hat. + +"You'll want all day to-morrow, I suppose?" said +Scrooge. + +"If quite convenient, sir." + +"It's not convenient," said Scrooge, "and it's not +fair. If I was to stop half-a-crown for it, you'd +think yourself ill-used, I'll be bound?" + +The clerk smiled faintly. + +"And yet," said Scrooge, "you don't think me ill-used, +when I pay a day's wages for no work." + +The clerk observed that it was only once a year. + +"A poor excuse for picking a man's pocket every +twenty-fifth of December!" said Scrooge, buttoning +his great-coat to the chin. "But I suppose you must +have the whole day. Be here all the earlier next +morning." + +The clerk promised that he would; and Scrooge +walked out with a growl. The office was closed in a +twinkling, and the clerk, with the long ends of his +white comforter dangling below his waist (for he +boasted no great-coat), went down a slide on Cornhill, +at the end of a lane of boys, twenty times, in +honour of its being Christmas Eve, and then ran home +to Camden Town as hard as he could pelt, to play +at blindman's-buff. + +Scrooge took his melancholy dinner in his usual +melancholy tavern; and having read all the newspapers, and +beguiled the rest of the evening with his +banker's-book, went home to bed. He lived in +chambers which had once belonged to his deceased +partner. They were a gloomy suite of rooms, in a +lowering pile of building up a yard, where it had so +little business to be, that one could scarcely help +fancying it must have run there when it was a young +house, playing at hide-and-seek with other houses, +and forgotten the way out again. It was old enough +now, and dreary enough, for nobody lived in it but +Scrooge, the other rooms being all let out as offices. +The yard was so dark that even Scrooge, who knew +its every stone, was fain to grope with his hands. +The fog and frost so hung about the black old gateway +of the house, that it seemed as if the Genius of +the Weather sat in mournful meditation on the +threshold. + +Now, it is a fact, that there was nothing at all +particular about the knocker on the door, except that it +was very large. It is also a fact, that Scrooge had +seen it, night and morning, during his whole residence +in that place; also that Scrooge had as little of what +is called fancy about him as any man in the city of +London, even including--which is a bold word--the +corporation, aldermen, and livery. Let it also be +borne in mind that Scrooge had not bestowed one +thought on Marley, since his last mention of his +seven years' dead partner that afternoon. And then +let any man explain to me, if he can, how it happened +that Scrooge, having his key in the lock of the door, +saw in the knocker, without its undergoing any intermediate +process of change--not a knocker, but Marley's face. + +Marley's face. It was not in impenetrable shadow +as the other objects in the yard were, but had a +dismal light about it, like a bad lobster in a dark +cellar. It was not angry or ferocious, but looked +at Scrooge as Marley used to look: with ghostly +spectacles turned up on its ghostly forehead. The +hair was curiously stirred, as if by breath or hot air; +and, though the eyes were wide open, they were perfectly +motionless. That, and its livid colour, made it +horrible; but its horror seemed to be in spite of the +face and beyond its control, rather than a part of +its own expression. + +As Scrooge looked fixedly at this phenomenon, it +was a knocker again. + +To say that he was not startled, or that his blood +was not conscious of a terrible sensation to which it +had been a stranger from infancy, would be untrue. +But he put his hand upon the key he had relinquished, +turned it sturdily, walked in, and lighted his candle. + +He did pause, with a moment's irresolution, before +he shut the door; and he did look cautiously behind +it first, as if he half expected to be terrified with the +sight of Marley's pigtail sticking out into the hall. +But there was nothing on the back of the door, except +the screws and nuts that held the knocker on, so he +said "Pooh, pooh!" and closed it with a bang. + +The sound resounded through the house like thunder. +Every room above, and every cask in the wine-merchant's +cellars below, appeared to have a separate peal +of echoes of its own. Scrooge was not a man to +be frightened by echoes. He fastened the door, and +walked across the hall, and up the stairs; slowly too: +trimming his candle as he went. + +You may talk vaguely about driving a coach-and-six +up a good old flight of stairs, or through a bad +young Act of Parliament; but I mean to say you +might have got a hearse up that staircase, and taken +it broadwise, with the splinter-bar towards the wall +and the door towards the balustrades: and done it +easy. There was plenty of width for that, and room +to spare; which is perhaps the reason why Scrooge +thought he saw a locomotive hearse going on before +him in the gloom. Half-a-dozen gas-lamps out of +the street wouldn't have lighted the entry too well, +so you may suppose that it was pretty dark with +Scrooge's dip. + +Up Scrooge went, not caring a button for that. +Darkness is cheap, and Scrooge liked it. But before +he shut his heavy door, he walked through his rooms +to see that all was right. He had just enough recollection +of the face to desire to do that. + +Sitting-room, bedroom, lumber-room. All as they +should be. Nobody under the table, nobody under +the sofa; a small fire in the grate; spoon and basin +ready; and the little saucepan of gruel (Scrooge had +a cold in his head) upon the hob. Nobody under the +bed; nobody in the closet; nobody in his dressing-gown, +which was hanging up in a suspicious attitude +against the wall. Lumber-room as usual. Old fire-guard, +old shoes, two fish-baskets, washing-stand on three +legs, and a poker. + +Quite satisfied, he closed his door, and locked +himself in; double-locked himself in, which was not his +custom. Thus secured against surprise, he took off +his cravat; put on his dressing-gown and slippers, and +his nightcap; and sat down before the fire to take +his gruel. + +It was a very low fire indeed; nothing on such a +bitter night. He was obliged to sit close to it, and +brood over it, before he could extract the least +sensation of warmth from such a handful of fuel. +The fireplace was an old one, built by some Dutch +merchant long ago, and paved all round with quaint +Dutch tiles, designed to illustrate the Scriptures. +There were Cains and Abels, Pharaoh's daughters; +Queens of Sheba, Angelic messengers descending +through the air on clouds like feather-beds, Abrahams, +Belshazzars, Apostles putting off to sea in butter-boats, +hundreds of figures to attract his thoughts; +and yet that face of Marley, seven years dead, came +like the ancient Prophet's rod, and swallowed up the +whole. If each smooth tile had been a blank at first, +with power to shape some picture on its surface from +the disjointed fragments of his thoughts, there would +have been a copy of old Marley's head on every one. + +"Humbug!" said Scrooge; and walked across the +room. + +After several turns, he sat down again. As he +threw his head back in the chair, his glance happened +to rest upon a bell, a disused bell, that hung in the +room, and communicated for some purpose now forgotten +with a chamber in the highest story of the +building. It was with great astonishment, and with +a strange, inexplicable dread, that as he looked, he +saw this bell begin to swing. It swung so softly in +the outset that it scarcely made a sound; but soon it +rang out loudly, and so did every bell in the house. + +This might have lasted half a minute, or a minute, +but it seemed an hour. The bells ceased as they had +begun, together. They were succeeded by a clanking +noise, deep down below; as if some person were +dragging a heavy chain over the casks in the +wine-merchant's cellar. Scrooge then remembered to have +heard that ghosts in haunted houses were described as +dragging chains. + +The cellar-door flew open with a booming sound, +and then he heard the noise much louder, on the floors +below; then coming up the stairs; then coming straight +towards his door. + +"It's humbug still!" said Scrooge. "I won't believe it." + +His colour changed though, when, without a pause, +it came on through the heavy door, and passed into +the room before his eyes. Upon its coming in, the +dying flame leaped up, as though it cried, "I know +him; Marley's Ghost!" and fell again. + +The same face: the very same. Marley in his pigtail, +usual waistcoat, tights and boots; the tassels on +the latter bristling, like his pigtail, and his coat-skirts, +and the hair upon his head. The chain he drew was +clasped about his middle. It was long, and wound +about him like a tail; and it was made (for Scrooge +observed it closely) of cash-boxes, keys, padlocks, +ledgers, deeds, and heavy purses wrought in steel. +His body was transparent; so that Scrooge, observing him, +and looking through his waistcoat, could see +the two buttons on his coat behind. + +Scrooge had often heard it said that Marley had no +bowels, but he had never believed it until now. + +No, nor did he believe it even now. Though he +looked the phantom through and through, and saw +it standing before him; though he felt the chilling +influence of its death-cold eyes; and marked the very +texture of the folded kerchief bound about its head +and chin, which wrapper he had not observed before; +he was still incredulous, and fought against his senses. + +"How now!" said Scrooge, caustic and cold as ever. +"What do you want with me?" + +"Much!"--Marley's voice, no doubt about it. + +"Who are you?" + +"Ask me who I was." + +"Who were you then?" said Scrooge, raising his +voice. "You're particular, for a shade." He was going +to say "to a shade," but substituted this, as more +appropriate. + +"In life I was your partner, Jacob Marley." + +"Can you--can you sit down?" asked Scrooge, looking +doubtfully at him. + +"I can." + +"Do it, then." + +Scrooge asked the question, because he didn't know +whether a ghost so transparent might find himself in +a condition to take a chair; and felt that in the event +of its being impossible, it might involve the necessity +of an embarrassing explanation. But the ghost sat +down on the opposite side of the fireplace, as if he +were quite used to it. + +"You don't believe in me," observed the Ghost. + +"I don't," said Scrooge. + +"What evidence would you have of my reality beyond that of +your senses?" + +"I don't know," said Scrooge. + +"Why do you doubt your senses?" + +"Because," said Scrooge, "a little thing affects them. +A slight disorder of the stomach makes them cheats. You may +be an undigested bit of beef, a blot of mustard, a crumb of +cheese, a fragment of an underdone potato. There's more of +gravy than of grave about you, whatever you are!" + +Scrooge was not much in the habit of cracking +jokes, nor did he feel, in his heart, by any means +waggish then. The truth is, that he tried to be +smart, as a means of distracting his own attention, +and keeping down his terror; for the spectre's voice +disturbed the very marrow in his bones. + +To sit, staring at those fixed glazed eyes, in silence +for a moment, would play, Scrooge felt, the very +deuce with him. There was something very awful, +too, in the spectre's being provided with an infernal +atmosphere of its own. Scrooge could not feel it +himself, but this was clearly the case; for though the +Ghost sat perfectly motionless, its hair, and skirts, +and tassels, were still agitated as by the hot vapour +from an oven. + +"You see this toothpick?" said Scrooge, returning +quickly to the charge, for the reason just assigned; +and wishing, though it were only for a second, to +divert the vision's stony gaze from himself. + +"I do," replied the Ghost. + +"You are not looking at it," said Scrooge. + +"But I see it," said the Ghost, "notwithstanding." + +"Well!" returned Scrooge, "I have but to swallow +this, and be for the rest of my days persecuted by a +legion of goblins, all of my own creation. Humbug, +I tell you! humbug!" + +At this the spirit raised a frightful cry, and shook +its chain with such a dismal and appalling noise, that +Scrooge held on tight to his chair, to save himself +from falling in a swoon. But how much greater was +his horror, when the phantom taking off the bandage +round its head, as if it were too warm to wear indoors, +its lower jaw dropped down upon its breast! + +Scrooge fell upon his knees, and clasped his hands +before his face. + +"Mercy!" he said. "Dreadful apparition, why do +you trouble me?" + +"Man of the worldly mind!" replied the Ghost, "do +you believe in me or not?" + +"I do," said Scrooge. "I must. But why do spirits +walk the earth, and why do they come to me?" + +"It is required of every man," the Ghost returned, +"that the spirit within him should walk abroad among +his fellowmen, and travel far and wide; and if that +spirit goes not forth in life, it is condemned to do so +after death. It is doomed to wander through the +world--oh, woe is me!--and witness what it cannot +share, but might have shared on earth, and turned to +happiness!" + +Again the spectre raised a cry, and shook its chain +and wrung its shadowy hands. + +"You are fettered," said Scrooge, trembling. "Tell +me why?" + +"I wear the chain I forged in life," replied the Ghost. +"I made it link by link, and yard by yard; I girded +it on of my own free will, and of my own free will I +wore it. Is its pattern strange to you?" + +Scrooge trembled more and more. + +"Or would you know," pursued the Ghost, "the +weight and length of the strong coil you bear yourself? +It was full as heavy and as long as this, seven +Christmas Eves ago. You have laboured on it, since. +It is a ponderous chain!" + +Scrooge glanced about him on the floor, in the +expectation of finding himself surrounded by some fifty +or sixty fathoms of iron cable: but he could see +nothing. + +"Jacob," he said, imploringly. "Old Jacob Marley, +tell me more. Speak comfort to me, Jacob!" + +"I have none to give," the Ghost replied. "It comes +from other regions, Ebenezer Scrooge, and is conveyed +by other ministers, to other kinds of men. Nor +can I tell you what I would. A very little more is +all permitted to me. I cannot rest, I cannot stay, I +cannot linger anywhere. My spirit never walked +beyond our counting-house--mark me!--in life my +spirit never roved beyond the narrow limits of our +money-changing hole; and weary journeys lie before +me!" + +It was a habit with Scrooge, whenever he became +thoughtful, to put his hands in his breeches pockets. +Pondering on what the Ghost had said, he did so now, +but without lifting up his eyes, or getting off his +knees. + +"You must have been very slow about it, Jacob," +Scrooge observed, in a business-like manner, though +with humility and deference. + +"Slow!" the Ghost repeated. + +"Seven years dead," mused Scrooge. "And travelling +all the time!" + +"The whole time," said the Ghost. "No rest, no +peace. Incessant torture of remorse." + +"You travel fast?" said Scrooge. + +"On the wings of the wind," replied the Ghost. + +"You might have got over a great quantity of +ground in seven years," said Scrooge. + +The Ghost, on hearing this, set up another cry, and +clanked its chain so hideously in the dead silence of +the night, that the Ward would have been justified in +indicting it for a nuisance. + +"Oh! captive, bound, and double-ironed," cried the +phantom, "not to know, that ages of incessant labour +by immortal creatures, for this earth must pass into +eternity before the good of which it is susceptible is +all developed. Not to know that any Christian spirit +working kindly in its little sphere, whatever it may +be, will find its mortal life too short for its vast +means of usefulness. Not to know that no space of +regret can make amends for one life's opportunity +misused! Yet such was I! Oh! such was I!" + +"But you were always a good man of business, +Jacob," faltered Scrooge, who now began to apply this +to himself. + +"Business!" cried the Ghost, wringing its hands +again. "Mankind was my business. The common +welfare was my business; charity, mercy, forbearance, +and benevolence, were, all, my business. The dealings +of my trade were but a drop of water in the +comprehensive ocean of my business!" + +It held up its chain at arm's length, as if that were +the cause of all its unavailing grief, and flung it +heavily upon the ground again. + +"At this time of the rolling year," the spectre said, +"I suffer most. Why did I walk through crowds of +fellow-beings with my eyes turned down, and never +raise them to that blessed Star which led the Wise +Men to a poor abode! Were there no poor homes to +which its light would have conducted me!" + +Scrooge was very much dismayed to hear the +spectre going on at this rate, and began to quake +exceedingly. + +"Hear me!" cried the Ghost. "My time is nearly +gone." + +"I will," said Scrooge. "But don't be hard upon +me! Don't be flowery, Jacob! Pray!" + +"How it is that I appear before you in a shape that +you can see, I may not tell. I have sat invisible +beside you many and many a day." + +It was not an agreeable idea. Scrooge shivered, +and wiped the perspiration from his brow. + +"That is no light part of my penance," pursued +the Ghost. "I am here to-night to warn you, that you +have yet a chance and hope of escaping my fate. A +chance and hope of my procuring, Ebenezer." + +"You were always a good friend to me," said +Scrooge. "Thank'ee!" + +"You will be haunted," resumed the Ghost, "by +Three Spirits." + +Scrooge's countenance fell almost as low as the +Ghost's had done. + +"Is that the chance and hope you mentioned, +Jacob?" he demanded, in a faltering voice. + +"It is." + +"I--I think I'd rather not," said Scrooge. + +"Without their visits," said the Ghost, "you cannot +hope to shun the path I tread. Expect the first to-morrow, +when the bell tolls One." + +"Couldn't I take 'em all at once, and have it over, +Jacob?" hinted Scrooge. + +"Expect the second on the next night at the same +hour. The third upon the next night when the last +stroke of Twelve has ceased to vibrate. Look to see +me no more; and look that, for your own sake, you +remember what has passed between us!" + +When it had said these words, the spectre took its +wrapper from the table, and bound it round its head, +as before. Scrooge knew this, by the smart sound its +teeth made, when the jaws were brought together +by the bandage. He ventured to raise his eyes again, +and found his supernatural visitor confronting him +in an erect attitude, with its chain wound over and +about its arm. + +The apparition walked backward from him; and at +every step it took, the window raised itself a little, +so that when the spectre reached it, it was wide open. + +It beckoned Scrooge to approach, which he did. +When they were within two paces of each other, +Marley's Ghost held up its hand, warning him to +come no nearer. Scrooge stopped. + +Not so much in obedience, as in surprise and fear: +for on the raising of the hand, he became sensible +of confused noises in the air; incoherent sounds of +lamentation and regret; wailings inexpressibly sorrowful and +self-accusatory. The spectre, after listening for a moment, +joined in the mournful dirge; and floated out upon the +bleak, dark night. + +Scrooge followed to the window: desperate in his +curiosity. He looked out. + +The air was filled with phantoms, wandering hither +and thither in restless haste, and moaning as they +went. Every one of them wore chains like Marley's +Ghost; some few (they might be guilty governments) +were linked together; none were free. Many had +been personally known to Scrooge in their lives. He +had been quite familiar with one old ghost, in a white +waistcoat, with a monstrous iron safe attached to +its ankle, who cried piteously at being unable to assist +a wretched woman with an infant, whom it saw below, +upon a door-step. The misery with them all was, +clearly, that they sought to interfere, for good, in +human matters, and had lost the power for ever. + +Whether these creatures faded into mist, or mist +enshrouded them, he could not tell. But they and +their spirit voices faded together; and the night became +as it had been when he walked home. + +Scrooge closed the window, and examined the door +by which the Ghost had entered. It was double-locked, +as he had locked it with his own hands, and +the bolts were undisturbed. He tried to say "Humbug!" +but stopped at the first syllable. And being, +from the emotion he had undergone, or the fatigues +of the day, or his glimpse of the Invisible World, or +the dull conversation of the Ghost, or the lateness of +the hour, much in need of repose; went straight to +bed, without undressing, and fell asleep upon the +instant. + + +STAVE II: THE FIRST OF THE THREE SPIRITS + diff --git a/sandbox/paultremblay/python_interface/test_files/header_footer5.rst b/sandbox/paultremblay/python_interface/test_files/header_footer5.rst new file mode 100644 index 000000000..ac512f3b5 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/header_footer5.rst @@ -0,0 +1,968 @@ +.. an example of having different headers on odd, and even pages. + +.. role:: page-num + +.. container:: odd-header + + odd header + +.. container:: odd-footer + + odd footer + +.. container:: even-header + + even header + +.. container:: even-footer + + even footer + +MARLEY was dead: to begin with. There is no doubt +whatever about that. The register of his burial was +signed by the clergyman, the clerk, the undertaker, +and the chief mourner. Scrooge signed it: and +Scrooge's name was good upon 'Change, for anything he +chose to put his hand to. Old Marley was as dead as a +door-nail. + +Mind! I don't mean to say that I know, of my +own knowledge, what there is particularly dead about +a door-nail. I might have been inclined, myself, to +regard a coffin-nail as the deadest piece of ironmongery +in the trade. But the wisdom of our ancestors +is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that +Marley was as dead as a door-nail. + +Scrooge knew he was dead? Of course he did. +How could it be otherwise? Scrooge and he were +partners for I don't know how many years. Scrooge +was his sole executor, his sole administrator, his sole +assign, his sole residuary legatee, his sole friend, and +sole mourner. And even Scrooge was not so dreadfully +cut up by the sad event, but that he was an excellent +man of business on the very day of the funeral, +and solemnised it with an undoubted bargain. + +The mention of Marley's funeral brings me back to +the point I started from. There is no doubt that Marley +was dead. This must be distinctly understood, or +nothing wonderful can come of the story I am going +to relate. If we were not perfectly convinced that +Hamlet's Father died before the play began, there +would be nothing more remarkable in his taking a +stroll at night, in an easterly wind, upon his own ramparts, +than there would be in any other middle-aged +gentleman rashly turning out after dark in a breezy +spot--say Saint Paul's Churchyard for instance-- +literally to astonish his son's weak mind. + +Scrooge never painted out Old Marley's name. +There it stood, years afterwards, above the warehouse +door: Scrooge and Marley. The firm was known as +Scrooge and Marley. Sometimes people new to the +business called Scrooge Scrooge, and sometimes Marley, +but he answered to both names. It was all the +same to him. + +Oh! But he was a tight-fisted hand at the grind-stone, +Scrooge! a squeezing, wrenching, grasping, scraping, +clutching, covetous, old sinner! Hard and sharp as flint, +from which no steel had ever struck out generous fire; +secret, and self-contained, and solitary as an oyster. The +cold within him froze his old features, nipped his pointed +nose, shrivelled his cheek, stiffened his gait; made his +eyes red, his thin lips blue; and spoke out shrewdly in his +grating voice. A frosty rime was on his head, and on his +eyebrows, and his wiry chin. He carried his own low +temperature always about with him; he iced his office in +the dog-days; and didn't thaw it one degree at Christmas. + +External heat and cold had little influence on +Scrooge. No warmth could warm, no wintry weather +chill him. No wind that blew was bitterer than he, +no falling snow was more intent upon its purpose, no +pelting rain less open to entreaty. Foul weather didn't +know where to have him. The heaviest rain, and +snow, and hail, and sleet, could boast of the advantage +over him in only one respect. They often "came down" +handsomely, and Scrooge never did. + +Nobody ever stopped him in the street to say, with +gladsome looks, "My dear Scrooge, how are you? +When will you come to see me?" No beggars implored +him to bestow a trifle, no children asked him +what it was o'clock, no man or woman ever once in all +his life inquired the way to such and such a place, of +Scrooge. Even the blind men's dogs appeared to +know him; and when they saw him coming on, would +tug their owners into doorways and up courts; and +then would wag their tails as though they said, "No +eye at all is better than an evil eye, dark master!" + +But what did Scrooge care! It was the very thing +he liked. To edge his way along the crowded paths +of life, warning all human sympathy to keep its distance, +was what the knowing ones call "nuts" to Scrooge. + +Once upon a time--of all the good days in the year, +on Christmas Eve--old Scrooge sat busy in his +counting-house. It was cold, bleak, biting weather: foggy +withal: and he could hear the people in the court outside, +go wheezing up and down, beating their hands +upon their breasts, and stamping their feet upon the +pavement stones to warm them. The city clocks had +only just gone three, but it was quite dark already-- +it had not been light all day--and candles were flaring +in the windows of the neighbouring offices, like +ruddy smears upon the palpable brown air. The fog +came pouring in at every chink and keyhole, and was +so dense without, that although the court was of the +narrowest, the houses opposite were mere phantoms. +To see the dingy cloud come drooping down, obscuring +everything, one might have thought that Nature +lived hard by, and was brewing on a large scale. + +The door of Scrooge's counting-house was open +that he might keep his eye upon his clerk, who in a +dismal little cell beyond, a sort of tank, was copying +letters. Scrooge had a very small fire, but the clerk's +fire was so very much smaller that it looked like one +coal. But he couldn't replenish it, for Scrooge kept +the coal-box in his own room; and so surely as the +clerk came in with the shovel, the master predicted +that it would be necessary for them to part. Wherefore +the clerk put on his white comforter, and tried to +warm himself at the candle; in which effort, not being +a man of a strong imagination, he failed. + +"A merry Christmas, uncle! God save you!" cried +a cheerful voice. It was the voice of Scrooge's +nephew, who came upon him so quickly that this was +the first intimation he had of his approach. + +"Bah!" said Scrooge, "Humbug!" + +He had so heated himself with rapid walking in the +fog and frost, this nephew of Scrooge's, that he was +all in a glow; his face was ruddy and handsome; his +eyes sparkled, and his breath smoked again. + +"Christmas a humbug, uncle!" said Scrooge's +nephew. "You don't mean that, I am sure?" + +"I do," said Scrooge. "Merry Christmas! What +right have you to be merry? What reason have you +to be merry? You're poor enough." + +"Come, then," returned the nephew gaily. "What +right have you to be dismal? What reason have you +to be morose? You're rich enough." + +Scrooge having no better answer ready on the spur +of the moment, said, "Bah!" again; and followed it up +with "Humbug." + +"Don't be cross, uncle!" said the nephew. + +"What else can I be," returned the uncle, "when I +live in such a world of fools as this? Merry Christmas! +Out upon merry Christmas! What's Christmas +time to you but a time for paying bills without +money; a time for finding yourself a year older, but +not an hour richer; a time for balancing your books +and having every item in 'em through a round dozen +of months presented dead against you? If I could +work my will," said Scrooge indignantly, "every idiot +who goes about with 'Merry Christmas' on his lips, +should be boiled with his own pudding, and buried +with a stake of holly through his heart. He should!" + +"Uncle!" pleaded the nephew. + +"Nephew!" returned the uncle sternly, "keep Christmas +in your own way, and let me keep it in mine." + +"Keep it!" repeated Scrooge's nephew. "But you +don't keep it." + +"Let me leave it alone, then," said Scrooge. "Much +good may it do you! Much good it has ever done +you!" + +"There are many things from which I might have +derived good, by which I have not profited, I dare +say," returned the nephew. "Christmas among the +rest. But I am sure I have always thought of Christmas +time, when it has come round--apart from the +veneration due to its sacred name and origin, if anything +belonging to it can be apart from that--as a +good time; a kind, forgiving, charitable, pleasant +time; the only time I know of, in the long calendar +of the year, when men and women seem by one consent +to open their shut-up hearts freely, and to think +of people below them as if they really were +fellow-passengers to the grave, and not another race +of creatures bound on other journeys. And therefore, +uncle, though it has never put a scrap of gold or +silver in my pocket, I believe that it has done me +good, and will do me good; and I say, God bless it!" + +The clerk in the Tank involuntarily applauded. +Becoming immediately sensible of the impropriety, +he poked the fire, and extinguished the last frail spark +for ever. + +"Let me hear another sound from you," said +Scrooge, "and you'll keep your Christmas by losing +your situation! You're quite a powerful speaker, +sir," he added, turning to his nephew. "I wonder you +don't go into Parliament." + +"Don't be angry, uncle. Come! Dine with us to-morrow." + +Scrooge said that he would see him--yes, indeed he +did. He went the whole length of the expression, +and said that he would see him in that extremity first. + +"But why?" cried Scrooge's nephew. "Why?" + +"Why did you get married?" said Scrooge. + +"Because I fell in love." + +"Because you fell in love!" growled Scrooge, as if +that were the only one thing in the world more ridiculous +than a merry Christmas. "Good afternoon!" + +"Nay, uncle, but you never came to see me before +that happened. Why give it as a reason for not +coming now?" + +"Good afternoon," said Scrooge. + +"I want nothing from you; I ask nothing of you; +why cannot we be friends?" + +"Good afternoon," said Scrooge. + +"I am sorry, with all my heart, to find you so +resolute. We have never had any quarrel, to which I +have been a party. But I have made the trial in +homage to Christmas, and I'll keep my Christmas +humour to the last. So A Merry Christmas, uncle!" + +"Good afternoon!" said Scrooge. + +"And A Happy New Year!" + +"Good afternoon!" said Scrooge. + +His nephew left the room without an angry word, +notwithstanding. He stopped at the outer door to +bestow the greetings of the season on the clerk, who, +cold as he was, was warmer than Scrooge; for he returned +them cordially. + +"There's another fellow," muttered Scrooge; who +overheard him: "my clerk, with fifteen shillings a +week, and a wife and family, talking about a merry +Christmas. I'll retire to Bedlam." + +This lunatic, in letting Scrooge's nephew out, had +let two other people in. They were portly gentlemen, +pleasant to behold, and now stood, with their hats off, +in Scrooge's office. They had books and papers in +their hands, and bowed to him. + +"Scrooge and Marley's, I believe," said one of the +gentlemen, referring to his list. "Have I the pleasure +of addressing Mr. Scrooge, or Mr. Marley?" + +"Mr. Marley has been dead these seven years," +Scrooge replied. "He died seven years ago, this very +night." + +"We have no doubt his liberality is well represented +by his surviving partner," said the gentleman, presenting +his credentials. + +It certainly was; for they had been two kindred +spirits. At the ominous word "liberality," Scrooge +frowned, and shook his head, and handed the credentials +back. + +"At this festive season of the year, Mr. Scrooge," +said the gentleman, taking up a pen, "it is more than +usually desirable that we should make some slight +provision for the Poor and destitute, who suffer +greatly at the present time. Many thousands are in +want of common necessaries; hundreds of thousands +are in want of common comforts, sir." + +"Are there no prisons?" asked Scrooge. + +"Plenty of prisons," said the gentleman, laying down +the pen again. + +"And the Union workhouses?" demanded Scrooge. +"Are they still in operation?" + +"They are. Still," returned the gentleman, "I wish +I could say they were not." + +"The Treadmill and the Poor Law are in full vigour, +then?" said Scrooge. + +"Both very busy, sir." + +"Oh! I was afraid, from what you said at first, +that something had occurred to stop them in their +useful course," said Scrooge. "I'm very glad to +hear it." + +"Under the impression that they scarcely furnish +Christian cheer of mind or body to the multitude," +returned the gentleman, "a few of us are endeavouring +to raise a fund to buy the Poor some meat and drink, +and means of warmth. We choose this time, because +it is a time, of all others, when Want is keenly felt, +and Abundance rejoices. What shall I put you down +for?" + +"Nothing!" Scrooge replied. + +"You wish to be anonymous?" + +"I wish to be left alone," said Scrooge. "Since you +ask me what I wish, gentlemen, that is my answer. +I don't make merry myself at Christmas and I can't +afford to make idle people merry. I help to support +the establishments I have mentioned--they cost +enough; and those who are badly off must go there." + +"Many can't go there; and many would rather die." + +"If they would rather die," said Scrooge, "they had +better do it, and decrease the surplus population. +Besides--excuse me--I don't know that." + +"But you might know it," observed the gentleman. + +"It's not my business," Scrooge returned. "It's +enough for a man to understand his own business, and +not to interfere with other people's. Mine occupies +me constantly. Good afternoon, gentlemen!" + +Seeing clearly that it would be useless to pursue +their point, the gentlemen withdrew. Scrooge resumed +his labours with an improved opinion of himself, +and in a more facetious temper than was usual +with him. + +Meanwhile the fog and darkness thickened so, that +people ran about with flaring links, proffering their +services to go before horses in carriages, and conduct +them on their way. The ancient tower of a church, +whose gruff old bell was always peeping slily down +at Scrooge out of a Gothic window in the wall, became +invisible, and struck the hours and quarters in the +clouds, with tremulous vibrations afterwards as if +its teeth were chattering in its frozen head up there. +The cold became intense. In the main street, at the +corner of the court, some labourers were repairing +the gas-pipes, and had lighted a great fire in a brazier, +round which a party of ragged men and boys were +gathered: warming their hands and winking their +eyes before the blaze in rapture. The water-plug +being left in solitude, its overflowings sullenly congealed, +and turned to misanthropic ice. The brightness +of the shops where holly sprigs and berries +crackled in the lamp heat of the windows, made pale +faces ruddy as they passed. Poulterers' and grocers' +trades became a splendid joke: a glorious pageant, +with which it was next to impossible to believe that +such dull principles as bargain and sale had anything +to do. The Lord Mayor, in the stronghold of the +mighty Mansion House, gave orders to his fifty cooks +and butlers to keep Christmas as a Lord Mayor's +household should; and even the little tailor, whom he +had fined five shillings on the previous Monday for +being drunk and bloodthirsty in the streets, stirred up +to-morrow's pudding in his garret, while his lean +wife and the baby sallied out to buy the beef. + +Foggier yet, and colder. Piercing, searching, biting +cold. If the good Saint Dunstan had but nipped +the Evil Spirit's nose with a touch of such weather +as that, instead of using his familiar weapons, then +indeed he would have roared to lusty purpose. The +owner of one scant young nose, gnawed and mumbled +by the hungry cold as bones are gnawed by dogs, +stooped down at Scrooge's keyhole to regale him with +a Christmas carol: but at the first sound of + +.. text ommitted here + +.. "God bless you, merry gentleman! +.. May nothing you dismay!" + +Scrooge seized the ruler with such energy of action, +that the singer fled in terror, leaving the keyhole to +the fog and even more congenial frost. + +At length the hour of shutting up the counting-house +arrived. With an ill-will Scrooge dismounted from his +stool, and tacitly admitted the fact to the expectant +clerk in the Tank, who instantly snuffed his candle out, +and put on his hat. + +"You'll want all day to-morrow, I suppose?" said +Scrooge. + +"If quite convenient, sir." + +"It's not convenient," said Scrooge, "and it's not +fair. If I was to stop half-a-crown for it, you'd +think yourself ill-used, I'll be bound?" + +The clerk smiled faintly. + +"And yet," said Scrooge, "you don't think me ill-used, +when I pay a day's wages for no work." + +The clerk observed that it was only once a year. + +"A poor excuse for picking a man's pocket every +twenty-fifth of December!" said Scrooge, buttoning +his great-coat to the chin. "But I suppose you must +have the whole day. Be here all the earlier next +morning." + +The clerk promised that he would; and Scrooge +walked out with a growl. The office was closed in a +twinkling, and the clerk, with the long ends of his +white comforter dangling below his waist (for he +boasted no great-coat), went down a slide on Cornhill, +at the end of a lane of boys, twenty times, in +honour of its being Christmas Eve, and then ran home +to Camden Town as hard as he could pelt, to play +at blindman's-buff. + +Scrooge took his melancholy dinner in his usual +melancholy tavern; and having read all the newspapers, and +beguiled the rest of the evening with his +banker's-book, went home to bed. He lived in +chambers which had once belonged to his deceased +partner. They were a gloomy suite of rooms, in a +lowering pile of building up a yard, where it had so +little business to be, that one could scarcely help +fancying it must have run there when it was a young +house, playing at hide-and-seek with other houses, +and forgotten the way out again. It was old enough +now, and dreary enough, for nobody lived in it but +Scrooge, the other rooms being all let out as offices. +The yard was so dark that even Scrooge, who knew +its every stone, was fain to grope with his hands. +The fog and frost so hung about the black old gateway +of the house, that it seemed as if the Genius of +the Weather sat in mournful meditation on the +threshold. + +Now, it is a fact, that there was nothing at all +particular about the knocker on the door, except that it +was very large. It is also a fact, that Scrooge had +seen it, night and morning, during his whole residence +in that place; also that Scrooge had as little of what +is called fancy about him as any man in the city of +London, even including--which is a bold word--the +corporation, aldermen, and livery. Let it also be +borne in mind that Scrooge had not bestowed one +thought on Marley, since his last mention of his +seven years' dead partner that afternoon. And then +let any man explain to me, if he can, how it happened +that Scrooge, having his key in the lock of the door, +saw in the knocker, without its undergoing any intermediate +process of change--not a knocker, but Marley's face. + +Marley's face. It was not in impenetrable shadow +as the other objects in the yard were, but had a +dismal light about it, like a bad lobster in a dark +cellar. It was not angry or ferocious, but looked +at Scrooge as Marley used to look: with ghostly +spectacles turned up on its ghostly forehead. The +hair was curiously stirred, as if by breath or hot air; +and, though the eyes were wide open, they were perfectly +motionless. That, and its livid colour, made it +horrible; but its horror seemed to be in spite of the +face and beyond its control, rather than a part of +its own expression. + +As Scrooge looked fixedly at this phenomenon, it +was a knocker again. + +To say that he was not startled, or that his blood +was not conscious of a terrible sensation to which it +had been a stranger from infancy, would be untrue. +But he put his hand upon the key he had relinquished, +turned it sturdily, walked in, and lighted his candle. + +He did pause, with a moment's irresolution, before +he shut the door; and he did look cautiously behind +it first, as if he half expected to be terrified with the +sight of Marley's pigtail sticking out into the hall. +But there was nothing on the back of the door, except +the screws and nuts that held the knocker on, so he +said "Pooh, pooh!" and closed it with a bang. + +The sound resounded through the house like thunder. +Every room above, and every cask in the wine-merchant's +cellars below, appeared to have a separate peal +of echoes of its own. Scrooge was not a man to +be frightened by echoes. He fastened the door, and +walked across the hall, and up the stairs; slowly too: +trimming his candle as he went. + +You may talk vaguely about driving a coach-and-six +up a good old flight of stairs, or through a bad +young Act of Parliament; but I mean to say you +might have got a hearse up that staircase, and taken +it broadwise, with the splinter-bar towards the wall +and the door towards the balustrades: and done it +easy. There was plenty of width for that, and room +to spare; which is perhaps the reason why Scrooge +thought he saw a locomotive hearse going on before +him in the gloom. Half-a-dozen gas-lamps out of +the street wouldn't have lighted the entry too well, +so you may suppose that it was pretty dark with +Scrooge's dip. + +Up Scrooge went, not caring a button for that. +Darkness is cheap, and Scrooge liked it. But before +he shut his heavy door, he walked through his rooms +to see that all was right. He had just enough recollection +of the face to desire to do that. + +Sitting-room, bedroom, lumber-room. All as they +should be. Nobody under the table, nobody under +the sofa; a small fire in the grate; spoon and basin +ready; and the little saucepan of gruel (Scrooge had +a cold in his head) upon the hob. Nobody under the +bed; nobody in the closet; nobody in his dressing-gown, +which was hanging up in a suspicious attitude +against the wall. Lumber-room as usual. Old fire-guard, +old shoes, two fish-baskets, washing-stand on three +legs, and a poker. + +Quite satisfied, he closed his door, and locked +himself in; double-locked himself in, which was not his +custom. Thus secured against surprise, he took off +his cravat; put on his dressing-gown and slippers, and +his nightcap; and sat down before the fire to take +his gruel. + +It was a very low fire indeed; nothing on such a +bitter night. He was obliged to sit close to it, and +brood over it, before he could extract the least +sensation of warmth from such a handful of fuel. +The fireplace was an old one, built by some Dutch +merchant long ago, and paved all round with quaint +Dutch tiles, designed to illustrate the Scriptures. +There were Cains and Abels, Pharaoh's daughters; +Queens of Sheba, Angelic messengers descending +through the air on clouds like feather-beds, Abrahams, +Belshazzars, Apostles putting off to sea in butter-boats, +hundreds of figures to attract his thoughts; +and yet that face of Marley, seven years dead, came +like the ancient Prophet's rod, and swallowed up the +whole. If each smooth tile had been a blank at first, +with power to shape some picture on its surface from +the disjointed fragments of his thoughts, there would +have been a copy of old Marley's head on every one. + +"Humbug!" said Scrooge; and walked across the +room. + +After several turns, he sat down again. As he +threw his head back in the chair, his glance happened +to rest upon a bell, a disused bell, that hung in the +room, and communicated for some purpose now forgotten +with a chamber in the highest story of the +building. It was with great astonishment, and with +a strange, inexplicable dread, that as he looked, he +saw this bell begin to swing. It swung so softly in +the outset that it scarcely made a sound; but soon it +rang out loudly, and so did every bell in the house. + +This might have lasted half a minute, or a minute, +but it seemed an hour. The bells ceased as they had +begun, together. They were succeeded by a clanking +noise, deep down below; as if some person were +dragging a heavy chain over the casks in the +wine-merchant's cellar. Scrooge then remembered to have +heard that ghosts in haunted houses were described as +dragging chains. + +The cellar-door flew open with a booming sound, +and then he heard the noise much louder, on the floors +below; then coming up the stairs; then coming straight +towards his door. + +"It's humbug still!" said Scrooge. "I won't believe it." + +His colour changed though, when, without a pause, +it came on through the heavy door, and passed into +the room before his eyes. Upon its coming in, the +dying flame leaped up, as though it cried, "I know +him; Marley's Ghost!" and fell again. + +The same face: the very same. Marley in his pigtail, +usual waistcoat, tights and boots; the tassels on +the latter bristling, like his pigtail, and his coat-skirts, +and the hair upon his head. The chain he drew was +clasped about his middle. It was long, and wound +about him like a tail; and it was made (for Scrooge +observed it closely) of cash-boxes, keys, padlocks, +ledgers, deeds, and heavy purses wrought in steel. +His body was transparent; so that Scrooge, observing him, +and looking through his waistcoat, could see +the two buttons on his coat behind. + +Scrooge had often heard it said that Marley had no +bowels, but he had never believed it until now. + +No, nor did he believe it even now. Though he +looked the phantom through and through, and saw +it standing before him; though he felt the chilling +influence of its death-cold eyes; and marked the very +texture of the folded kerchief bound about its head +and chin, which wrapper he had not observed before; +he was still incredulous, and fought against his senses. + +"How now!" said Scrooge, caustic and cold as ever. +"What do you want with me?" + +"Much!"--Marley's voice, no doubt about it. + +"Who are you?" + +"Ask me who I was." + +"Who were you then?" said Scrooge, raising his +voice. "You're particular, for a shade." He was going +to say "to a shade," but substituted this, as more +appropriate. + +"In life I was your partner, Jacob Marley." + +"Can you--can you sit down?" asked Scrooge, looking +doubtfully at him. + +"I can." + +"Do it, then." + +Scrooge asked the question, because he didn't know +whether a ghost so transparent might find himself in +a condition to take a chair; and felt that in the event +of its being impossible, it might involve the necessity +of an embarrassing explanation. But the ghost sat +down on the opposite side of the fireplace, as if he +were quite used to it. + +"You don't believe in me," observed the Ghost. + +"I don't," said Scrooge. + +"What evidence would you have of my reality beyond that of +your senses?" + +"I don't know," said Scrooge. + +"Why do you doubt your senses?" + +"Because," said Scrooge, "a little thing affects them. +A slight disorder of the stomach makes them cheats. You may +be an undigested bit of beef, a blot of mustard, a crumb of +cheese, a fragment of an underdone potato. There's more of +gravy than of grave about you, whatever you are!" + +Scrooge was not much in the habit of cracking +jokes, nor did he feel, in his heart, by any means +waggish then. The truth is, that he tried to be +smart, as a means of distracting his own attention, +and keeping down his terror; for the spectre's voice +disturbed the very marrow in his bones. + +To sit, staring at those fixed glazed eyes, in silence +for a moment, would play, Scrooge felt, the very +deuce with him. There was something very awful, +too, in the spectre's being provided with an infernal +atmosphere of its own. Scrooge could not feel it +himself, but this was clearly the case; for though the +Ghost sat perfectly motionless, its hair, and skirts, +and tassels, were still agitated as by the hot vapour +from an oven. + +"You see this toothpick?" said Scrooge, returning +quickly to the charge, for the reason just assigned; +and wishing, though it were only for a second, to +divert the vision's stony gaze from himself. + +"I do," replied the Ghost. + +"You are not looking at it," said Scrooge. + +"But I see it," said the Ghost, "notwithstanding." + +"Well!" returned Scrooge, "I have but to swallow +this, and be for the rest of my days persecuted by a +legion of goblins, all of my own creation. Humbug, +I tell you! humbug!" + +At this the spirit raised a frightful cry, and shook +its chain with such a dismal and appalling noise, that +Scrooge held on tight to his chair, to save himself +from falling in a swoon. But how much greater was +his horror, when the phantom taking off the bandage +round its head, as if it were too warm to wear indoors, +its lower jaw dropped down upon its breast! + +Scrooge fell upon his knees, and clasped his hands +before his face. + +"Mercy!" he said. "Dreadful apparition, why do +you trouble me?" + +"Man of the worldly mind!" replied the Ghost, "do +you believe in me or not?" + +"I do," said Scrooge. "I must. But why do spirits +walk the earth, and why do they come to me?" + +"It is required of every man," the Ghost returned, +"that the spirit within him should walk abroad among +his fellowmen, and travel far and wide; and if that +spirit goes not forth in life, it is condemned to do so +after death. It is doomed to wander through the +world--oh, woe is me!--and witness what it cannot +share, but might have shared on earth, and turned to +happiness!" + +Again the spectre raised a cry, and shook its chain +and wrung its shadowy hands. + +"You are fettered," said Scrooge, trembling. "Tell +me why?" + +"I wear the chain I forged in life," replied the Ghost. +"I made it link by link, and yard by yard; I girded +it on of my own free will, and of my own free will I +wore it. Is its pattern strange to you?" + +Scrooge trembled more and more. + +"Or would you know," pursued the Ghost, "the +weight and length of the strong coil you bear yourself? +It was full as heavy and as long as this, seven +Christmas Eves ago. You have laboured on it, since. +It is a ponderous chain!" + +Scrooge glanced about him on the floor, in the +expectation of finding himself surrounded by some fifty +or sixty fathoms of iron cable: but he could see +nothing. + +"Jacob," he said, imploringly. "Old Jacob Marley, +tell me more. Speak comfort to me, Jacob!" + +"I have none to give," the Ghost replied. "It comes +from other regions, Ebenezer Scrooge, and is conveyed +by other ministers, to other kinds of men. Nor +can I tell you what I would. A very little more is +all permitted to me. I cannot rest, I cannot stay, I +cannot linger anywhere. My spirit never walked +beyond our counting-house--mark me!--in life my +spirit never roved beyond the narrow limits of our +money-changing hole; and weary journeys lie before +me!" + +It was a habit with Scrooge, whenever he became +thoughtful, to put his hands in his breeches pockets. +Pondering on what the Ghost had said, he did so now, +but without lifting up his eyes, or getting off his +knees. + +"You must have been very slow about it, Jacob," +Scrooge observed, in a business-like manner, though +with humility and deference. + +"Slow!" the Ghost repeated. + +"Seven years dead," mused Scrooge. "And travelling +all the time!" + +"The whole time," said the Ghost. "No rest, no +peace. Incessant torture of remorse." + +"You travel fast?" said Scrooge. + +"On the wings of the wind," replied the Ghost. + +"You might have got over a great quantity of +ground in seven years," said Scrooge. + +The Ghost, on hearing this, set up another cry, and +clanked its chain so hideously in the dead silence of +the night, that the Ward would have been justified in +indicting it for a nuisance. + +"Oh! captive, bound, and double-ironed," cried the +phantom, "not to know, that ages of incessant labour +by immortal creatures, for this earth must pass into +eternity before the good of which it is susceptible is +all developed. Not to know that any Christian spirit +working kindly in its little sphere, whatever it may +be, will find its mortal life too short for its vast +means of usefulness. Not to know that no space of +regret can make amends for one life's opportunity +misused! Yet such was I! Oh! such was I!" + +"But you were always a good man of business, +Jacob," faltered Scrooge, who now began to apply this +to himself. + +"Business!" cried the Ghost, wringing its hands +again. "Mankind was my business. The common +welfare was my business; charity, mercy, forbearance, +and benevolence, were, all, my business. The dealings +of my trade were but a drop of water in the +comprehensive ocean of my business!" + +It held up its chain at arm's length, as if that were +the cause of all its unavailing grief, and flung it +heavily upon the ground again. + +"At this time of the rolling year," the spectre said, +"I suffer most. Why did I walk through crowds of +fellow-beings with my eyes turned down, and never +raise them to that blessed Star which led the Wise +Men to a poor abode! Were there no poor homes to +which its light would have conducted me!" + +Scrooge was very much dismayed to hear the +spectre going on at this rate, and began to quake +exceedingly. + +"Hear me!" cried the Ghost. "My time is nearly +gone." + +"I will," said Scrooge. "But don't be hard upon +me! Don't be flowery, Jacob! Pray!" + +"How it is that I appear before you in a shape that +you can see, I may not tell. I have sat invisible +beside you many and many a day." + +It was not an agreeable idea. Scrooge shivered, +and wiped the perspiration from his brow. + +"That is no light part of my penance," pursued +the Ghost. "I am here to-night to warn you, that you +have yet a chance and hope of escaping my fate. A +chance and hope of my procuring, Ebenezer." + +"You were always a good friend to me," said +Scrooge. "Thank'ee!" + +"You will be haunted," resumed the Ghost, "by +Three Spirits." + +Scrooge's countenance fell almost as low as the +Ghost's had done. + +"Is that the chance and hope you mentioned, +Jacob?" he demanded, in a faltering voice. + +"It is." + +"I--I think I'd rather not," said Scrooge. + +"Without their visits," said the Ghost, "you cannot +hope to shun the path I tread. Expect the first to-morrow, +when the bell tolls One." + +"Couldn't I take 'em all at once, and have it over, +Jacob?" hinted Scrooge. + +"Expect the second on the next night at the same +hour. The third upon the next night when the last +stroke of Twelve has ceased to vibrate. Look to see +me no more; and look that, for your own sake, you +remember what has passed between us!" + +When it had said these words, the spectre took its +wrapper from the table, and bound it round its head, +as before. Scrooge knew this, by the smart sound its +teeth made, when the jaws were brought together +by the bandage. He ventured to raise his eyes again, +and found his supernatural visitor confronting him +in an erect attitude, with its chain wound over and +about its arm. + +The apparition walked backward from him; and at +every step it took, the window raised itself a little, +so that when the spectre reached it, it was wide open. + +It beckoned Scrooge to approach, which he did. +When they were within two paces of each other, +Marley's Ghost held up its hand, warning him to +come no nearer. Scrooge stopped. + +Not so much in obedience, as in surprise and fear: +for on the raising of the hand, he became sensible +of confused noises in the air; incoherent sounds of +lamentation and regret; wailings inexpressibly sorrowful and +self-accusatory. The spectre, after listening for a moment, +joined in the mournful dirge; and floated out upon the +bleak, dark night. + +Scrooge followed to the window: desperate in his +curiosity. He looked out. + +The air was filled with phantoms, wandering hither +and thither in restless haste, and moaning as they +went. Every one of them wore chains like Marley's +Ghost; some few (they might be guilty governments) +were linked together; none were free. Many had +been personally known to Scrooge in their lives. He +had been quite familiar with one old ghost, in a white +waistcoat, with a monstrous iron safe attached to +its ankle, who cried piteously at being unable to assist +a wretched woman with an infant, whom it saw below, +upon a door-step. The misery with them all was, +clearly, that they sought to interfere, for good, in +human matters, and had lost the power for ever. + +Whether these creatures faded into mist, or mist +enshrouded them, he could not tell. But they and +their spirit voices faded together; and the night became +as it had been when he walked home. + +Scrooge closed the window, and examined the door +by which the Ghost had entered. It was double-locked, +as he had locked it with his own hands, and +the bolts were undisturbed. He tried to say "Humbug!" +but stopped at the first syllable. And being, +from the emotion he had undergone, or the fatigues +of the day, or his glimpse of the Invisible World, or +the dull conversation of the Ghost, or the lateness of +the hour, much in need of repose; went straight to +bed, without undressing, and fell asleep upon the +instant. + + +STAVE II: THE FIRST OF THE THREE SPIRITS + diff --git a/sandbox/paultremblay/python_interface/test_files/header_footer_toc1.rst b/sandbox/paultremblay/python_interface/test_files/header_footer_toc1.rst new file mode 100644 index 000000000..db9cb0462 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/header_footer_toc1.rst @@ -0,0 +1,585 @@ +.. $Id$ + +.. an exmaple of headers and footers with different first and body + +.. role:: page-num + +:Author: Paul Tremblay +:Authors: David Goodger, Paul Tremlbay +:Organization: Open Source Software +:Contact: paulhtremblay@gmail.com +:Address: Paul Tremblay + 100 Market St. + Boston, MA, 01800 +:Version: .1 +:Uses: text processing + + documentation +:Status: Pending +:Date: $Date$ +:Copyright: This document is in the public domain +:Dedication: I dedicate this to all the hard working coders in + docutils, who have made text processing possible. +:Abstract: Just an example of bibliograhic fields. + +.. contents:: Table of Contents + +.. container:: toc-first-header + + First: A Christmas Carol + +.. container:: toc-first-footer + + First: Charles Dickens. + + -:page-num:`1`- + +.. container:: toc-body-header + + Body: A Christmas Carol + +.. container:: toc-body-footer + + Body: Charles Dickens. + + -:page-num:`1`- + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text diff --git a/sandbox/paultremblay/python_interface/test_files/header_footer_toc2.rst b/sandbox/paultremblay/python_interface/test_files/header_footer_toc2.rst new file mode 100644 index 000000000..46273b5b9 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/header_footer_toc2.rst @@ -0,0 +1,576 @@ +.. $Id$ + +.. an exmaple of headers and footers, suppressing first page headers and +.. footers + +.. role:: page-num + +:Author: Paul Tremblay +:Authors: David Goodger, Paul Tremlbay +:Organization: Open Source Software +:Contact: paulhtremblay@gmail.com +:Address: Paul Tremblay + 100 Market St. + Boston, MA, 01800 +:Version: .1 +:Uses: text processing + + documentation +:Status: Pending +:Date: $Date$ +:Copyright: This document is in the public domain +:Dedication: I dedicate this to all the hard working coders in + docutils, who have made text processing possible. +:Abstract: Just an example of bibliograhic fields. + +.. contents:: Table of Contents + +.. container:: toc-body-header + + Body: A Christmas Carol + +.. container:: toc-body-footer + + Body: Charles Dickens. + + -:page-num:`1`- + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text diff --git a/sandbox/paultremblay/python_interface/test_files/header_footer_toc3.rst b/sandbox/paultremblay/python_interface/test_files/header_footer_toc3.rst new file mode 100644 index 000000000..d0b205fc8 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/header_footer_toc3.rst @@ -0,0 +1,596 @@ +.. $Id$ + +.. an exmaple of headers and footers, different on odd, even, and first page +.. footers + +.. role:: page-num + +:Author: Paul Tremblay +:Authors: David Goodger, Paul Tremlbay +:Organization: Open Source Software +:Contact: paulhtremblay@gmail.com +:Address: Paul Tremblay + 100 Market St. + Boston, MA, 01800 +:Version: .1 +:Uses: text processing + + documentation +:Status: Pending +:Date: $Date$ +:Copyright: This document is in the public domain +:Dedication: I dedicate this to all the hard working coders in + docutils, who have made text processing possible. +:Abstract: Just an example of bibliograhic fields. + +.. contents:: Table of Contents + +.. container:: toc-first-header + + First: A Christmas Carol + +.. container:: toc-first-footer + + First: Charles Dickens. + + -:page-num:`1`- + +.. container:: toc-odd-header + + Odd: A Christmas Carol + +.. container:: toc-odd-footer + + Odd: Charles Dickens. + + -:page-num:`1`- + +.. container:: toc-even-header + + Even: A Christmas Carol + +.. container:: toc-even-footer + + Even: Charles Dickens. + + -:page-num:`1`- + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text diff --git a/sandbox/paultremblay/python_interface/test_files/header_footer_toc4.rst b/sandbox/paultremblay/python_interface/test_files/header_footer_toc4.rst new file mode 100644 index 000000000..f9d17242e --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/header_footer_toc4.rst @@ -0,0 +1,587 @@ +.. $Id$ + +.. an exmaple of headers and footers, different on odd and even pages +.. footers + +.. role:: page-num + +:Author: Paul Tremblay +:Authors: David Goodger, Paul Tremlbay +:Organization: Open Source Software +:Contact: paulhtremblay@gmail.com +:Address: Paul Tremblay + 100 Market St. + Boston, MA, 01800 +:Version: .1 +:Uses: text processing + + documentation +:Status: Pending +:Date: $Date$ +:Copyright: This document is in the public domain +:Dedication: I dedicate this to all the hard working coders in + docutils, who have made text processing possible. +:Abstract: Just an example of bibliograhic fields. + +.. contents:: Table of Contents + + +.. container:: toc-odd-header + + Odd: A Christmas Carol + +.. container:: toc-odd-footer + + Odd: Charles Dickens. + + -:page-num:`1`- + +.. container:: toc-even-header + + Even: A Christmas Carol + +.. container:: toc-even-footer + + Even: Charles Dickens. + + -:page-num:`1`- + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text + +section +======== + +Text diff --git a/sandbox/paultremblay/python_interface/test_files/highlights.rst b/sandbox/paultremblay/python_interface/test_files/highlights.rst new file mode 100644 index 000000000..669606f91 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/highlights.rst @@ -0,0 +1,11 @@ +paragrah text + +.. highlights:: + + first point + + second point + + third point + +paragrah text diff --git a/sandbox/paultremblay/python_interface/test_files/hyperlinks.rst b/sandbox/paultremblay/python_interface/test_files/hyperlinks.rst new file mode 100644 index 000000000..2fcd1f237 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/hyperlinks.rst @@ -0,0 +1,1018 @@ +Internal hyperlink targets have empty link blocks. They provide an end point allowing a hyperlink to connect one place to another within a document. An internal hyperlink target points to the element following the target. For example: + +www.python.org + +Clicking on this internal hyperlink will take us to the target_ +below. + +points to target 1 target1_ + +MARLEY was dead: to begin with. There is no doubt +whatever about that. The register of his burial was +signed by the clergyman, the clerk, the undertaker, +and the chief mourner. Scrooge signed it: and +Scrooge's name was good upon 'Change, for anything he +chose to put his hand to. Old Marley was as dead as a +door-nail. + +Mind! I don't mean to say that I know, of my +own knowledge, what there is particularly dead about +a door-nail. I might have been inclined, myself, to +regard a coffin-nail as the deadest piece of ironmongery +in the trade. But the wisdom of our ancestors +is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that +Marley was as dead as a door-nail. + +Scrooge knew he was dead? Of course he did. +How could it be otherwise? Scrooge and he were +partners for I don't know how many years. Scrooge +was his sole executor, his sole administrator, his sole +assign, his sole residuary legatee, his sole friend, and +sole mourner. And even Scrooge was not so dreadfully +cut up by the sad event, but that he was an excellent +man of business on the very day of the funeral, +and solemnised it with an undoubted bargain. + +The mention of Marley's funeral brings me back to +the point I started from. There is no doubt that Marley +was dead. This must be distinctly understood, or +nothing wonderful can come of the story I am going +to relate. If we were not perfectly convinced that +Hamlet's Father died before the play began, there +would be nothing more remarkable in his taking a +stroll at night, in an easterly wind, upon his own ramparts, +than there would be in any other middle-aged +gentleman rashly turning out after dark in a breezy +spot--say Saint Paul's Churchyard for instance-- +literally to astonish his son's weak mind. + +Scrooge never painted out Old Marley's name. +There it stood, years afterwards, above the warehouse +door: Scrooge and Marley. The firm was known as +Scrooge and Marley. Sometimes people new to the +business called Scrooge Scrooge, and sometimes Marley, +but he answered to both names. It was all the +same to him. + +Oh! But he was a tight-fisted hand at the grind-stone, +Scrooge! a squeezing, wrenching, grasping, scraping, +clutching, covetous, old sinner! Hard and sharp as flint, +from which no steel had ever struck out generous fire; +secret, and self-contained, and solitary as an oyster. The +cold within him froze his old features, nipped his pointed +nose, shrivelled his cheek, stiffened his gait; made his +eyes red, his thin lips blue; and spoke out shrewdly in his +grating voice. A frosty rime was on his head, and on his +eyebrows, and his wiry chin. He carried his own low +temperature always about with him; he iced his office in +the dog-days; and didn't thaw it one degree at Christmas. + +External heat and cold had little influence on +Scrooge. No warmth could warm, no wintry weather +chill him. No wind that blew was bitterer than he, +no falling snow was more intent upon its purpose, no +pelting rain less open to entreaty. Foul weather didn't +know where to have him. The heaviest rain, and +snow, and hail, and sleet, could boast of the advantage +over him in only one respect. They often "came down" +handsomely, and Scrooge never did. + +Nobody ever stopped him in the street to say, with +gladsome looks, "My dear Scrooge, how are you? +When will you come to see me?" No beggars implored +him to bestow a trifle, no children asked him +what it was o'clock, no man or woman ever once in all +his life inquired the way to such and such a place, of +Scrooge. Even the blind men's dogs appeared to +know him; and when they saw him coming on, would +tug their owners into doorways and up courts; and +then would wag their tails as though they said, "No +eye at all is better than an evil eye, dark master!" + +But what did Scrooge care! It was the very thing +he liked. To edge his way along the crowded paths +of life, warning all human sympathy to keep its distance, +was what the knowing ones call "nuts" to Scrooge. + +Once upon a time--of all the good days in the year, +on Christmas Eve--old Scrooge sat busy in his +counting-house. It was cold, bleak, biting weather: foggy +withal: and he could hear the people in the court outside, +go wheezing up and down, beating their hands +upon their breasts, and stamping their feet upon the +pavement stones to warm them. The city clocks had +only just gone three, but it was quite dark already-- +it had not been light all day--and candles were flaring +in the windows of the neighbouring offices, like +ruddy smears upon the palpable brown air. The fog +came pouring in at every chink and keyhole, and was +so dense without, that although the court was of the +narrowest, the houses opposite were mere phantoms. +To see the dingy cloud come drooping down, obscuring +everything, one might have thought that Nature +lived hard by, and was brewing on a large scale. + +The door of Scrooge's counting-house was open +that he might keep his eye upon his clerk, who in a +dismal little cell beyond, a sort of tank, was copying +letters. Scrooge had a very small fire, but the clerk's +fire was so very much smaller that it looked like one +coal. But he couldn't replenish it, for Scrooge kept +the coal-box in his own room; and so surely as the +clerk came in with the shovel, the master predicted +that it would be necessary for them to part. Wherefore +the clerk put on his white comforter, and tried to +warm himself at the candle; in which effort, not being +a man of a strong imagination, he failed. + +"A merry Christmas, uncle! God save you!" cried +a cheerful voice. It was the voice of Scrooge's +nephew, who came upon him so quickly that this was +the first intimation he had of his approach. + +"Bah!" said Scrooge, "Humbug!" + +He had so heated himself with rapid walking in the +fog and frost, this nephew of Scrooge's, that he was +all in a glow; his face was ruddy and handsome; his +eyes sparkled, and his breath smoked again. + +"Christmas a humbug, uncle!" said Scrooge's +nephew. "You don't mean that, I am sure?" + +"I do," said Scrooge. "Merry Christmas! What +right have you to be merry? What reason have you +to be merry? You're poor enough." + +"Come, then," returned the nephew gaily. "What +right have you to be dismal? What reason have you +to be morose? You're rich enough." + +Scrooge having no better answer ready on the spur +of the moment, said, "Bah!" again; and followed it up +with "Humbug." + +"Don't be cross, uncle!" said the nephew. + +"What else can I be," returned the uncle, "when I +live in such a world of fools as this? Merry Christmas! +Out upon merry Christmas! What's Christmas +time to you but a time for paying bills without +money; a time for finding yourself a year older, but +not an hour richer; a time for balancing your books +and having every item in 'em through a round dozen +of months presented dead against you? If I could +work my will," said Scrooge indignantly, "every idiot +who goes about with 'Merry Christmas' on his lips, +should be boiled with his own pudding, and buried +with a stake of holly through his heart. He should!" + +"Uncle!" pleaded the nephew. + +"Nephew!" returned the uncle sternly, "keep Christmas +in your own way, and let me keep it in mine." + +"Keep it!" repeated Scrooge's nephew. "But you +don't keep it." + +"Let me leave it alone, then," said Scrooge. "Much +good may it do you! Much good it has ever done +you!" + +"There are many things from which I might have +derived good, by which I have not profited, I dare +say," returned the nephew. "Christmas among the +rest. But I am sure I have always thought of Christmas +time, when it has come round--apart from the +veneration due to its sacred name and origin, if anything +belonging to it can be apart from that--as a +good time; a kind, forgiving, charitable, pleasant +time; the only time I know of, in the long calendar +of the year, when men and women seem by one consent +to open their shut-up hearts freely, and to think +of people below them as if they really were +fellow-passengers to the grave, and not another race +of creatures bound on other journeys. And therefore, +uncle, though it has never put a scrap of gold or +silver in my pocket, I believe that it has done me +good, and will do me good; and I say, God bless it!" + +The clerk in the Tank involuntarily applauded. +Becoming immediately sensible of the impropriety, +he poked the fire, and extinguished the last frail spark +for ever. + +"Let me hear another sound from you," said +Scrooge, "and you'll keep your Christmas by losing +your situation! You're quite a powerful speaker, +sir," he added, turning to his nephew. "I wonder you +don't go into Parliament." + +"Don't be angry, uncle. Come! Dine with us to-morrow." + +Scrooge said that he would see him--yes, indeed he +did. He went the whole length of the expression, +and said that he would see him in that extremity first. + +"But why?" cried Scrooge's nephew. "Why?" + +"Why did you get married?" said Scrooge. + +"Because I fell in love." + +"Because you fell in love!" growled Scrooge, as if +that were the only one thing in the world more ridiculous +than a merry Christmas. "Good afternoon!" + +"Nay, uncle, but you never came to see me before +that happened. Why give it as a reason for not +coming now?" + +"Good afternoon," said Scrooge. + +"I want nothing from you; I ask nothing of you; +why cannot we be friends?" + +"Good afternoon," said Scrooge. + +"I am sorry, with all my heart, to find you so +resolute. We have never had any quarrel, to which I +have been a party. But I have made the trial in +homage to Christmas, and I'll keep my Christmas +humour to the last. So A Merry Christmas, uncle!" + +"Good afternoon!" said Scrooge. + +"And A Happy New Year!" + +"Good afternoon!" said Scrooge. + +His nephew left the room without an angry word, +notwithstanding. He stopped at the outer door to +bestow the greetings of the season on the clerk, who, +cold as he was, was warmer than Scrooge; for he returned +them cordially. + +"There's another fellow," muttered Scrooge; who +overheard him: "my clerk, with fifteen shillings a +week, and a wife and family, talking about a merry +Christmas. I'll retire to Bedlam." + +This lunatic, in letting Scrooge's nephew out, had +let two other people in. They were portly gentlemen, +pleasant to behold, and now stood, with their hats off, +in Scrooge's office. They had books and papers in +their hands, and bowed to him. + +"Scrooge and Marley's, I believe," said one of the +gentlemen, referring to his list. "Have I the pleasure +of addressing Mr. Scrooge, or Mr. Marley?" + +"Mr. Marley has been dead these seven years," +Scrooge replied. "He died seven years ago, this very +night." + +"We have no doubt his liberality is well represented +by his surviving partner," said the gentleman, presenting +his credentials. + +It certainly was; for they had been two kindred +spirits. At the ominous word "liberality," Scrooge +frowned, and shook his head, and handed the credentials +back. + +"At this festive season of the year, Mr. Scrooge," +said the gentleman, taking up a pen, "it is more than +usually desirable that we should make some slight +provision for the Poor and destitute, who suffer +greatly at the present time. Many thousands are in +want of common necessaries; hundreds of thousands +are in want of common comforts, sir." + +"Are there no prisons?" asked Scrooge. + +"Plenty of prisons," said the gentleman, laying down +the pen again. + +"And the Union workhouses?" demanded Scrooge. +"Are they still in operation?" + +"They are. Still," returned the gentleman, "I wish +I could say they were not." + +"The Treadmill and the Poor Law are in full vigour, +then?" said Scrooge. + +"Both very busy, sir." + +"Oh! I was afraid, from what you said at first, +that something had occurred to stop them in their +useful course," said Scrooge. "I'm very glad to +hear it." + +"Under the impression that they scarcely furnish +Christian cheer of mind or body to the multitude," +returned the gentleman, "a few of us are endeavouring +to raise a fund to buy the Poor some meat and drink, +and means of warmth. We choose this time, because +it is a time, of all others, when Want is keenly felt, +and Abundance rejoices. What shall I put you down +for?" + +"Nothing!" Scrooge replied. + +"You wish to be anonymous?" + +"I wish to be left alone," said Scrooge. "Since you +ask me what I wish, gentlemen, that is my answer. +I don't make merry myself at Christmas and I can't +afford to make idle people merry. I help to support +the establishments I have mentioned--they cost +enough; and those who are badly off must go there." + +"Many can't go there; and many would rather die." + +"If they would rather die," said Scrooge, "they had +better do it, and decrease the surplus population. +Besides--excuse me--I don't know that." + +"But you might know it," observed the gentleman. + +"It's not my business," Scrooge returned. "It's +enough for a man to understand his own business, and +not to interfere with other people's. Mine occupies +me constantly. Good afternoon, gentlemen!" + +Seeing clearly that it would be useless to pursue +their point, the gentlemen withdrew. Scrooge resumed +his labours with an improved opinion of himself, +and in a more facetious temper than was usual +with him. + +Meanwhile the fog and darkness thickened so, that +people ran about with flaring links, proffering their +services to go before horses in carriages, and conduct +them on their way. The ancient tower of a church, +whose gruff old bell was always peeping slily down +at Scrooge out of a Gothic window in the wall, became +invisible, and struck the hours and quarters in the +clouds, with tremulous vibrations afterwards as if +its teeth were chattering in its frozen head up there. +The cold became intense. In the main street, at the +corner of the court, some labourers were repairing +the gas-pipes, and had lighted a great fire in a brazier, +round which a party of ragged men and boys were +gathered: warming their hands and winking their +eyes before the blaze in rapture. The water-plug +being left in solitude, its overflowings sullenly congealed, +and turned to misanthropic ice. The brightness +of the shops where holly sprigs and berries +crackled in the lamp heat of the windows, made pale +faces ruddy as they passed. Poulterers' and grocers' +trades became a splendid joke: a glorious pageant, +with which it was next to impossible to believe that +such dull principles as bargain and sale had anything +to do. The Lord Mayor, in the stronghold of the +mighty Mansion House, gave orders to his fifty cooks +and butlers to keep Christmas as a Lord Mayor's +household should; and even the little tailor, whom he +had fined five shillings on the previous Monday for +being drunk and bloodthirsty in the streets, stirred up +to-morrow's pudding in his garret, while his lean +wife and the baby sallied out to buy the beef. + +Foggier yet, and colder. Piercing, searching, biting +cold. If the good Saint Dunstan had but nipped +the Evil Spirit's nose with a touch of such weather +as that, instead of using his familiar weapons, then +indeed he would have roared to lusty purpose. The +owner of one scant young nose, gnawed and mumbled +by the hungry cold as bones are gnawed by dogs, +stooped down at Scrooge's keyhole to regale him with +a Christmas carol: but at the first sound of + +.. text deleted +.. "God bless you, merry gentleman! +.. May nothing you dismay!" + +Scrooge seized the ruler with such energy of action, +that the singer fled in terror, leaving the keyhole to +the fog and even more congenial frost. + +At length the hour of shutting up the counting-house +arrived. With an ill-will Scrooge dismounted from his +stool, and tacitly admitted the fact to the expectant +clerk in the Tank, who instantly snuffed his candle out, +and put on his hat. + +"You'll want all day to-morrow, I suppose?" said +Scrooge. + +"If quite convenient, sir." + +"It's not convenient," said Scrooge, "and it's not +fair. If I was to stop half-a-crown for it, you'd +think yourself ill-used, I'll be bound?" + +The clerk smiled faintly. + +"And yet," said Scrooge, "you don't think me ill-used, +when I pay a day's wages for no work." + +The clerk observed that it was only once a year. + +"A poor excuse for picking a man's pocket every +twenty-fifth of December!" said Scrooge, buttoning +his great-coat to the chin. "But I suppose you must +have the whole day. Be here all the earlier next +morning." + +The clerk promised that he would; and Scrooge +walked out with a growl. The office was closed in a +twinkling, and the clerk, with the long ends of his +white comforter dangling below his waist (for he +boasted no great-coat), went down a slide on Cornhill, +at the end of a lane of boys, twenty times, in +honour of its being Christmas Eve, and then ran home +to Camden Town as hard as he could pelt, to play +at blindman's-buff. + +Scrooge took his melancholy dinner in his usual +melancholy tavern; and having read all the newspapers, and +beguiled the rest of the evening with his +banker's-book, went home to bed. He lived in +chambers which had once belonged to his deceased +partner. They were a gloomy suite of rooms, in a +lowering pile of building up a yard, where it had so +little business to be, that one could scarcely help +fancying it must have run there when it was a young +house, playing at hide-and-seek with other houses, +and forgotten the way out again. It was old enough +now, and dreary enough, for nobody lived in it but +Scrooge, the other rooms being all let out as offices. +The yard was so dark that even Scrooge, who knew +its every stone, was fain to grope with his hands. +The fog and frost so hung about the black old gateway +of the house, that it seemed as if the Genius of +the Weather sat in mournful meditation on the +threshold. + +Now, it is a fact, that there was nothing at all +particular about the knocker on the door, except that it +was very large. It is also a fact, that Scrooge had +seen it, night and morning, during his whole residence +in that place; also that Scrooge had as little of what +is called fancy about him as any man in the city of +London, even including--which is a bold word--the +corporation, aldermen, and livery. Let it also be +borne in mind that Scrooge had not bestowed one +thought on Marley, since his last mention of his +seven years' dead partner that afternoon. And then +let any man explain to me, if he can, how it happened +that Scrooge, having his key in the lock of the door, +saw in the knocker, without its undergoing any intermediate +process of change--not a knocker, but Marley's face. + +Marley's face. It was not in impenetrable shadow +as the other objects in the yard were, but had a +dismal light about it, like a bad lobster in a dark +cellar. It was not angry or ferocious, but looked +at Scrooge as Marley used to look: with ghostly +spectacles turned up on its ghostly forehead. The +hair was curiously stirred, as if by breath or hot air; +and, though the eyes were wide open, they were perfectly +motionless. That, and its livid colour, made it +horrible; but its horror seemed to be in spite of the +face and beyond its control, rather than a part of +its own expression. + +As Scrooge looked fixedly at this phenomenon, it +was a knocker again. + +To say that he was not startled, or that his blood +was not conscious of a terrible sensation to which it +had been a stranger from infancy, would be untrue. +But he put his hand upon the key he had relinquished, +turned it sturdily, walked in, and lighted his candle. + +He did pause, with a moment's irresolution, before +he shut the door; and he did look cautiously behind +it first, as if he half expected to be terrified with the +sight of Marley's pigtail sticking out into the hall. +But there was nothing on the back of the door, except +the screws and nuts that held the knocker on, so he +said "Pooh, pooh!" and closed it with a bang. + +The sound resounded through the house like thunder. +Every room above, and every cask in the wine-merchant's +cellars below, appeared to have a separate peal +of echoes of its own. Scrooge was not a man to +be frightened by echoes. He fastened the door, and +walked across the hall, and up the stairs; slowly too: +trimming his candle as he went. + +You may talk vaguely about driving a coach-and-six +up a good old flight of stairs, or through a bad +young Act of Parliament; but I mean to say you +might have got a hearse up that staircase, and taken +it broadwise, with the splinter-bar towards the wall +and the door towards the balustrades: and done it +easy. There was plenty of width for that, and room +to spare; which is perhaps the reason why Scrooge +thought he saw a locomotive hearse going on before +him in the gloom. Half-a-dozen gas-lamps out of +the street wouldn't have lighted the entry too well, +so you may suppose that it was pretty dark with +Scrooge's dip. + +Up Scrooge went, not caring a button for that. +Darkness is cheap, and Scrooge liked it. But before +he shut his heavy door, he walked through his rooms +to see that all was right. He had just enough recollection +of the face to desire to do that. + +Sitting-room, bedroom, lumber-room. All as they +should be. Nobody under the table, nobody under +the sofa; a small fire in the grate; spoon and basin +ready; and the little saucepan of gruel (Scrooge had +a cold in his head) upon the hob. Nobody under the +bed; nobody in the closet; nobody in his dressing-gown, +which was hanging up in a suspicious attitude +against the wall. Lumber-room as usual. Old fire-guard, +old shoes, two fish-baskets, washing-stand on three +legs, and a poker. + +Quite satisfied, he closed his door, and locked +himself in; double-locked himself in, which was not his +custom. Thus secured against surprise, he took off +his cravat; put on his dressing-gown and slippers, and +his nightcap; and sat down before the fire to take +his gruel. + +It was a very low fire indeed; nothing on such a +bitter night. He was obliged to sit close to it, and +brood over it, before he could extract the least +sensation of warmth from such a handful of fuel. +The fireplace was an old one, built by some Dutch +merchant long ago, and paved all round with quaint +Dutch tiles, designed to illustrate the Scriptures. +There were Cains and Abels, Pharaoh's daughters; +Queens of Sheba, Angelic messengers descending +through the air on clouds like feather-beds, Abrahams, +Belshazzars, Apostles putting off to sea in butter-boats, +hundreds of figures to attract his thoughts; +and yet that face of Marley, seven years dead, came +like the ancient Prophet's rod, and swallowed up the +whole. If each smooth tile had been a blank at first, +with power to shape some picture on its surface from +the disjointed fragments of his thoughts, there would +have been a copy of old Marley's head on every one. + +"Humbug!" said Scrooge; and walked across the +room. + +After several turns, he sat down again. As he +threw his head back in the chair, his glance happened +to rest upon a bell, a disused bell, that hung in the +room, and communicated for some purpose now forgotten +with a chamber in the highest story of the +building. It was with great astonishment, and with +a strange, inexplicable dread, that as he looked, he +saw this bell begin to swing. It swung so softly in +the outset that it scarcely made a sound; but soon it +rang out loudly, and so did every bell in the house. + +This might have lasted half a minute, or a minute, +but it seemed an hour. The bells ceased as they had +begun, together. They were succeeded by a clanking +noise, deep down below; as if some person were +dragging a heavy chain over the casks in the +wine-merchant's cellar. Scrooge then remembered to have +heard that ghosts in haunted houses were described as +dragging chains. + +The cellar-door flew open with a booming sound, +and then he heard the noise much louder, on the floors +below; then coming up the stairs; then coming straight +towards his door. + +"It's humbug still!" said Scrooge. "I won't believe it." + +His colour changed though, when, without a pause, +it came on through the heavy door, and passed into +the room before his eyes. Upon its coming in, the +dying flame leaped up, as though it cried, "I know +him; Marley's Ghost!" and fell again. + +The same face: the very same. Marley in his pigtail, +usual waistcoat, tights and boots; the tassels on +the latter bristling, like his pigtail, and his coat-skirts, +and the hair upon his head. The chain he drew was +clasped about his middle. It was long, and wound +about him like a tail; and it was made (for Scrooge +observed it closely) of cash-boxes, keys, padlocks, +ledgers, deeds, and heavy purses wrought in steel. +His body was transparent; so that Scrooge, observing him, +and looking through his waistcoat, could see +the two buttons on his coat behind. + +Scrooge had often heard it said that Marley had no +bowels, but he had never believed it until now. + +No, nor did he believe it even now. Though he +looked the phantom through and through, and saw +it standing before him; though he felt the chilling +influence of its death-cold eyes; and marked the very +texture of the folded kerchief bound about its head +and chin, which wrapper he had not observed before; +he was still incredulous, and fought against his senses. + +"How now!" said Scrooge, caustic and cold as ever. +"What do you want with me?" + +"Much!"--Marley's voice, no doubt about it. + +"Who are you?" + +"Ask me who I was." + +"Who were you then?" said Scrooge, raising his +voice. "You're particular, for a shade." He was going +to say "to a shade," but substituted this, as more +appropriate. + +"In life I was your partner, Jacob Marley." + +"Can you--can you sit down?" asked Scrooge, looking +doubtfully at him. + +"I can." + +"Do it, then." + +Scrooge asked the question, because he didn't know +whether a ghost so transparent might find himself in +a condition to take a chair; and felt that in the event +of its being impossible, it might involve the necessity +of an embarrassing explanation. But the ghost sat +down on the opposite side of the fireplace, as if he +were quite used to it. + +"You don't believe in me," observed the Ghost. + +"I don't," said Scrooge. + +"What evidence would you have of my reality beyond that of +your senses?" + +"I don't know," said Scrooge. + +"Why do you doubt your senses?" + +"Because," said Scrooge, "a little thing affects them. +A slight disorder of the stomach makes them cheats. You may +be an undigested bit of beef, a blot of mustard, a crumb of +cheese, a fragment of an underdone potato. There's more of +gravy than of grave about you, whatever you are!" + +Scrooge was not much in the habit of cracking +jokes, nor did he feel, in his heart, by any means +waggish then. The truth is, that he tried to be +smart, as a means of distracting his own attention, +and keeping down his terror; for the spectre's voice +disturbed the very marrow in his bones. + +To sit, staring at those fixed glazed eyes, in silence +for a moment, would play, Scrooge felt, the very +deuce with him. There was something very awful, +too, in the spectre's being provided with an infernal +atmosphere of its own. Scrooge could not feel it +himself, but this was clearly the case; for though the +Ghost sat perfectly motionless, its hair, and skirts, +and tassels, were still agitated as by the hot vapour +from an oven. + +"You see this toothpick?" said Scrooge, returning +quickly to the charge, for the reason just assigned; +and wishing, though it were only for a second, to +divert the vision's stony gaze from himself. + +"I do," replied the Ghost. + +"You are not looking at it," said Scrooge. + +"But I see it," said the Ghost, "notwithstanding." + +"Well!" returned Scrooge, "I have but to swallow +this, and be for the rest of my days persecuted by a +legion of goblins, all of my own creation. Humbug, +I tell you! humbug!" + +At this the spirit raised a frightful cry, and shook +its chain with such a dismal and appalling noise, that +Scrooge held on tight to his chair, to save himself +from falling in a swoon. But how much greater was +his horror, when the phantom taking off the bandage +round its head, as if it were too warm to wear indoors, +its lower jaw dropped down upon its breast! + +Scrooge fell upon his knees, and clasped his hands +before his face. + +"Mercy!" he said. "Dreadful apparition, why do +you trouble me?" + +"Man of the worldly mind!" replied the Ghost, "do +you believe in me or not?" + +"I do," said Scrooge. "I must. But why do spirits +walk the earth, and why do they come to me?" + +"It is required of every man," the Ghost returned, +"that the spirit within him should walk abroad among +his fellowmen, and travel far and wide; and if that +spirit goes not forth in life, it is condemned to do so +after death. It is doomed to wander through the +world--oh, woe is me!--and witness what it cannot +share, but might have shared on earth, and turned to +happiness!" + +Again the spectre raised a cry, and shook its chain +and wrung its shadowy hands. + +"You are fettered," said Scrooge, trembling. "Tell +me why?" + +"I wear the chain I forged in life," replied the Ghost. +"I made it link by link, and yard by yard; I girded +it on of my own free will, and of my own free will I +wore it. Is its pattern strange to you?" + +Scrooge trembled more and more. + +"Or would you know," pursued the Ghost, "the +weight and length of the strong coil you bear yourself? +It was full as heavy and as long as this, seven +Christmas Eves ago. You have laboured on it, since. +It is a ponderous chain!" + +Scrooge glanced about him on the floor, in the +expectation of finding himself surrounded by some fifty +or sixty fathoms of iron cable: but he could see +nothing. + +"Jacob," he said, imploringly. "Old Jacob Marley, +tell me more. Speak comfort to me, Jacob!" + +"I have none to give," the Ghost replied. "It comes +from other regions, Ebenezer Scrooge, and is conveyed +by other ministers, to other kinds of men. Nor +can I tell you what I would. A very little more is +all permitted to me. I cannot rest, I cannot stay, I +cannot linger anywhere. My spirit never walked +beyond our counting-house--mark me!--in life my +spirit never roved beyond the narrow limits of our +money-changing hole; and weary journeys lie before +me!" + +It was a habit with Scrooge, whenever he became +thoughtful, to put his hands in his breeches pockets. +Pondering on what the Ghost had said, he did so now, +but without lifting up his eyes, or getting off his +knees. + +"You must have been very slow about it, Jacob," +Scrooge observed, in a business-like manner, though +with humility and deference. + +"Slow!" the Ghost repeated. + +"Seven years dead," mused Scrooge. "And travelling +all the time!" + +"The whole time," said the Ghost. "No rest, no +peace. Incessant torture of remorse." + +"You travel fast?" said Scrooge. + +"On the wings of the wind," replied the Ghost. + +"You might have got over a great quantity of +ground in seven years," said Scrooge. + +The Ghost, on hearing this, set up another cry, and +clanked its chain so hideously in the dead silence of +the night, that the Ward would have been justified in +indicting it for a nuisance. + +"Oh! captive, bound, and double-ironed," cried the +phantom, "not to know, that ages of incessant labour +by immortal creatures, for this earth must pass into +eternity before the good of which it is susceptible is +all developed. Not to know that any Christian spirit +working kindly in its little sphere, whatever it may +be, will find its mortal life too short for its vast +means of usefulness. Not to know that no space of +regret can make amends for one life's opportunity +misused! Yet such was I! Oh! such was I!" + +"But you were always a good man of business, +Jacob," faltered Scrooge, who now began to apply this +to himself. + +"Business!" cried the Ghost, wringing its hands +again. "Mankind was my business. The common +welfare was my business; charity, mercy, forbearance, +and benevolence, were, all, my business. The dealings +of my trade were but a drop of water in the +comprehensive ocean of my business!" + +It held up its chain at arm's length, as if that were +the cause of all its unavailing grief, and flung it +heavily upon the ground again. + +"At this time of the rolling year," the spectre said, +"I suffer most. Why did I walk through crowds of +fellow-beings with my eyes turned down, and never +raise them to that blessed Star which led the Wise +Men to a poor abode! Were there no poor homes to +which its light would have conducted me!" + +Scrooge was very much dismayed to hear the +spectre going on at this rate, and began to quake +exceedingly. + +"Hear me!" cried the Ghost. "My time is nearly +gone." + +"I will," said Scrooge. "But don't be hard upon +me! Don't be flowery, Jacob! Pray!" + +"How it is that I appear before you in a shape that +you can see, I may not tell. I have sat invisible +beside you many and many a day." + +It was not an agreeable idea. Scrooge shivered, +and wiped the perspiration from his brow. + +"That is no light part of my penance," pursued +the Ghost. "I am here to-night to warn you, that you +have yet a chance and hope of escaping my fate. A +chance and hope of my procuring, Ebenezer." + +"You were always a good friend to me," said +Scrooge. "Thank'ee!" + +"You will be haunted," resumed the Ghost, "by +Three Spirits." + +Scrooge's countenance fell almost as low as the +Ghost's had done. + +"Is that the chance and hope you mentioned, +Jacob?" he demanded, in a faltering voice. + +"It is." + +"I--I think I'd rather not," said Scrooge. + +"Without their visits," said the Ghost, "you cannot +hope to shun the path I tread. Expect the first to-morrow, +when the bell tolls One." + +"Couldn't I take 'em all at once, and have it over, +Jacob?" hinted Scrooge. + +"Expect the second on the next night at the same +hour. The third upon the next night when the last +stroke of Twelve has ceased to vibrate. Look to see +me no more; and look that, for your own sake, you +remember what has passed between us!" + +When it had said these words, the spectre took its +wrapper from the table, and bound it round its head, +as before. Scrooge knew this, by the smart sound its +teeth made, when the jaws were brought together +by the bandage. He ventured to raise his eyes again, +and found his supernatural visitor confronting him +in an erect attitude, with its chain wound over and +about its arm. + +The apparition walked backward from him; and at +every step it took, the window raised itself a little, +so that when the spectre reached it, it was wide open. + +It beckoned Scrooge to approach, which he did. +When they were within two paces of each other, +Marley's Ghost held up its hand, warning him to +come no nearer. Scrooge stopped. + +Not so much in obedience, as in surprise and fear: +for on the raising of the hand, he became sensible +of confused noises in the air; incoherent sounds of +lamentation and regret; wailings inexpressibly sorrowful and +self-accusatory. The spectre, after listening for a moment, +joined in the mournful dirge; and floated out upon the +bleak, dark night. + +Scrooge followed to the window: desperate in his +curiosity. He looked out. + +The air was filled with phantoms, wandering hither +and thither in restless haste, and moaning as they +went. Every one of them wore chains like Marley's +Ghost; some few (they might be guilty governments) +were linked together; none were free. Many had +been personally known to Scrooge in their lives. He +had been quite familiar with one old ghost, in a white +waistcoat, with a monstrous iron safe attached to +its ankle, who cried piteously at being unable to assist +a wretched woman with an infant, whom it saw below, +upon a door-step. The misery with them all was, +clearly, that they sought to interfere, for good, in +human matters, and had lost the power for ever. + +Whether these creatures faded into mist, or mist +enshrouded them, he could not tell. But they and +their spirit voices faded together; and the night became +as it had been when he walked home. + +Scrooge closed the window, and examined the door +by which the Ghost had entered. It was double-locked, +as he had locked it with his own hands, and +the bolts were undisturbed. He tried to say "Humbug!" +but stopped at the first syllable. And being, +from the emotion he had undergone, or the fatigues +of the day, or his glimpse of the Invisible World, or +the dull conversation of the Ghost, or the lateness of +the hour, much in need of repose; went straight to +bed, without undressing, and fell asleep upon the +instant. + + +STAVE II: THE FIRST OF THE THREE SPIRITS + +.. _target: + +The hyperlink target above points to this paragraph. + + +Internal hyperlink targets may be "chained". Multiple adjacent internal hyperlink targets all point to the same element: + +.. _target1: + +The targets "target1" and "target2" are synonyms; they both +point to this paragraph. + +If the element "pointed to" is an external hyperlink target (with a URI in its link block; see #2 below) the URI from the external hyperlink target is propagated to the internal hyperlink targets; they will all "point to" the same URI. There is no need to duplicate a URI. For example, all three of the following hyperlink targets refer to the same URI: + +.. _Python DOC-SIG mailing list archive: +.. _archive: +.. _Doc-SIG: http://mail.python.org/pipermail/doc-sig/ + +point 2 + +External hyperlink targets have an absolute or relative URI or email address in their link blocks. For example, take the following input: + +See the Python_ home page for info. + +`Write to me`_ with your questions. + +.. _Python: http://www.python.org +.. _Write to me: jdoe@example.com + +After processing into HTML, the hyperlinks might be expressed as: + +See the <a href="http://www.python.org">Python</a> home page +for info. + +<a href="mailto:jdoe@example.com">Write to me</a> with your +questions. + +An external hyperlink's URI may begin on the same line as the explicit markup start and target name, or it may begin in an indented text block immediately following, with no intervening blank lines. If there are multiple lines in the link block, they are concatenated. Any whitespace is removed (whitespace is permitted to allow for line wrapping). The following external hyperlink targets are equivalent: + +.. _one-liner: http://docutils.sourceforge.net/rst.html + +.. _starts-on-this-line: http:// + docutils.sourceforge.net/rst.html + +.. _entirely-below: + http://docutils. + sourceforge.net/rst.html + +If an external hyperlink target's URI contains an underscore as its last character, it must be escaped to avoid being mistaken for an indirect hyperlink target: + +This link_ refers to a file called 'underscore'. + +.. _link: underscore\_ + +It is possible (although not generally recommended) to include URIs directly within hyperlink references. See Embedded URIs below. + +See `the web site of my favorite programming language`__. + +Anonymous targets begin with ".. __:"; no reference name is required or allowed: + +.. __: http://www.python.org + diff --git a/sandbox/paultremblay/python_interface/test_files/image.rst b/sandbox/paultremblay/python_interface/test_files/image.rst new file mode 100644 index 000000000..4884ee5dd --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/image.rst @@ -0,0 +1,18 @@ +text before pict + +.. image:: badaman_treasure_chest.png + :scale: 25 % + :alt: a picture of a chest + :align: right + +text between pict + +.. image:: badaman_treasure_chest.svg + :height: 100px + :width: 200 px + :scale: 50 % + :alt: alternate text + :align: right + +text after pict + diff --git a/sandbox/paultremblay/python_interface/test_files/inline.rst b/sandbox/paultremblay/python_interface/test_files/inline.rst new file mode 100644 index 000000000..d497a39e8 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/inline.rst @@ -0,0 +1,13 @@ +.. $Id$ + +A line with *italics* and **bold**. + +Test "quotes." + +For an inline literal: ``literal *italic* *bold* text`` + +This is `interpreted text`. + +Oh yes, the _`Norwegian Blue`. What's, um, what's wrong with it? + + diff --git a/sandbox/paultremblay/python_interface/test_files/line_block.rst b/sandbox/paultremblay/python_interface/test_files/line_block.rst new file mode 100644 index 000000000..f59620982 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/line_block.rst @@ -0,0 +1,59 @@ +.. role:: title + +Text before block. + +| Lend us a couple of bob till Thursday. +| I'm absolutely skint. +| But I'm expecting a postal order and I can pay you back + as soon as it comes. +| Love, Ewan. + +This example illustrates the nesting of line blocks, indicated by the initial indentation of new lines: + +Take it away, Eric the Orchestra Leader! + +| A one, two, a one two three four +| +| Half a bee, philosophically, +| must, *ipso facto*, half not be. +| But half the bee has got to be, +| *vis a vis* its entity. D'you see? +| +| But can a bee be said to be +| or not to be an entire bee, +| when half the bee is not a bee, +| due to some ancient injury? +| +| Singing... + + +"To Ma Own Beloved Lassie: A Poem on her 17th Birthday", by +Ewan McTeagle (for Lassie O'Shea): + +.. line-block:: + + Lend us a couple of bob till Thursday. + I'm absolutely skint. + But I'm expecting a postal order and I can pay you back + as soon as it comes. + Love, Ewan. + +Take it away, Eric the Orchestra Leader! + + +| `stanza title 1` +| A one, two, a one two three four +| +| `stanza title 2` +| Half a bee, philosophically, +| must, *ipso facto*, half not be. +| But half the bee has got to be, +| *vis a vis* its entity. D'you see? +| +| stanza title 3 :title:`x` +| But can a bee be said to be +| or not to be an entire bee, +| when half the bee is not a bee, +| due to some ancient injury? +| +| Singing... diff --git a/sandbox/paultremblay/python_interface/test_files/literal_block.rst b/sandbox/paultremblay/python_interface/test_files/literal_block.rst new file mode 100644 index 000000000..c81a8002e --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/literal_block.rst @@ -0,0 +1,23 @@ +.. an example of code + +.. $Id$ + +Python code is below:: + + def make_attribute_set(the_name, the_dict): + sys.stdout.write('<xsl:attribute-set name="%s">\n' % (the_name)) + the_keys = the_dict.keys() + the_keys.sort() + for the_key in the_keys: + sys.stdout.write(' <xsl:attribute name="%s">' % (the_key)) + sys.stdout.write(the_dict[the_key]) + sys.stdout.write('</xsl:attribute>\n') + sys.stdout.write('</xsl:attribute-set>\n\n') + sys.stdout.write(""" + <xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <xsl:import href="%s"/> + """ % (stylesheet)) diff --git a/sandbox/paultremblay/python_interface/test_files/long_plain.rst b/sandbox/paultremblay/python_interface/test_files/long_plain.rst new file mode 100644 index 000000000..864aab44b --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/long_plain.rst @@ -0,0 +1,946 @@ +MARLEY was dead: to begin with. There is no doubt +whatever about that. The register of his burial was +signed by the clergyman, the clerk, the undertaker, +and the chief mourner. Scrooge signed it: and +Scrooge's name was good upon 'Change, for anything he +chose to put his hand to. Old Marley was as dead as a +door-nail. + +Mind! I don't mean to say that I know, of my +own knowledge, what there is particularly dead about +a door-nail. I might have been inclined, myself, to +regard a coffin-nail as the deadest piece of ironmongery +in the trade. But the wisdom of our ancestors +is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that +Marley was as dead as a door-nail. + +Scrooge knew he was dead? Of course he did. +How could it be otherwise? Scrooge and he were +partners for I don't know how many years. Scrooge +was his sole executor, his sole administrator, his sole +assign, his sole residuary legatee, his sole friend, and +sole mourner. And even Scrooge was not so dreadfully +cut up by the sad event, but that he was an excellent +man of business on the very day of the funeral, +and solemnised it with an undoubted bargain. + +The mention of Marley's funeral brings me back to +the point I started from. There is no doubt that Marley +was dead. This must be distinctly understood, or +nothing wonderful can come of the story I am going +to relate. If we were not perfectly convinced that +Hamlet's Father died before the play began, there +would be nothing more remarkable in his taking a +stroll at night, in an easterly wind, upon his own ramparts, +than there would be in any other middle-aged +gentleman rashly turning out after dark in a breezy +spot--say Saint Paul's Churchyard for instance-- +literally to astonish his son's weak mind. + +Scrooge never painted out Old Marley's name. +There it stood, years afterwards, above the warehouse +door: Scrooge and Marley. The firm was known as +Scrooge and Marley. Sometimes people new to the +business called Scrooge Scrooge, and sometimes Marley, +but he answered to both names. It was all the +same to him. + +Oh! But he was a tight-fisted hand at the grind-stone, +Scrooge! a squeezing, wrenching, grasping, scraping, +clutching, covetous, old sinner! Hard and sharp as flint, +from which no steel had ever struck out generous fire; +secret, and self-contained, and solitary as an oyster. The +cold within him froze his old features, nipped his pointed +nose, shrivelled his cheek, stiffened his gait; made his +eyes red, his thin lips blue; and spoke out shrewdly in his +grating voice. A frosty rime was on his head, and on his +eyebrows, and his wiry chin. He carried his own low +temperature always about with him; he iced his office in +the dog-days; and didn't thaw it one degree at Christmas. + +External heat and cold had little influence on +Scrooge. No warmth could warm, no wintry weather +chill him. No wind that blew was bitterer than he, +no falling snow was more intent upon its purpose, no +pelting rain less open to entreaty. Foul weather didn't +know where to have him. The heaviest rain, and +snow, and hail, and sleet, could boast of the advantage +over him in only one respect. They often "came down" +handsomely, and Scrooge never did. + +Nobody ever stopped him in the street to say, with +gladsome looks, "My dear Scrooge, how are you? +When will you come to see me?" No beggars implored +him to bestow a trifle, no children asked him +what it was o'clock, no man or woman ever once in all +his life inquired the way to such and such a place, of +Scrooge. Even the blind men's dogs appeared to +know him; and when they saw him coming on, would +tug their owners into doorways and up courts; and +then would wag their tails as though they said, "No +eye at all is better than an evil eye, dark master!" + +But what did Scrooge care! It was the very thing +he liked. To edge his way along the crowded paths +of life, warning all human sympathy to keep its distance, +was what the knowing ones call "nuts" to Scrooge. + +Once upon a time--of all the good days in the year, +on Christmas Eve--old Scrooge sat busy in his +counting-house. It was cold, bleak, biting weather: foggy +withal: and he could hear the people in the court outside, +go wheezing up and down, beating their hands +upon their breasts, and stamping their feet upon the +pavement stones to warm them. The city clocks had +only just gone three, but it was quite dark already-- +it had not been light all day--and candles were flaring +in the windows of the neighbouring offices, like +ruddy smears upon the palpable brown air. The fog +came pouring in at every chink and keyhole, and was +so dense without, that although the court was of the +narrowest, the houses opposite were mere phantoms. +To see the dingy cloud come drooping down, obscuring +everything, one might have thought that Nature +lived hard by, and was brewing on a large scale. + +The door of Scrooge's counting-house was open +that he might keep his eye upon his clerk, who in a +dismal little cell beyond, a sort of tank, was copying +letters. Scrooge had a very small fire, but the clerk's +fire was so very much smaller that it looked like one +coal. But he couldn't replenish it, for Scrooge kept +the coal-box in his own room; and so surely as the +clerk came in with the shovel, the master predicted +that it would be necessary for them to part. Wherefore +the clerk put on his white comforter, and tried to +warm himself at the candle; in which effort, not being +a man of a strong imagination, he failed. + +"A merry Christmas, uncle! God save you!" cried +a cheerful voice. It was the voice of Scrooge's +nephew, who came upon him so quickly that this was +the first intimation he had of his approach. + +"Bah!" said Scrooge, "Humbug!" + +He had so heated himself with rapid walking in the +fog and frost, this nephew of Scrooge's, that he was +all in a glow; his face was ruddy and handsome; his +eyes sparkled, and his breath smoked again. + +"Christmas a humbug, uncle!" said Scrooge's +nephew. "You don't mean that, I am sure?" + +"I do," said Scrooge. "Merry Christmas! What +right have you to be merry? What reason have you +to be merry? You're poor enough." + +"Come, then," returned the nephew gaily. "What +right have you to be dismal? What reason have you +to be morose? You're rich enough." + +Scrooge having no better answer ready on the spur +of the moment, said, "Bah!" again; and followed it up +with "Humbug." + +"Don't be cross, uncle!" said the nephew. + +"What else can I be," returned the uncle, "when I +live in such a world of fools as this? Merry Christmas! +Out upon merry Christmas! What's Christmas +time to you but a time for paying bills without +money; a time for finding yourself a year older, but +not an hour richer; a time for balancing your books +and having every item in 'em through a round dozen +of months presented dead against you? If I could +work my will," said Scrooge indignantly, "every idiot +who goes about with 'Merry Christmas' on his lips, +should be boiled with his own pudding, and buried +with a stake of holly through his heart. He should!" + +"Uncle!" pleaded the nephew. + +"Nephew!" returned the uncle sternly, "keep Christmas +in your own way, and let me keep it in mine." + +"Keep it!" repeated Scrooge's nephew. "But you +don't keep it." + +"Let me leave it alone, then," said Scrooge. "Much +good may it do you! Much good it has ever done +you!" + +"There are many things from which I might have +derived good, by which I have not profited, I dare +say," returned the nephew. "Christmas among the +rest. But I am sure I have always thought of Christmas +time, when it has come round--apart from the +veneration due to its sacred name and origin, if anything +belonging to it can be apart from that--as a +good time; a kind, forgiving, charitable, pleasant +time; the only time I know of, in the long calendar +of the year, when men and women seem by one consent +to open their shut-up hearts freely, and to think +of people below them as if they really were +fellow-passengers to the grave, and not another race +of creatures bound on other journeys. And therefore, +uncle, though it has never put a scrap of gold or +silver in my pocket, I believe that it has done me +good, and will do me good; and I say, God bless it!" + +The clerk in the Tank involuntarily applauded. +Becoming immediately sensible of the impropriety, +he poked the fire, and extinguished the last frail spark +for ever. + +"Let me hear another sound from you," said +Scrooge, "and you'll keep your Christmas by losing +your situation! You're quite a powerful speaker, +sir," he added, turning to his nephew. "I wonder you +don't go into Parliament." + +"Don't be angry, uncle. Come! Dine with us to-morrow." + +Scrooge said that he would see him--yes, indeed he +did. He went the whole length of the expression, +and said that he would see him in that extremity first. + +"But why?" cried Scrooge's nephew. "Why?" + +"Why did you get married?" said Scrooge. + +"Because I fell in love." + +"Because you fell in love!" growled Scrooge, as if +that were the only one thing in the world more ridiculous +than a merry Christmas. "Good afternoon!" + +"Nay, uncle, but you never came to see me before +that happened. Why give it as a reason for not +coming now?" + +"Good afternoon," said Scrooge. + +"I want nothing from you; I ask nothing of you; +why cannot we be friends?" + +"Good afternoon," said Scrooge. + +"I am sorry, with all my heart, to find you so +resolute. We have never had any quarrel, to which I +have been a party. But I have made the trial in +homage to Christmas, and I'll keep my Christmas +humour to the last. So A Merry Christmas, uncle!" + +"Good afternoon!" said Scrooge. + +"And A Happy New Year!" + +"Good afternoon!" said Scrooge. + +His nephew left the room without an angry word, +notwithstanding. He stopped at the outer door to +bestow the greetings of the season on the clerk, who, +cold as he was, was warmer than Scrooge; for he returned +them cordially. + +"There's another fellow," muttered Scrooge; who +overheard him: "my clerk, with fifteen shillings a +week, and a wife and family, talking about a merry +Christmas. I'll retire to Bedlam." + +This lunatic, in letting Scrooge's nephew out, had +let two other people in. They were portly gentlemen, +pleasant to behold, and now stood, with their hats off, +in Scrooge's office. They had books and papers in +their hands, and bowed to him. + +"Scrooge and Marley's, I believe," said one of the +gentlemen, referring to his list. "Have I the pleasure +of addressing Mr. Scrooge, or Mr. Marley?" + +"Mr. Marley has been dead these seven years," +Scrooge replied. "He died seven years ago, this very +night." + +"We have no doubt his liberality is well represented +by his surviving partner," said the gentleman, presenting +his credentials. + +It certainly was; for they had been two kindred +spirits. At the ominous word "liberality," Scrooge +frowned, and shook his head, and handed the credentials +back. + +"At this festive season of the year, Mr. Scrooge," +said the gentleman, taking up a pen, "it is more than +usually desirable that we should make some slight +provision for the Poor and destitute, who suffer +greatly at the present time. Many thousands are in +want of common necessaries; hundreds of thousands +are in want of common comforts, sir." + +"Are there no prisons?" asked Scrooge. + +"Plenty of prisons," said the gentleman, laying down +the pen again. + +"And the Union workhouses?" demanded Scrooge. +"Are they still in operation?" + +"They are. Still," returned the gentleman, "I wish +I could say they were not." + +"The Treadmill and the Poor Law are in full vigour, +then?" said Scrooge. + +"Both very busy, sir." + +"Oh! I was afraid, from what you said at first, +that something had occurred to stop them in their +useful course," said Scrooge. "I'm very glad to +hear it." + +"Under the impression that they scarcely furnish +Christian cheer of mind or body to the multitude," +returned the gentleman, "a few of us are endeavouring +to raise a fund to buy the Poor some meat and drink, +and means of warmth. We choose this time, because +it is a time, of all others, when Want is keenly felt, +and Abundance rejoices. What shall I put you down +for?" + +"Nothing!" Scrooge replied. + +"You wish to be anonymous?" + +"I wish to be left alone," said Scrooge. "Since you +ask me what I wish, gentlemen, that is my answer. +I don't make merry myself at Christmas and I can't +afford to make idle people merry. I help to support +the establishments I have mentioned--they cost +enough; and those who are badly off must go there." + +"Many can't go there; and many would rather die." + +"If they would rather die," said Scrooge, "they had +better do it, and decrease the surplus population. +Besides--excuse me--I don't know that." + +"But you might know it," observed the gentleman. + +"It's not my business," Scrooge returned. "It's +enough for a man to understand his own business, and +not to interfere with other people's. Mine occupies +me constantly. Good afternoon, gentlemen!" + +Seeing clearly that it would be useless to pursue +their point, the gentlemen withdrew. Scrooge resumed +his labours with an improved opinion of himself, +and in a more facetious temper than was usual +with him. + +Meanwhile the fog and darkness thickened so, that +people ran about with flaring links, proffering their +services to go before horses in carriages, and conduct +them on their way. The ancient tower of a church, +whose gruff old bell was always peeping slily down +at Scrooge out of a Gothic window in the wall, became +invisible, and struck the hours and quarters in the +clouds, with tremulous vibrations afterwards as if +its teeth were chattering in its frozen head up there. +The cold became intense. In the main street, at the +corner of the court, some labourers were repairing +the gas-pipes, and had lighted a great fire in a brazier, +round which a party of ragged men and boys were +gathered: warming their hands and winking their +eyes before the blaze in rapture. The water-plug +being left in solitude, its overflowings sullenly congealed, +and turned to misanthropic ice. The brightness +of the shops where holly sprigs and berries +crackled in the lamp heat of the windows, made pale +faces ruddy as they passed. Poulterers' and grocers' +trades became a splendid joke: a glorious pageant, +with which it was next to impossible to believe that +such dull principles as bargain and sale had anything +to do. The Lord Mayor, in the stronghold of the +mighty Mansion House, gave orders to his fifty cooks +and butlers to keep Christmas as a Lord Mayor's +household should; and even the little tailor, whom he +had fined five shillings on the previous Monday for +being drunk and bloodthirsty in the streets, stirred up +to-morrow's pudding in his garret, while his lean +wife and the baby sallied out to buy the beef. + +Foggier yet, and colder. Piercing, searching, biting +cold. If the good Saint Dunstan had but nipped +the Evil Spirit's nose with a touch of such weather +as that, instead of using his familiar weapons, then +indeed he would have roared to lusty purpose. The +owner of one scant young nose, gnawed and mumbled +by the hungry cold as bones are gnawed by dogs, +stooped down at Scrooge's keyhole to regale him with +a Christmas carol: but at the first sound of + +.. text deleted +.. "God bless you, merry gentleman! +.. May nothing you dismay!" + +Scrooge seized the ruler with such energy of action, +that the singer fled in terror, leaving the keyhole to +the fog and even more congenial frost. + +At length the hour of shutting up the counting-house +arrived. With an ill-will Scrooge dismounted from his +stool, and tacitly admitted the fact to the expectant +clerk in the Tank, who instantly snuffed his candle out, +and put on his hat. + +"You'll want all day to-morrow, I suppose?" said +Scrooge. + +"If quite convenient, sir." + +"It's not convenient," said Scrooge, "and it's not +fair. If I was to stop half-a-crown for it, you'd +think yourself ill-used, I'll be bound?" + +The clerk smiled faintly. + +"And yet," said Scrooge, "you don't think me ill-used, +when I pay a day's wages for no work." + +The clerk observed that it was only once a year. + +"A poor excuse for picking a man's pocket every +twenty-fifth of December!" said Scrooge, buttoning +his great-coat to the chin. "But I suppose you must +have the whole day. Be here all the earlier next +morning." + +The clerk promised that he would; and Scrooge +walked out with a growl. The office was closed in a +twinkling, and the clerk, with the long ends of his +white comforter dangling below his waist (for he +boasted no great-coat), went down a slide on Cornhill, +at the end of a lane of boys, twenty times, in +honour of its being Christmas Eve, and then ran home +to Camden Town as hard as he could pelt, to play +at blindman's-buff. + +Scrooge took his melancholy dinner in his usual +melancholy tavern; and having read all the newspapers, and +beguiled the rest of the evening with his +banker's-book, went home to bed. He lived in +chambers which had once belonged to his deceased +partner. They were a gloomy suite of rooms, in a +lowering pile of building up a yard, where it had so +little business to be, that one could scarcely help +fancying it must have run there when it was a young +house, playing at hide-and-seek with other houses, +and forgotten the way out again. It was old enough +now, and dreary enough, for nobody lived in it but +Scrooge, the other rooms being all let out as offices. +The yard was so dark that even Scrooge, who knew +its every stone, was fain to grope with his hands. +The fog and frost so hung about the black old gateway +of the house, that it seemed as if the Genius of +the Weather sat in mournful meditation on the +threshold. + +Now, it is a fact, that there was nothing at all +particular about the knocker on the door, except that it +was very large. It is also a fact, that Scrooge had +seen it, night and morning, during his whole residence +in that place; also that Scrooge had as little of what +is called fancy about him as any man in the city of +London, even including--which is a bold word--the +corporation, aldermen, and livery. Let it also be +borne in mind that Scrooge had not bestowed one +thought on Marley, since his last mention of his +seven years' dead partner that afternoon. And then +let any man explain to me, if he can, how it happened +that Scrooge, having his key in the lock of the door, +saw in the knocker, without its undergoing any intermediate +process of change--not a knocker, but Marley's face. + +Marley's face. It was not in impenetrable shadow +as the other objects in the yard were, but had a +dismal light about it, like a bad lobster in a dark +cellar. It was not angry or ferocious, but looked +at Scrooge as Marley used to look: with ghostly +spectacles turned up on its ghostly forehead. The +hair was curiously stirred, as if by breath or hot air; +and, though the eyes were wide open, they were perfectly +motionless. That, and its livid colour, made it +horrible; but its horror seemed to be in spite of the +face and beyond its control, rather than a part of +its own expression. + +As Scrooge looked fixedly at this phenomenon, it +was a knocker again. + +To say that he was not startled, or that his blood +was not conscious of a terrible sensation to which it +had been a stranger from infancy, would be untrue. +But he put his hand upon the key he had relinquished, +turned it sturdily, walked in, and lighted his candle. + +He did pause, with a moment's irresolution, before +he shut the door; and he did look cautiously behind +it first, as if he half expected to be terrified with the +sight of Marley's pigtail sticking out into the hall. +But there was nothing on the back of the door, except +the screws and nuts that held the knocker on, so he +said "Pooh, pooh!" and closed it with a bang. + +The sound resounded through the house like thunder. +Every room above, and every cask in the wine-merchant's +cellars below, appeared to have a separate peal +of echoes of its own. Scrooge was not a man to +be frightened by echoes. He fastened the door, and +walked across the hall, and up the stairs; slowly too: +trimming his candle as he went. + +You may talk vaguely about driving a coach-and-six +up a good old flight of stairs, or through a bad +young Act of Parliament; but I mean to say you +might have got a hearse up that staircase, and taken +it broadwise, with the splinter-bar towards the wall +and the door towards the balustrades: and done it +easy. There was plenty of width for that, and room +to spare; which is perhaps the reason why Scrooge +thought he saw a locomotive hearse going on before +him in the gloom. Half-a-dozen gas-lamps out of +the street wouldn't have lighted the entry too well, +so you may suppose that it was pretty dark with +Scrooge's dip. + +Up Scrooge went, not caring a button for that. +Darkness is cheap, and Scrooge liked it. But before +he shut his heavy door, he walked through his rooms +to see that all was right. He had just enough recollection +of the face to desire to do that. + +Sitting-room, bedroom, lumber-room. All as they +should be. Nobody under the table, nobody under +the sofa; a small fire in the grate; spoon and basin +ready; and the little saucepan of gruel (Scrooge had +a cold in his head) upon the hob. Nobody under the +bed; nobody in the closet; nobody in his dressing-gown, +which was hanging up in a suspicious attitude +against the wall. Lumber-room as usual. Old fire-guard, +old shoes, two fish-baskets, washing-stand on three +legs, and a poker. + +Quite satisfied, he closed his door, and locked +himself in; double-locked himself in, which was not his +custom. Thus secured against surprise, he took off +his cravat; put on his dressing-gown and slippers, and +his nightcap; and sat down before the fire to take +his gruel. + +It was a very low fire indeed; nothing on such a +bitter night. He was obliged to sit close to it, and +brood over it, before he could extract the least +sensation of warmth from such a handful of fuel. +The fireplace was an old one, built by some Dutch +merchant long ago, and paved all round with quaint +Dutch tiles, designed to illustrate the Scriptures. +There were Cains and Abels, Pharaoh's daughters; +Queens of Sheba, Angelic messengers descending +through the air on clouds like feather-beds, Abrahams, +Belshazzars, Apostles putting off to sea in butter-boats, +hundreds of figures to attract his thoughts; +and yet that face of Marley, seven years dead, came +like the ancient Prophet's rod, and swallowed up the +whole. If each smooth tile had been a blank at first, +with power to shape some picture on its surface from +the disjointed fragments of his thoughts, there would +have been a copy of old Marley's head on every one. + +"Humbug!" said Scrooge; and walked across the +room. + +After several turns, he sat down again. As he +threw his head back in the chair, his glance happened +to rest upon a bell, a disused bell, that hung in the +room, and communicated for some purpose now forgotten +with a chamber in the highest story of the +building. It was with great astonishment, and with +a strange, inexplicable dread, that as he looked, he +saw this bell begin to swing. It swung so softly in +the outset that it scarcely made a sound; but soon it +rang out loudly, and so did every bell in the house. + +This might have lasted half a minute, or a minute, +but it seemed an hour. The bells ceased as they had +begun, together. They were succeeded by a clanking +noise, deep down below; as if some person were +dragging a heavy chain over the casks in the +wine-merchant's cellar. Scrooge then remembered to have +heard that ghosts in haunted houses were described as +dragging chains. + +The cellar-door flew open with a booming sound, +and then he heard the noise much louder, on the floors +below; then coming up the stairs; then coming straight +towards his door. + +"It's humbug still!" said Scrooge. "I won't believe it." + +His colour changed though, when, without a pause, +it came on through the heavy door, and passed into +the room before his eyes. Upon its coming in, the +dying flame leaped up, as though it cried, "I know +him; Marley's Ghost!" and fell again. + +The same face: the very same. Marley in his pigtail, +usual waistcoat, tights and boots; the tassels on +the latter bristling, like his pigtail, and his coat-skirts, +and the hair upon his head. The chain he drew was +clasped about his middle. It was long, and wound +about him like a tail; and it was made (for Scrooge +observed it closely) of cash-boxes, keys, padlocks, +ledgers, deeds, and heavy purses wrought in steel. +His body was transparent; so that Scrooge, observing him, +and looking through his waistcoat, could see +the two buttons on his coat behind. + +Scrooge had often heard it said that Marley had no +bowels, but he had never believed it until now. + +No, nor did he believe it even now. Though he +looked the phantom through and through, and saw +it standing before him; though he felt the chilling +influence of its death-cold eyes; and marked the very +texture of the folded kerchief bound about its head +and chin, which wrapper he had not observed before; +he was still incredulous, and fought against his senses. + +"How now!" said Scrooge, caustic and cold as ever. +"What do you want with me?" + +"Much!"--Marley's voice, no doubt about it. + +"Who are you?" + +"Ask me who I was." + +"Who were you then?" said Scrooge, raising his +voice. "You're particular, for a shade." He was going +to say "to a shade," but substituted this, as more +appropriate. + +"In life I was your partner, Jacob Marley." + +"Can you--can you sit down?" asked Scrooge, looking +doubtfully at him. + +"I can." + +"Do it, then." + +Scrooge asked the question, because he didn't know +whether a ghost so transparent might find himself in +a condition to take a chair; and felt that in the event +of its being impossible, it might involve the necessity +of an embarrassing explanation. But the ghost sat +down on the opposite side of the fireplace, as if he +were quite used to it. + +"You don't believe in me," observed the Ghost. + +"I don't," said Scrooge. + +"What evidence would you have of my reality beyond that of +your senses?" + +"I don't know," said Scrooge. + +"Why do you doubt your senses?" + +"Because," said Scrooge, "a little thing affects them. +A slight disorder of the stomach makes them cheats. You may +be an undigested bit of beef, a blot of mustard, a crumb of +cheese, a fragment of an underdone potato. There's more of +gravy than of grave about you, whatever you are!" + +Scrooge was not much in the habit of cracking +jokes, nor did he feel, in his heart, by any means +waggish then. The truth is, that he tried to be +smart, as a means of distracting his own attention, +and keeping down his terror; for the spectre's voice +disturbed the very marrow in his bones. + +To sit, staring at those fixed glazed eyes, in silence +for a moment, would play, Scrooge felt, the very +deuce with him. There was something very awful, +too, in the spectre's being provided with an infernal +atmosphere of its own. Scrooge could not feel it +himself, but this was clearly the case; for though the +Ghost sat perfectly motionless, its hair, and skirts, +and tassels, were still agitated as by the hot vapour +from an oven. + +"You see this toothpick?" said Scrooge, returning +quickly to the charge, for the reason just assigned; +and wishing, though it were only for a second, to +divert the vision's stony gaze from himself. + +"I do," replied the Ghost. + +"You are not looking at it," said Scrooge. + +"But I see it," said the Ghost, "notwithstanding." + +"Well!" returned Scrooge, "I have but to swallow +this, and be for the rest of my days persecuted by a +legion of goblins, all of my own creation. Humbug, +I tell you! humbug!" + +At this the spirit raised a frightful cry, and shook +its chain with such a dismal and appalling noise, that +Scrooge held on tight to his chair, to save himself +from falling in a swoon. But how much greater was +his horror, when the phantom taking off the bandage +round its head, as if it were too warm to wear indoors, +its lower jaw dropped down upon its breast! + +Scrooge fell upon his knees, and clasped his hands +before his face. + +"Mercy!" he said. "Dreadful apparition, why do +you trouble me?" + +"Man of the worldly mind!" replied the Ghost, "do +you believe in me or not?" + +"I do," said Scrooge. "I must. But why do spirits +walk the earth, and why do they come to me?" + +"It is required of every man," the Ghost returned, +"that the spirit within him should walk abroad among +his fellowmen, and travel far and wide; and if that +spirit goes not forth in life, it is condemned to do so +after death. It is doomed to wander through the +world--oh, woe is me!--and witness what it cannot +share, but might have shared on earth, and turned to +happiness!" + +Again the spectre raised a cry, and shook its chain +and wrung its shadowy hands. + +"You are fettered," said Scrooge, trembling. "Tell +me why?" + +"I wear the chain I forged in life," replied the Ghost. +"I made it link by link, and yard by yard; I girded +it on of my own free will, and of my own free will I +wore it. Is its pattern strange to you?" + +Scrooge trembled more and more. + +"Or would you know," pursued the Ghost, "the +weight and length of the strong coil you bear yourself? +It was full as heavy and as long as this, seven +Christmas Eves ago. You have laboured on it, since. +It is a ponderous chain!" + +Scrooge glanced about him on the floor, in the +expectation of finding himself surrounded by some fifty +or sixty fathoms of iron cable: but he could see +nothing. + +"Jacob," he said, imploringly. "Old Jacob Marley, +tell me more. Speak comfort to me, Jacob!" + +"I have none to give," the Ghost replied. "It comes +from other regions, Ebenezer Scrooge, and is conveyed +by other ministers, to other kinds of men. Nor +can I tell you what I would. A very little more is +all permitted to me. I cannot rest, I cannot stay, I +cannot linger anywhere. My spirit never walked +beyond our counting-house--mark me!--in life my +spirit never roved beyond the narrow limits of our +money-changing hole; and weary journeys lie before +me!" + +It was a habit with Scrooge, whenever he became +thoughtful, to put his hands in his breeches pockets. +Pondering on what the Ghost had said, he did so now, +but without lifting up his eyes, or getting off his +knees. + +"You must have been very slow about it, Jacob," +Scrooge observed, in a business-like manner, though +with humility and deference. + +"Slow!" the Ghost repeated. + +"Seven years dead," mused Scrooge. "And travelling +all the time!" + +"The whole time," said the Ghost. "No rest, no +peace. Incessant torture of remorse." + +"You travel fast?" said Scrooge. + +"On the wings of the wind," replied the Ghost. + +"You might have got over a great quantity of +ground in seven years," said Scrooge. + +The Ghost, on hearing this, set up another cry, and +clanked its chain so hideously in the dead silence of +the night, that the Ward would have been justified in +indicting it for a nuisance. + +"Oh! captive, bound, and double-ironed," cried the +phantom, "not to know, that ages of incessant labour +by immortal creatures, for this earth must pass into +eternity before the good of which it is susceptible is +all developed. Not to know that any Christian spirit +working kindly in its little sphere, whatever it may +be, will find its mortal life too short for its vast +means of usefulness. Not to know that no space of +regret can make amends for one life's opportunity +misused! Yet such was I! Oh! such was I!" + +"But you were always a good man of business, +Jacob," faltered Scrooge, who now began to apply this +to himself. + +"Business!" cried the Ghost, wringing its hands +again. "Mankind was my business. The common +welfare was my business; charity, mercy, forbearance, +and benevolence, were, all, my business. The dealings +of my trade were but a drop of water in the +comprehensive ocean of my business!" + +It held up its chain at arm's length, as if that were +the cause of all its unavailing grief, and flung it +heavily upon the ground again. + +"At this time of the rolling year," the spectre said, +"I suffer most. Why did I walk through crowds of +fellow-beings with my eyes turned down, and never +raise them to that blessed Star which led the Wise +Men to a poor abode! Were there no poor homes to +which its light would have conducted me!" + +Scrooge was very much dismayed to hear the +spectre going on at this rate, and began to quake +exceedingly. + +"Hear me!" cried the Ghost. "My time is nearly +gone." + +"I will," said Scrooge. "But don't be hard upon +me! Don't be flowery, Jacob! Pray!" + +"How it is that I appear before you in a shape that +you can see, I may not tell. I have sat invisible +beside you many and many a day." + +It was not an agreeable idea. Scrooge shivered, +and wiped the perspiration from his brow. + +"That is no light part of my penance," pursued +the Ghost. "I am here to-night to warn you, that you +have yet a chance and hope of escaping my fate. A +chance and hope of my procuring, Ebenezer." + +"You were always a good friend to me," said +Scrooge. "Thank'ee!" + +"You will be haunted," resumed the Ghost, "by +Three Spirits." + +Scrooge's countenance fell almost as low as the +Ghost's had done. + +"Is that the chance and hope you mentioned, +Jacob?" he demanded, in a faltering voice. + +"It is." + +"I--I think I'd rather not," said Scrooge. + +"Without their visits," said the Ghost, "you cannot +hope to shun the path I tread. Expect the first to-morrow, +when the bell tolls One." + +"Couldn't I take 'em all at once, and have it over, +Jacob?" hinted Scrooge. + +"Expect the second on the next night at the same +hour. The third upon the next night when the last +stroke of Twelve has ceased to vibrate. Look to see +me no more; and look that, for your own sake, you +remember what has passed between us!" + +When it had said these words, the spectre took its +wrapper from the table, and bound it round its head, +as before. Scrooge knew this, by the smart sound its +teeth made, when the jaws were brought together +by the bandage. He ventured to raise his eyes again, +and found his supernatural visitor confronting him +in an erect attitude, with its chain wound over and +about its arm. + +The apparition walked backward from him; and at +every step it took, the window raised itself a little, +so that when the spectre reached it, it was wide open. + +It beckoned Scrooge to approach, which he did. +When they were within two paces of each other, +Marley's Ghost held up its hand, warning him to +come no nearer. Scrooge stopped. + +Not so much in obedience, as in surprise and fear: +for on the raising of the hand, he became sensible +of confused noises in the air; incoherent sounds of +lamentation and regret; wailings inexpressibly sorrowful and +self-accusatory. The spectre, after listening for a moment, +joined in the mournful dirge; and floated out upon the +bleak, dark night. + +Scrooge followed to the window: desperate in his +curiosity. He looked out. + +The air was filled with phantoms, wandering hither +and thither in restless haste, and moaning as they +went. Every one of them wore chains like Marley's +Ghost; some few (they might be guilty governments) +were linked together; none were free. Many had +been personally known to Scrooge in their lives. He +had been quite familiar with one old ghost, in a white +waistcoat, with a monstrous iron safe attached to +its ankle, who cried piteously at being unable to assist +a wretched woman with an infant, whom it saw below, +upon a door-step. The misery with them all was, +clearly, that they sought to interfere, for good, in +human matters, and had lost the power for ever. + +Whether these creatures faded into mist, or mist +enshrouded them, he could not tell. But they and +their spirit voices faded together; and the night became +as it had been when he walked home. + +Scrooge closed the window, and examined the door +by which the Ghost had entered. It was double-locked, +as he had locked it with his own hands, and +the bolts were undisturbed. He tried to say "Humbug!" +but stopped at the first syllable. And being, +from the emotion he had undergone, or the fatigues +of the day, or his glimpse of the Invisible World, or +the dull conversation of the Ghost, or the lateness of +the hour, much in need of repose; went straight to +bed, without undressing, and fell asleep upon the +instant. + + +STAVE II: THE FIRST OF THE THREE SPIRITS diff --git a/sandbox/paultremblay/python_interface/test_files/long_table.csv b/sandbox/paultremblay/python_interface/test_files/long_table.csv new file mode 100644 index 000000000..dac790fa4 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/long_table.csv @@ -0,0 +1,389 @@ +"Cincinatti, OH (26 W. Fifth St.)",Plan to build new building.,Jan 1935
+"Brooklyn, NY (1468 Kings Highway)",Alterations to existing store.,Jan 1935
+"Libertyville,IL (New Castle Block)",No details given.,Feb 1935
+"New York, NY (2829 Broadway)",No details given.,Feb 1935
+"Nyack, NY (92 Main St.)",Leased store.,Feb 1935
+"Fire Points, AL (20th St.)",New Store.,March 1935
+"Merrifield, OR (253 Broadway)",New Unit.,March 1935
+"Durham, NC",New 2-story unit.,March 1935
+"Norway, OK",Enlarged Store.,March 1935
+"Decatur, GA (116 Ponce de Leon Ave.)",Leased.,April 1935
+"Philadelphia, PA (6118 Landsdowne Ave.)",Contemplate opening.,April 1935
+"Ticonderoga, NY (Moncalm St.)",Will open store.,May1935
+"Aurora, IL (12 S. Broadway)",Leased building which will be erected at location. ,May1935
+"St. Louis, MO (Corner of Grand Blvd. and Olive St.)",Leased additional space in basement of store.,May1935
+"Kingston, PA (200 Wyoming Ave.)",Leased at location where a new unit will open in July.,June1935
+"Brooklyn, NY (1242 Fulton St.)","Leased at location, possession of which will be taken about July1.",June1935
+"Endicott, NY (28 & 30 Washington Ave.)","Purchased the 2 properties, where new store will open around Sept1.",July1935
+"Decatur, GA (E. Ponce De Leon Ave.)",Opened.,July1935
+"McPherson, KS (105 N. Main St.)",Opened.,July1935
+"Princeton, IL",Will open.,July1935
+"Mt. Vernon, NY (S. 4th Ave. & 2nd St.)",Will open and erect store.,July1935
+"Cincinnati, OH (26 W. 5th St.)","Will open, replacing present store at that location.",July1935
+"Louisville, KY (634 S. 4th St.)",Leased building which will be erected.,August 1935
+"Darby, PA (878 Main St.)",Leased.,August 1935
+"Darrielson, CT (91 Main St.)",Will open.,August 1935
+"Westboro, MA (91 W. Main & Milk St.)",Will open.,August 1935
+"Framingham, MA",Erecting addition to store building.,August 1935
+"Big Spring, TX",Will open.,Sept 1935
+"Westwood, NJ (corner of Westwood & Center Ave.)",Will erect new building.,Sept 1935
+"New Orleans, LA (8207 Oak St.)",Leased additional space in existing building.,Sept 1935
+"Chicago, IL (corner of Milwaukee & N. Central Park Ave.)",Leased space formerly occupied by 2nd Northwestern Bank.,Sept 1935
+"Bucyrus, OH",Expanding unit.,Sept 1935
+"Princeton, IL (S. Main St.)",Opened.,Oct 1935
+"Marion, IL",Opened.,Oct 1935
+"St. Louis, MO (6231 Natural Bridge Rd.)",Leased.,Oct 1935
+"Globe, AZ",Erecting building.,Oct 1935
+"Globe, AZ",Opened Rabogliatti building.,Nov 1935
+"Luzerrne, PA (90 Main St.)",Opened.,Nov 1935
+"Cleveland, OH (5656 Broadway Ave.)",Purchased site for new building.,Nov 1935
+"Bronx, NY (34 Westchester Sq.)",Erect new building.,Nov 1935
+"Andover, MA (Main St.)",Will open.,Nov 1935
+"Westwood, NJ (Westwood Center Ave.)",Opened.,Dec 1935
+"Aurora, IL (19 S. Broadway)",Opened.,Jan 1936
+"Neenah, WI (Commercial St. & Wisconsin Ave.)",Will open.,Jan 1936
+"Durham, NC (124 Main St. (and adjoining store)","Purchase building which adjoins existing store Expensive improvementswill be made to the property after January, 1938.",Jan 1936
+"Dallas, TX (124 N.W. corner of Main and Stone St.)",Leased two-story building.,Jan 1936
+"Cleveland, OH (E. 185th St. & Claire Dr.)",Erecting one-story building.,Jan 1936
+"Greenville, SC (7 N. Main St. and the entire Beattie building cornerof Main & Wasting St.)",Leased building. Will be remodelled.,Jan 1936
+"Des Moines, IA (609 Walnut St.)","Remodelling store, including $20,000 of interior redecoration, air-conditioning,and lunch counter.",Feb 1936
+"Athens, TN",New unit will open in the building which is to be erected.,Feb 1936
+"Mexico, MO",Opening new store in former Mexico Savings Bank and Craddock buildings.,March 1936
+"Charlotte, NC (112-118 Tyron St.)","Leased property where a 3-story building will be erected at the costof $50,000, including air conditioning and other modern devices.",March 1936
+"Madison, WI (E. Main St.)","Will erect a building at the cost of $20,000",March 1936
+"Roanoke, VA (26 W. Campbell Dr.)","Will extend sales space. New extension will enlarge present salesspace. Cost of interior and exterior alterations, amounting to about$10,000",March 1936
+"Portland, ME (540 Congress St.)","Enlarging store with the construction of an addition at the rear.Other expensive changes will be made in the store- new windows andentrances, with the cost of approximately $75,000; new lunch counteralong nearly all the west side of stainless steel, in modernisticdesign and new kitchen.",March 1936
+"Corinth, MS (Waldron St.)","Opening new store, one half of second floor will be used for storage.",April 1936
+"Johnson City, NY (Main St.)",Purchased Endwell Theatre building that Woolworth will demolish andreplace with modern fireproof building.,April 1936
+"Teaneck, NJ (Corner of Cedar Ln. & Garrison Ave.)","Leased building under construction, where a new building will openaround June.",April 1936
+"Annapolis, MD (Main St.)",Enlarging store.,April 1936
+"New Bedford, MA (838 Purchase St.)",Enlarging store.,April 1936
+"Charleston, SC (259 King St.)","Remodeling and enlarging store at a cost of $45,000. Removing woodfloors to replace with concrete with composition tile. Second floorfor stock and kitchen. The front will probably be terra cotta, limestoneor face brick. Using dumbwaiter between kitchen and lunch counter;air conditioning.",April 1936
+"Webster City, IA (2nd St. & Wilson Ave.)",Opened.,May 1936
+"LaCrosse, WI (422 Main St.)",Opened.,May 1936
+"Albany, NY (145 Central Ave.)",Leased 2-story building where a new unit will be opened after alterationshave been made.,May 1936
+"Jamaica, NY (Corner of Jamaica Ave. & 3rd St.)","Leased Burdin's Department Store, a 4-story building.",May 1936
+"Chicago, IL (7122 Central Ave.)","Additional space leased. Will be remodeled at a cost of $17,000.",May 1936
+"Milwaukee, WI (N. 3rd St. & Wisconsin Ave.)",Will be doubled in size.,May 1936
+"Englewood, NJ (Palisade Ave.)",Negotiations for the erection of a 2-story building.,May 1936
+"Olean, NY (157 N. Union St.)",Opened new store.,June 1936
+"Jamestown, NY (N. Main St. & W 3rd St.)","Leased Pendegast building, which will be replaced by a new 2-storybuilding to be completed December 1.",June 1936
+"Rome, NY (121 W. Dorrinide St.)","Leased building, which will be replaced by a new 2-story building.",June 1936
+"Macomb, IL",Leased the Stocker building. A new store will open on July 1.,June 1936
+"Baltimore, MD (229 Marion St.)",Lease 4-story warehouse which adjoins rear of store at Lexington St.,June 1936
+"Miami, FL (S. Beach St. & Magnolia Ave.)","Enlarging store. Lunch counterrenovated, new counters, storefront refinished.",June 1936
+"Fairfield, VA","Enlarging store by acquiring adjoining building and removing partywall at a cost of $12,000",June 1936
+"Cherokee, IA","Enlarging at a cost of $8,000",June 1936
+"Richmond, VA (Campbell St.)",Remodeled interior and new store front.,June 1936
+"Bellaire, OH (33rd & Belmont St.)",Remodeled interior and new store front.,June 1936
+"Newburgh, NY (60 Water St.)",Purchased property.,July 1936
+"Endicott, NY (28 &30 Washington Ave.)",Purchased 2 parcel property and erected new building on entire site.,July 1936
+"Carthage, NY (259 & 261 State St.)",Leased properties. 1-story and basement addition being built and newstore will open in the fall.,July 1936
+"Richmond, VA (3018 W. Cary St.)",New store opened.,July 1936
+"Edinburg, TX","Enlarged store, including putting in new counters and soda fountain.",July 1936
+"Ft. Wayne, IN (726 S. Calhoun St.)","Remodeling for $50,000.",July 1936
+"Santa Clara, CA (107 W. 4th St.)",Expanding unit.,July 1936
+"New York City, NY (8th Ave.)","Leased ground floor, basement, and sub-basement.Nine stores have opened since the beginning of 1936, with 11 additionalstores scheduled to open by December.",July 1936
+"Defiance, OH (408 Clinton St.)","Leased property, rebuilding at a cost of $20,000.",Aug 1936
+"Rutland, VT (80 Merchants Row)","Reopened, enlarged, and redecorated.",Aug 1936
+"Salina, KS","Reopened, enlarged, and redecorated.",Aug 1936
+"St. Cloud, MN","Remodeled store with new luncheonette, counters of black structuralglass, new kitchen in basement connect by dumbwaiter to luncheonette.",Aug 1936
+"Milburn, NJ (321 Milburn Ave.)",Leased building.,Aug 1936
+"Newton, NJ (Spring St.)","Reopened, enlarged, and remodeled store.",Aug 1936
+"Dallas, TX","Reopened, enlarged, and remodeled store.",Aug 1936
+"Minneapolis, MN (7th St. & Nicklet Ave.)","Exterior of Indiana limestone and aluminum spandrels with base ofblack granite. Stainless steel used for front entrances and interiortrimmings. Basement, first and second floors used for sales space.Fourth and fifth floors used for reserve stock. Escalator connectingbasement, first, and second levels. Store to open by Christmas.",Sept 1936
+Greenville PA (214 Main St.),Will build 1-story building.,Sept 1936
+"Glouchester, MA (Main St. & Pleasant St.)",Will build 1-story building.,Sept 1936
+"New York, NY (80 Nassau St. & 9 Dutch St.)",Leased ground floor and basement of Nassau St. building plus 4-storybuilding being built at the Dutch St. location; will largely be usedfor storage.,Sept 1936
+"Cedar Falls, IA (313 & 315 Main St. )","Remodeled recently leased buildings. Party wall to be removed. Plansinclude a new front and heating plant at a cost of $14,000.",Sept 1936
+"Beaver Falls, PA (1122 7th Ave. )",2-story addition.,Sept 1936
+"Berkley, CA (2118 Shattuck Ave. )","Modernized store, including a new fountain with luncheonette withbackground of tile facing with peach colored plate glass mirrors trimmedin stainless steel.",Sept 1936
+"Kinston, NY (315 Wall St.)",Bought 3-story building.,Oct 1936
+"Jasper, AL",Leased the lobby and second floor of Hotel Crawford first and thesecond floor of Central Bank & Trust Co. To be converted to one store.,Oct 1936
+"St. Louis, MO (NW corner of 39th St. & Debony St.)",Leased modern 2-story building to be erected. New store to have 78foot frontage and 60 foot depth.,Oct 1936
+"Jersey City, NJ",Planning to enlarge building.,Oct 1936
+"New York, NY (corner of 163rd St. & Jamaica Ave.)",Opened new store.,Nov 1936
+"Evanston, IL (825 Davis St.)","Enlarging store, installing a lunch counter of 108 feet.",Nov 1936
+"Canandarqua, NY (825 S. Main St.)",Enlarged and remodelled.,Nov 1936
+"Buffalo, NY (Broadway St.)","Acquired property adjoining store, doubling size of unit.",Nov 1936
+"Winfield, KS (Main St.)","Enlarge and remodeled store at a cost of $10,000. The extension willbe a modernistic design with a base of marble, and will include newcounters, floors and ceilings.",Nov 1936
+"Canon City, CO",Enlarged store.,Nov 1936
+"Greenville, SC (Main St. & Washington St.)",A new store will opened around November 15.,Nov 1936
+"Philadelphia, PA (sw corner 52 St. & Market St.)","New store. 14,000 square feet of merchandising space with air conditioningand a large lunch counter.",Dec 1936
+"Pitman, NJ (110 S. Broadway St.)",New Store.,Dec 1936
+"Bethlehem, Pa","Enlarged store to twice its original size. New fixtures were installed.The cost is approximately $65,000.",Dec 1936
+"Antigo, WI","Extensive improvements. Front entirely rebuilt, interior renovatedand redecorated. Lighting system improved.",Dec 1936
+"El Dorado, KS",Enlarged and remodeled store. Floor space doubled and additional countersadded.,Dec 1936
+"St. Martins Ferry, OH (S. 4th St.)","Leased Yingling block, adjoining existing store. Party wall to beremoved.",Dec 1936
+"Anderson, SC","Enlarged store by acquiring adjacent building. Cost of remodelingand new equipment will be $17,000.",Jan 1937
+"Des Moines, IA (Walnut St.)",New storefront. Remodeled kitchen with new luncheonette with lightingand air conditioning.,Jan 1937
+"Evansville, IN",Air conditioning and 2 new electric dumbwaiters.,Jan 1937
+"Chico, CA",Enlarged with new lighting.,Jan 1937
+"Lynn, MA",Enlarged.,Jan 1937
+"York, NE",Enlarged.,Jan 1937
+"Twin Falls, MN","Enlarged, including 4 entrances, luncheonette, all-electric kitchenequipment.",Jan 1937
+"Brooklyn, NY (406 Fulton St.)","Leased 3-story building at a cost of $225,000. Air conditioned basement.Main floor for sales, the rest for stock.",Jan 1937
+"Jersey City, NJ (912 S. Bergen Ave.)","Leased store which adjoins present unit. Will have 10,000 square feet.",Jan 1937
+"Salt Lake City, UT (225 S. Main St.)","Building 3-story unit at a cost of $225,000 plus a cost of $100,000for fixtures and furnishings. First floor for sales, second floorfor employees, third for stock and kitchen department. Air conditioning.",Jan 1937
+"Findlay, OH (336 S. Main St.)","Remodeled and enlarged, including granite store front, increased windowdisplay and HVAC.",Jan 1937
+"Jamestown, NY (corner Main St. and 4th St.)","Store interior modernistic features decorated in red and white withthe back wall in cream tile, trimmed with gun metal. Replaced storeat 705 N. Main St.",Feb 1937
+"Rockeford, IL (307 W. State St.)","Opened enlarged store with new improvements, including air conditioningand soda fountain.",Feb 1937
+"Seattle, WA (3rd Ave. & Pike St.)",Leased building.,Feb 1937
+"Madison, WI (Oak St.)","Leased building, where new store will open in April.",Feb 1937
+"Goldsboro, NC (N. Center St.)",Will build modern unit on site of present store.,Feb 1937
+"New York, NY (corner of 39th and 5th Ave.)",Company will build 6-story unit. \emph{Authors note: This is the flagshipWonder Store.},March 1937
+"Johnstown, PA (corner Main and Franklin St.)",Will open store around April 1.,March 1937
+"Cleveland, OH (Detroit Rd. at Rocky River)",Leased store and basement; will open a new store April 1.,March 1937
+"Brunswick, ME (94 Main St.)",Leased store. A new unit will be build around July 1.,March 1937
+"Nashua, NH (97 Main St.)","Purchased parcel, where store will open on May 1.",March 1937
+"Middletown, CT (428 Main St.)",Purchased parcel.,March 1937
+"Ogdensberg, NY (206 Ford St.)",Purchased property.,March 1937
+"Evanston, IL (Davis and Benson St.)","Alterations and addition at a cost of $100,000, including new lighting,lunch counter--108 foot-long, modernistic counters, air conditioning.Complete redecoration.",March 1937
+"Winnetta, IL (806 Elm St.)",Another store will be opened.,March 1937
+"Everett, WA (Hewitt Ave. and Colby Ave.)",Leased store.,April 1937
+"Belvidere, IL",Enlarging store by acquiring additional space.,April 1937
+"Lynchburg, VA (808 Main Ave.)","Leased building adjoining location, possession of which will be takenin January 1939. The present store will be enlarged.",April 1937
+"Oklahoma City, OK (219 S.W. 25 St. Capitol Hill )","Leased building, which will be remodeled at a cost of $25,000.",May 1937
+"Cleveland Heights, OH (2206 Noble Rd.)",Leased store in building to be erected,May 1937
+"Santa Cruz, CA","Improvements made to soda fountain, including dumbwaiter, new glassand chrome soda fountain.",May 1937
+"Burlington, VT (Church St.)","Enlarging store by acquiring street floor and basement, south of presentunit.",May 1937
+"San Jose, CA (29 S. St.)","Will erect 2-story building, which will be joined with present quarters.",May 1937
+"Columbus, OH (109 High St.)","The company leased the 3-story building to be erected at location.It will have a basement, sub-basement, two freight elevators, threedumbwaiters, and air conditioning.",May 1937
+"West Philadelphia, PA (6928-6932 Elmwood Ave.)",Opened store at location.,June 1937
+"Manchester, NH (977 Elm St.)","Will expand the store by taking over the two floors above the store.Will give the unit 20,000sq. ft. ",June 1937
+"Stocketon, CA (414 E. Main St.)","Remodeled and enlarged store at a cost of $150,000.",June 1937
+"McComb, MS (Main St.)","Leased additional space in the Beard building at this location. Improvementincluded a new, larger soda fountain, a new lunch counter, and a kitchenin the basement with a dumbwaiter.",June 1937
+"Oakland, CA (Washington St.)","Plans to enlarge and modernize the store by the addition of 100 feetof frontage. Also, new modern fixtures will be installed.",June 1937
+"Miami Beach, FL (543 Washington Ave.)","Leased the $40,000 building, to be erected at this location. It willbe occupied by September 1.",July 1937
+"Fresno, CA (N.E. corner of Fulton St. and Kern)","Leased Fall Building, to be remodeled at a cost of approximately $150,000and will open around May 1, 1938. It replace the present buildingat 932 Fulton St.",July 1937
+"Newark, NJ (S. Main St.)","Purchased property and will erect a 1-story building at this location,replacing the present building. It is reported that the new storewill cost about $50,000 and will be completed in November.",July 1937
+"Allentown, PA (733-735 Hamilton St.)",Purchased the Stopp Estate Building.,July 1937
+"Danville, VA (corner of Main St. and Union St.)",Opening new unit.,July 1937
+"Kalamazoo, MI (S. Burdick St.)",Erecting addition to store.,July 1937
+"Tuscon, AZ","Leased the first floor and basement of the Central Building, whereWoolworth already has a store. The acquisition of additional spacewill give the store approximately 8100 feet of floor space and alterationswill be made as soon as it is taken over.",Aug 1937
+"Cincinnati, OH (Opera Pl. and Race St.)","Plan to enlarge present store at this location, where Woolworth hasleased the 1-story and basement buildings. To be erected after thefirst year. The new store will have air conditioning and new fixtures,",Aug 1937
+"Bellaire, WV (Belmont St.)","About $10,000 will be spent installing a modern front and improvingthe interior of the store.",Aug 1937
+"Raleigh, NC","Remodeled unit at a cost of $60,000. Improvements include installationof lunch counter, air-conditioning, new drop lighting fixtures.",Aug 1937
+"Brooklyn, NY (366 Fulton St.)","Opened a new unit in the 4-story building, constructed of limestoneand polished black granite with aluminum window spandrels and stainlesssteel trimming. The store has air-conditioning and new bakery. Floorsconstructed of marble with counters of walnut.",Aug 1937
+"Lock Haven, PA","Remodeled store, including new soda fountain and restaurant unit withchromium and black color scheme, as well as sixteen new counters withchromium fixtures.",Aug 1937
+"Phoenixville, PA (Bridge St.)",Opened a new building. Counter fixtures are of chromium.,Sept 1937
+"Mayfair section of Philadelphia, PA (7310 Frankford Ave.)",Leased building.,Sept 1937
+"Mishawaka, IN (Lincoln Way West)","Leased the Century Theatre Building, which will be cut-down to a modernstructure and then enlarged by a 20-foot extension in the rear.",Sept 1937
+"Alexandria, LA (3rd St.)","Leased the building, which is now owned by Scott-Burr stores.",Sept 1937
+"Salisbury, NC (S. Main St.)","Enlarged and modernized store. Two-story addition has been added inthe rear, as well as a new lighting system, a new heating plant, anew ventilating system, and a new lunch counter.",Oct 1937
+"Roanoke Rapids, NC (Roanoke Ave. and 10th St.)",Opened store.,Nov 1937
+"Johnstown, PA (Main St. and Franklin St.)","Moved store to the new location. New store has 20,000 square feetof selling space, a fountain, a luncheonette which runs the entirelength of the store, and air conditioning.",Nov 1937
+"Salem, MA (198 Essex St.)","Erecting a $30,000 addition to store, which will give it over 200feet more counter space. A fountain and a luncheonette will be installed,new lighting.",Nov 1937
+"Atlanta, GA (197 Peachtree St.)","After 30 years of leasing the property at this location, Woolworthwill take possession of it in December and erect a new store to replacecurrent store at 97 Peachtree St. New store will have air-conditioning.",Nov 1937
+"Los Angeles, CA (431 S. Broadway)","Double size of the store. Improvements will cost $300,000 and includeinstalling a 300-foot fountain, a luncheonette, air-conditioning,new kitchens, bakery, and a basement.",Nov 1937
+"Philadelphia, PA (2627 Germantown Ave.)",Two-story building erected.,Nov 1937
+"Newburgh, NY (62 Water St.)",Opened store.,Dec 1937
+"West Bend, IN (109 Lincoln Way)",Opened store.,Dec 1937
+"Festus, MO",Opened store.,Dec 1937
+"Baton Rouge, LA (405 3rd St.)",Opened store.,Dec 1937
+"Ridgewood, NJ (405 Chestnut St.)","Leased property where 1-story building (with basement) will be erected.The new building will connect with present Woolworth store at 15 RidgewoodAve., doubling the size of the sales area and providing entrancesfrom two streets.",Dec 1937
+"Charlotte, NC (N. Tryon St.)","Will build a store at a cost of $150,000.",Dec 1937
+"Herkinnen, NY (N. Main St.)",Will erect addition.,Dec 1937
+"Niagra Falls, NY (Main St. and Cleveland Ave.)",Will erect a new building on the site of old People's Bank building.,Dec 1937
+"Centralia, IL","Moved unit to new, larger location. $37,000 was spent on remodeling.",Dec 1937
+"Medford, OR (125 E. Main St.)","Moved unit to a new location, adding a luncheonette with chromiumequipment.",Dec 1937
+"Los Angeles, CA (4811 Whittier Blvd.)",Leased building.,Dec 1937
+"Oakland, CA (1115 Washington St.)","Enlarged and modernized store, including a luncheonette and fountain,175 feet long with seating for 85.",Jan 1938
+"Chicago, IL (1016 Argyle St.)",Opened store.,Jan 1938
+"Anacostia, Washington DC (1231 Good Hope Rd.)",Opened store.,Jan 1938
+"Hyattsville, MD (115 Maryland Ave.)",Opened store.,Jan 1938
+"Festus, MO",Opened store.,Jan 1938
+"New Bedford, OR (125 E. Main St.)","Moved unit, making a new and larger store.",Jan 1938
+"Selma, AL (Broad St. and Selma Ave.)","Leased double store building. $18,000 will be spent to modernize.",Jan 1938
+Washington D.C. (3612 Georgia Ave.),Modernized and enlarged store.,Jan 1938
+Washington D.C. (4463 CT Ave.),Will open store.,Jan 1938
+"Asheville, NC (25 Heywood Ave.)","Leased building where a modern building will be built for $120,000,replacing store on 38 Patton Ave.",Jan 1938
+"Davenport, IA (212 W. 2nd St.)",Enlarge unit by leasing adjoining building.,Jan 1938
+"Redwood City, CA (Broadway and Winslow)","Lease 1-story building to be built, replacing store at 2207 Broadway.",Jan 1938
+"Chicago, IL (5546 Belmont Ave.)",Plan extensive alteration and additions.,Jan 1938
+"Albany, NY (Central Ave. and Sherman St.)","Bought 5 properties, 3 on Central Ave. and 2 in rear on Sherman St.Will be used for expansion of unit.",Jan 1938
+"New Orleans, LA (Canal St. and N. Rampart St.)","Will build largest Southern store. The total square feet will be 26,000,at a cost of $500,000.",Jan 1938
+"San Jose, CA","Enlarged and remodeled store at a cost of $120,000, including adding4,000 square feet of floor space, widening the aisles, adding additionalcounters, installing a new luncheonette and fountains, and installingair-conditioning.",Feb 1938
+"Chicago, IL (3449 S. Halsted St.)","Modernized store at a cost of $12,000.",Feb 1938
+"Shreveport, LA (Texas St.)","Remodelling and enlarging store at a cost of $100,000, includingair-conditioning and and an entire new front.",Feb 1938
+"Nashua, NH (97 Main St.)",Opened new store.,March 1938
+"Corry, PA (57 N.Center St.)","Leased entire street floor for building, where a new store will openJune 1.",March 1938
+"Putnam, CT (18 Front St.)","Will double present store, where entire street floor and basementhave been leased.",March 1938
+"St. Palmer, MA (438 N. Main St.)",New building to be erected.,March 1938
+"Miami, FL (38 E. Flagler St.)","32-year lease taken for building. The property will be remodeled andimproved at a cost of $117,000. Enlarged store will have 100 feetof frontage.",March 1938
+"Chicago, IL (5532 W. Belmont Ave.)",Moving unit to a larger quarters at 5544 Belmont. Will have 50 feetof frontage. All new fixtures will be installed.,March 1938
+"Cookston, MN","Alterations and additions at a cost of $15,000.",March 1938
+"Griffin, GA",Enlarging unit by acquiring adjacent building.,March 1938
+"Norfolk, VA (Granby St. and Freemason St.)","Leased the Khedive Temple property and adjoining 6-story building.Woolworth will build a 2-story building at a cost of $75,000-$100,000,with around 14,000 square feet. There is a 40-year lease startingJuly 1, 1939.",March 1938
+"Logansport, IN","Remodeled store at a cost of $157,000, including enlarging interiorand exterior changes, a new floor, new lighting, new fixtures, fountains,and a luncheonette.",March 1938
+"Philadelphia, PA (5607-5615 Germantown Ave. )",Plan to build store at this location.,April 1938
+Easton PA (Northampton Sq. and Center Sq.),Plan to build store at this location.,April 1938
+"Danbury, CT (241 Main St. )",Plan to build store at this location. Site currently leased.,April 1938
+"Decatur, IL (239 N.Water St. )","Enlarged store by taking over adjoining building. New store has 800feet of frontage. The store will be completely remodeled with airconditioning, new fixtures, store front, lunch counter with 51 stools.",April 1938
+"El Monte, CA (410 W. Valley Blvd.)",New store opened.,April 1938
+"Elizabethtown, TN","Erecting new building for $25,000.",April 1938
+"Birmingham, AL (19th and N. 3rd Ave. )","Will erect 3-story building, which will be designed after the current5th Ave. store. New store will have air-conditioning and will costbetween $400,000 and $500,000.",May 1938
+"Columbus, OH (105 N. High St.)","Will erect store at a cost of $175,000.",May 1938
+"Springfield, MA (Exchanger St.)","Leased additional space to enlarge present store. $25,000 will bespent remodeling the store and improving the front.",May 1938
+"Warren, PA (212 Liberty St.)","Remodeling at a cost of $30,000. 30-foot addition to rear where anew store will open in May, replacing the one at 312 2nd Ave.",May 1938
+"New London, CT (94 State St.)","Remodeled store, including 80 foot front lunch counter with rose glassand hotel bar mirrors; basement kitchen, new and deeper mahogany wallcases, new lighting,and new merchandise counters.",May 1938
+"Albany, NY (149 Central Ave.)","Will build modern, 1-story building at a cost of $80,000. The sizewill be 66 by 160 feet. The front will be terra cotta.",June 1938
+"New York, NY (261 Broadway Ave.)","Leased store, basement, and rear portion of building. Will equip thestore with modern fixtures and air conditioning. Building will be25,000 square feet.",June 1938
+"Newport News, VA (W. Queens St.)",Opened new store.,June 1938
+"Redding, CA (Market St. )","Leased space where the store frontage will be 37 feet, depth 140 feetand full basement.",June 1938
+"Pittson, PA",Enlarging store by acquiring adjoining building.,June 1938
+"Greensboro, NC (122 S. Elm St.)",30 year lease on property. The new store will have 75 feet of frontageon Elm St. and 60 feet on Sycamore St. The building will have airconditioning and be equipped with a luncheonette.,June 1938
+"Ottawa, KS (222 S. Main St.)",Will enlarge unit by taking adjacent building at 220 Main St.,June 1938
+"Fresno, CA (Fullton & Kern St. )",Leased building with a frontage of 125 feet on Fullton St. and 150feet on Kern St. Improvements will include alterations throughoutthe one-story structure.,June 1938
+"Worchester, MA (630 Main St.)",Leased one-story building which will be erected.,July 1938
+"Woodstock, IL",Built addition to store.,July 1938
+"Jersey City, NJ (320 Jackson Ave.)","Leased property in the rear at 148 Claremont Ave. Present buildingwill be demolished and a new building built with 9,150 square feet.",July 1938
+"El Dorado, AK","Remodelled and enlarged store, including new fountain and luncheonette.",July 1938
+"Cape Girardeau, MO (1 N Main St. )","Enlarged and remodelled store, including new lighting and additionof 40 feet of space in rear of store.",July 1938
+"Jacksonville, FL (1037 Park St. at Five Points)",Will open a store.,July 1938
+"Chicago, IL (2335 W.Madison St.)","Leased property adjoining present unit. This space will be used toenlarge present store at a cost of $28,000 to build a one-story (includingbasement) brick building.",July 1938
+"Shelbyville, IN",Remodelled and enlarged store.,July 1938
+"Henderson, KY",Remodelled and enlarged store.,July 1938
+"Cleveland, OH (Euclid Ave. and E.5th St.)","Took out a lease which covers the first floor and basement, as wellas the option for space on the second floor. Woolworth will spend$100,000 dollars remodeling the new store, which will assume andel-shape.",Aug 1938
+"Jackson, MI (165-169 W.Michigan Ave.)","Leased property, where a 3-story building will be built, having 66feet of frontage on Michigan Ave. The basement and ground floor willbe sales space, while the upper stores will be used for storage. Thestore will have air conditioning.",Aug 1938
+"East Greenwich, RI (Main St.)",Leased building to be built.,Aug 1938
+"Dayton, OH (1150 W.3rd St.)","Leased building, which will be doubled from its original size.",Aug 1938
+"Houston, TX (Yoakum and W. Heiner)","Leased 2-story building, which will be built.",Aug 1938
+"Indianapolis, IN (7 E. Washington St.)","Started extensive alterations to the store, which will contain 5 stories.Escalators will be installed between first and second floors. Thefront will be of limestone with a base of granite and doors of stainlesssteel. Air conditioning will be installed.",Aug 1938
+"White Plains, NY (Main and Williams St.)",Will build 2-story building.,Aug 1938
+"Schenectady, NY (State St. and Broadway)","Leased the 2-story building, which will be erected.",Aug 1938
+"Carlisle, PA (14 N. Hanover St. and Broadway)","Enlarging store, which will be ready in August.",Aug 1938
+"Alice, TX","Leased the $20,000 building to be erected. The building will be brick,tile and granite. An elevator will be installed. Store will open October10.",Sept 1938
+"Perry, IA (1102 2nd St.)","Enlarged the store, including new display fixtures and lighting equipment.",Sept 1938
+"Lockport, NY (68 Main St. )","Enlarged the store, including new display fixtures and lighting equipment.Cost $30,000.",Sept 1938
+"Lansing, MI (Washington Ave. and Allegan St.)",Woolworth leased the United Building.,Sept 1938
+"Lincoln, NE (117 \char`\""{}O\char`\""{} St.)","Enlarged store by acquiring the adjoining 2-story building at 1109\char`\""{}O\char`\""{} St. Remodelling will start February 1, 1939and when completed, the enlarged store will have frontage of 75 feeton \char`\""{}O\char`\""{} St. New fixtures will be installed.",Oct 1938
+"Buckhead, Atlanta, GA (3071 Peachtree St.)","Will build a two-story building, 46 by 146 feet. Construction startsDecember 1, and the store will open April 1, 1939.",Oct 1938
+"Rochester, NY (Dewey Ave. and Ridge Rd.)",Leased one-story building with basement to be erected.,Oct 1938
+"Eureka, CA (\char`\""{}F\char`\""{} St.)","Leased building to be erected between 4th and 5th St. Replaced unitsat 5th and \char`\""{}G\char`\""{} St.",Oct 1938
+"Arkansas City, KS (217 S.Summit St.)","A building will be erected, adjoining the chain's present location.",Oct 1938
+"Wilson, NC (Nash and Tarboro St.)",Opened store.,Oct 1938
+"Besse Place, Springfield, MA (Main St.)",Will erect a two-story building with a frontage of 71 feet and a depthof 285 feet.,Oct 1938
+"Chattanooga, TN (Market St.)","Plan to erect a 2-story building with a frontage of 90 feet at a costof $300,000.",Nov 1938
+"Wilmington, NC (N. Front St.)","Open building with a front of stone terra cotta, a base of marble,and trimming of stainless steel. The store has air conditioning.",Nov 1938
+"Galesburg, IL (S. Main St. and E. St.)",Leased one-story building which will be erected.,Nov 1938
+"Albany, NY (N. Pearl St. and Steuben St.)","Woolworth is planning a new 40-year lease, and is also planning extensivealterations and modernization to the building, including an additionto the Steuben St. side of the building, which will include an escalator.",Nov 1938
+"Goose Creek, TX",Remodeled and enlarged store.,Nov 1938
+"Independence, KS",Remodeled and enlarged store.,Nov 1938
+"Chicago, IL (Halstead St. and 69th St.)","Leased the el-shaped building. The store will be remodeled at a costof $30,000.",Dec 1938
+"Jackson Heights Long Island, NY (37-19 88 St.)",Leased the 2-story building being erected. Store has a frontage of65 feet by a depth of 100 feet together with basement and second floorof equal size.,Dec 1938
+"Kalispell, MT","Erecting a $60,000 addition to current building.",Dec 1938
+"Reno, NV (1st St. and Virginia St.)","Relocated to this address for a larger location. $75,000 was spenton remodeling, which included new fixtures and air conditioning.",Dec 1938
+"Chattanooga, TN (Market St.)","Planning to erect a 2-story building with frontage of 90 feet at acost of $300,000.",Dec 1938
+"Waterville, ME (Main St.)","Erected an addition to building, including a new store front and theenlargement of several departments.",Dec 1938
+"Oneida, NY",Enlarged unit to double its original size.,Dec 1938
+"Wichita Falls, TX","Store has been enlarged to almost twice its original size. A new storefront was installed, luncheonette service added, the interior redecorated,and air conditioning installed.",Dec 1938
+"San Francisco, CA (Fillmore and Geary St.)",Modernized the store.,Dec 1938
+"New Orleans, LA (Canal and N. Rampart St.)","Leased corner lot and added to the adjacent property. Woolworth plansto build a $400,000, 2-story building, measuring 104 feet by 25 feet.",Dec 1938
+"Muskegon, MI (259 W. Western Ave.)","Enlarged and modernized building at a cost of $50,000.",Dec 1938
+"Buffalo, NY (395 Main St.)","Will remodel and completely modernize store, including a new storefront, new interior, new fixtures and equipment, and air conditioning.The cost will be $100,000 and work will start February 1, 1939.",Dec 1938
+"Niles, MI (North side of Main St.)","The store will be moved to this location. Extensive remodeling onthis unit will start January 1, 1939.",Dec 1938
+"Maryville, MO (320 N.Main Main St.)",Store will be enlarged by acquiring the adjoining space. A new storefront of stainless steel will be installed.,Dec 1938
+"Vineland, NJ (613 Laudis Ave.)",Enlarged unit to about twice its former size. New lighting was installed.,Dec 1938
+"Bakersfield, CA (1400 19th St.)","Leased the entire 2-story building. Store presently in building. About$750,000 will be spent on remodeling.",Jan 1939
+"Monmuoth, IL (1400 S. Main St.)",Leased building to be erected.,Jan 1939
+"Whiting, IN (1334 119th St.)",Leased building to be erected.,Jan 1939
+"Chicago, IL(4019 Milwaukee Ave.)",Planning to enlarge present unit by acquiring adjoining building giving100 feet of frontage. Open by 1941.,Jan 1939
+"Asheville, NC (23 Haywood St.)","Building a 2-story store at a cost of $125,000. The front will beornamental terra cotta. The basement and the first floor will be usedfor selling space, while the second floor will be used for storageand executive offices. The store will be completed June 1, replacingthe store at 38 Patton Ave.",Jan 1939
+"Camden, NJ (26 and Federal St.)",Remodeled and enlarged the store to two and one half times its formersize. One of the new features is a 42-foot lunch counter.,Jan 1939
+"Port Huron, MI (308 Huron Ave.)",Leased building to be erected on site. Razed old structure on site.,Jan 1939
+"Newton, IA","Remodeled and enlarged store. Additional space will be acquired February1, and remodeling will begin. A new will be erected and lighting willbe improved.",Jan 1939
+"Watertown, MA (31 Main St.)",Opened enlarged and modernized store.,Jan 1939
+"Spartanburg, SC (E. Main St.)","Leased building to be erected. Building will have two stories with73 feet of frontage and air conditioning at a cost of $80,000-100,000.",Feb 1939
+"Michigan City, IN (701 Franklin St.)",Enlarging store.,Feb 1939
+"Cleveland, OH (Superior Ave.)",Leased building. The store will have 60 feet of frontage.,Feb 1939
+"Cleveland, OH (648 E.185th St.)",Enlarging store.,Feb 1939
+Cleveland OH (16730 Kinsman Rd.),Opened store.,Feb 1939
+"Cleveland, OH (W. 25th St. Near Clarke Ave.)",Opened store.,Feb 1939
+"Lakerwood, OH (Detroit and Cook Ave.)",Enlarged store to 3 times its former size.,Feb 1939
+"Bluefield, WV (Princeton Ave.)",The store will be enlarged by the acquisition of 2 upper floors ofthe building.,Feb 1939
+"Springfield, OH",Leased building to be erected.,Feb 1939
+"Greensboro, NC (S. Elm St.)","Will move store to this location. Alterations costing $115,000 includeelevators and air conditioning.",Feb 1939
+"Anniston, AL (Noble St.)","Alterations being made to property, replacing previous store.",Feb 1939
+"Houston, TX (Lyons and Jenson St.)","Leased building to be erected. The building is 50 by 115 feet andcost $40,000.",March 1939
+"Duluth, MN (5623 Grand Ave.)","Leased $30,000 building to be erected.",March 1939
+"Dallas, TX (1927 Greenville Ave.)","New two-story building, 61 by 110 feet, to be erected. Cost $40,000.",March 1939
+"Grand Rapids, MI (Campus Sq. and the buildings west of it.)","299 feet of frontage on Pearl St. composed of terra cotta and blackgranite. This unit replaces the one at Monroe and Market. The costwill be $300,000. ",March 1939
+"New Albany, IN (Pearl St. and Market)","Enlarging unit by acquiring adjoining space. 8500 square feet of floorspace,100 feet of frontage on Market St. and 85 feet on Pearl St.",March 1939
+"Somerville, NJ (W.Main St.)","Alterations at a cost of $10,000. The interior will be completelyremodeled and redecorated as well as the store front.",March 1939
+"Danville, VA (Main St.)","$30,000 addition to unit including air conditioning.",March 1939
+"Monroe, LA (227 DeSaird St.)","Enlarging unit at a cost of $10,000.",March 1939
+"Schenectady, NY (State St. and Broadway)",Opened new unit.,March 1939
+"Pittsburgh, PA (6011 Penn Ave.)",Will erect 2-story building adjoining the present unit.,March 1939
+"White Plains, NY (Main St. and William St.)","Opened store, which has 13,000 sq. feet of selling space, air conditioning,modernistic historical murals of outstanding events over the fountainbar area.",April 1939
+"Louisville, KY (440 Fourth St.)","Leased building to be erected at a cost of $300,000, with frontageof 77 feet, depth of 164 feet, and about 50,000 square feet of floorspace in 3 stories, as well as a merchandising basement. Present buildingat Fourth St. and Liberty St. will be demolished.",April 1939
+"Milwaukee, WI (S.Tenth St. and W. St.)",Leased ground floor and basement of building to be erected.,April 1939
+"Allentown, PA (733 Hamilton St.)",Will erect a store.,April 1939
+"Peru, IN (6 N. Broadway St.)",Leased building where alterations are now in progress.,April 1939
+"Decatur, GA (E. Ponce de Leon Ave.)",Enlarging store.,May 1939
+"Milwaukee, WI (N. Ave.)",Leased property.,May 1939
+"Indianapolis, IN (E. Washington St. and Ritter Ave.)","Leased first floor and basement in building under construction. Thebuilding will have 15,000 square feet.",May 1939
+"Massillon, OH (McClymonds building)","Took out a 20-year lease on entire first and basement. Will spend$50,000 remodeling the space.",June 1939
+"Brawley, CA (Sixth St. and Main St.)",New store with air conditioning will open.,June 1939
+"Jackson, MI (W. Michigan Ave.)","New store with air conditioning, luncheonette and fountain will open.",June 1939
+"Barre, VT (Main St.)",Leased entire building.,June 1939
+"Akron, OH (76 S. Main St.)","New restaurant and luncheon counter and air conditioning. Paintingand redecorating cost $150,000.",June 1939
+"Malone, NY (87, 92, 93 E. Main St.)",Leased entire street floor.,June 1939
+"Flat River, MO","Will erect an addition to to unit, 40 by 50 feet with a basement.",June 1939
+"Tuscon, AZ (36 E. Longress St.)","Enlarged building to double its size. Installed air conditioning,more adequate lighting and new flooring.",June 1939
+"Turlock, CA (129 W. Main St.)","Remodelled the store, including installing air conditioning.",June 1939
+"Ventura, CA ( Main St. and Oak St.)",Leased building.,July 1939
+"Forest Hills, Long Island, NY (103 Metropolitan Ave.)",Leased building.,July 1939
+"Everett, WA (2826 Colby Ave.)","Constructing the addition to and remodeling the building at a costof $25,000.",July 1939
+"Cheboygan, MI (Main St. and Backus St.)",Erecting a new store with 55 feet of frontage on Main St. and 110feet on Backus St.,July 1939
+"New Bedford, MA (1065 and 1067 S.Water St. and S. First St.)",New buildings will be erected.,July 1939
+"Montrose, CA (Market St.)",Will open new unit.,July 1939
+"Rochester, NY (Dewey Ave. and Ridge Rd.)",Will lease building to be erected. Building will have frontage of122 feet on Dewey St. and 55 feet on Ridge Rd.,July 1939
+"Louisville, KY (Frankfort Ave. and Lexington Ave.)",Leased building to be erected.,July 1939
+"Presque Isle, ME",Erecting store with a lunch counter and soda fountain.,July 1939
+"Blue Island, IL (13044 Western Ave.)",Planning to enlarge store.,July 1939
+"New Brunswick, NJ (George St.)",Planning to enlarge store by acquiring extra space.,July 1939
+"New Bedford, MA (1063 S. Water St.)","Will erect a $12,000 one-story building, replacing the unit at 1069Water St.",Aug 1939
+"Abilene, TX (N. Second and Pine St.)",Leased additional space to enlarge unit. The former store was destroyedby fire and will be rebuilt with additional space. The new store willhave 75 feet of frontage on Pine St.,Aug 1939
+"Downers Grove, IL (5118-20 Main St.)",Leased the two Walter Lane buildings. The building will be enlargedin the rear. The interior will be 50 feet by 125 feet. Special featurewill be a luncheonette counter. A new store front will be erected.,Aug 1939
+"Lancaster, OH (144 W.Main St.)","Enlarged and modernized the unit. Improvements include a new storefront; new lighting; new counters; larger sign over front. The presentfront is 54 feet long and door and window space has been enlargedand display feature 3-tone color background. The cost will be $35,000.",Aug 1939
+"San Bernardino, CA (Fourth and E. St.)","Leased 2-story building. Lease takes affect June 1, 1942.",Sept 1939
+"Columbus, GA (1129 Broadway)","39 year lease on building to be built. The dimensions will be 60 by200 feet. It will have air conditioning. The main floor will have12,000 square feet of sales space. This building replaces the buildingon the east side of Broadway.",Sept 1939
+"Glendale, CA (Brand Blvd. and Wilson Ave.)",Leased 1-story building with frontage of 103 feet and depth of 150feet. The entire building will be remodeled.,Sept 1939
+"Paterson, NJ (160 Main St.)","Leased ground floor and basement of building adjoining present location.$150,000 will be spent in alterations to join both buildings. Enlargedstore will have 140 feet on Main St. and will be largest in New Jersey. ",Sept 1939
+"Utica, NY (Genesse St.)",Leased property owned by Robert Fraser Co. adjoining the Woolworthunit.,Sept 1939
+"West New York, NJ (591 Bergenline Ave.)","Leased 10,000 square feet at this location. Present unit is at 645Bergenline Ave.",Sept 1939
+"Madison, NJ (51 Main St.)","Leased building. Will spend $50,000 on renovations.",Sept 1939
+"Jersey City, NJ (320 Jackson Ave.)",Will build 2-story unit which will have 9150 square feet of space.,Sept 1939
+"Chicago, IL (3955 W. Twenty-Sixth St. and 2611 S. Palaski Rd.)",Leased on property covering a store and basement of an existing buildingas well as a 1-story basement addition which will be erected to makeone large store of 48 by 126 feet.,Sept 1939
+"Chicago, IL (3150 W. Sixty-Third St. )","Leased store comprising 52 by 125 feet. $30,000 will be spent onremodeling.",Sept 1939
+"Chicago, IL (3746 W. Chicago Ave. )","Renewed lease, providing for complete remodeling of the premises.",Sept 1939
+"San Francisco, CA (707 Clement St. )","Remodeled and enlarged store, including new lighting fixtures.",Sept 1939
+"Wilmington, DE (Ninth St. and Market St. )",Will erect 2-story building with basement.,Sept 1939
+"Bergenfield, NJ ( S. Washington Ave. and W.Main St. )",Leased new building which will be 47 by 135 feet and is scheduledfor Fall opening.,Sept 1939
+"Bloomington, IL",Leased 1-story building to be erected. The walls will be terra cottawith black granite base. The building will feature a corner entrancewith a tower and a 4-foot diameter clock.,Oct 1939
+"Hudson, NY (617 Warren St.)",Enlarged and remodeled store.,Oct 1939
+"Missoula, MT ( N. Higgins Ave.)",Opened store.,Oct 1939
+"Toledo, OH (1012 Sylvania Ave.)",Enlarged store by acquiring additional space. The new store will be60 by 120 feet.,Oct 1939
+"Waverly, PA (Broad St.)",Leased 1-story building with 75 feet of frontage.,Oct 1939
+"Muskegon Heights, MI","Leased $65,000 building which is now being built.",Oct 1939
+"New Orleans, LA (8201 Oak St.)",Leased the entire building. The first floor will be used for salesand the second for storage.,Oct 1939
+"Nashville, TN (1803 Twenty-first Ave.)",Opened new 2-story building.,Nov 1939
+"Saginaw, MI","Will construct a 3-story, $300,000 building on site of present unit.Plans call for a basement salesroom and first floor sales space, includinga large fountain and air conditioning.",Nov 1939
+"Albert Lea, MN ( S. Broadway and William St.)","Leased the Babbit Building, which adjoins the present unit. Remodelingwill include a new front and new equipment at a cost of $40,000.",Nov 1939
+"Biloxi, MS",Improvements started. The second floor storeroom is being enlargedand new lighting is being installed.,Nov 1939
+"Bristow, OK (208 N. Main St.)",Leased building.,Nov 1939
+"Santa Fe, NM","Enlarged and remodeled unit on the Plaza. The upper part of the buildingis set back to conform with the architectural trend in Santa Fe. Storehas 7,560 square feet. There is a new ventilating and heating system,new chromium fixtures and a new luncheonette with a fountain.",Nov 1939
+"Freeport, NY (68 S. Main St.)","Enlarged unit, including air conditioning and a 54 foot fountain-luncheonette.",Nov 1939
+"Conshocken, PA ( First and Fayette St.)",Opened store.,Nov 1939
+"Springfield, MA ( Main St. and Vernon St.)",Opened a store featuring 175 foot fountain-luncheonette and indirectlighting.,Dec 1939
+"Chicago, IL (3150 W. sixty-third St.)",Opened store.,Dec 1939
+"Norfolk, VA (3150 Granby and Freemason St.)",Opened new unit.,Dec 1939
+"Seattle, WA (3150 Third Ave. and Pike St.)","Leased 3-story building to be built at a cost of $750,000. The propertyhas 180 feet frontage on Third Ave. and 111 feet on Pike St. The exteriorwill be faced in terra cotta and the interior finished with terrazzofloors, walnut woodwork, marble columns and air conditioning.",Dec 1939
+"Freeport, NY (68 S. Main St.)","Enlarged unit, including air conditioning and a 54-foot fountain-luncheonette.",Dec 1939
+"Kankakee, IL (132 E. Court St.)","Remodeled store. The store has been modernized with an improved sodafountain, new kitchen, and new lighting. The store front has alsobeen remodeled",Dec 1939
+"Provo, UT (52 W. Center St.)","Completely remodeled and improved store, including a 54-foot luncheonette.",Dec 1939
+"Beverly, MA","Enlarged and remodeled unit, which will have 50\% more floor spaceand additional display counters.",Dec 1939
+"Ashland, KY (Winchester Ave. between Seventeenth and Eighteenth St.)",Opened new store.,Dec 1939
+"Clinton, IL",Will erect new store.,Dec 1939
+"Linden, NJ (Wood Ave. and Blancke St.)",Opened new store.,Dec 1939
diff --git a/sandbox/paultremblay/python_interface/test_files/long_table.rst b/sandbox/paultremblay/python_interface/test_files/long_table.rst new file mode 100644 index 000000000..e034b62da --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/long_table.rst @@ -0,0 +1,6 @@ +Table Appendix B.1: Woolworth Stores in USA + +.. csv-table:: Modernized Woolworth Stores in the USA + :header: "Location", "Description", "Date" + :widths: 3, 5, 2 + :file: long_table.csv diff --git a/sandbox/paultremblay/python_interface/test_files/opt_list.rst b/sandbox/paultremblay/python_interface/test_files/opt_list.rst new file mode 100644 index 000000000..b6fce9abb --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/opt_list.rst @@ -0,0 +1,31 @@ +.. $Id$ + +Option lists are two-column lists of command-line options and descriptions, documenting a program's options. For example: + +-a Output all. +-b Output both (this description is + quite long). +-c arg Output just arg. +--long Output all day long. + +-p This option has two paragraphs in the description. + This is the first. + + This is the second. Blank lines may be omitted between + options (as above) or left in (as here and below). + +--very-long-option A VMS-style option. Note the adjustment for + the required two spaces. + +--an-even-longer-option + The description can also start on the next line. + +-2, --two This option has two variants. + +-f FILE, --file=FILE These two options are synonyms; both have + arguments. + +/V A VMS/DOS-style option. + +There are several types of options recognized by reStructuredText: + diff --git a/sandbox/paultremblay/python_interface/test_files/parsed_literal.rst b/sandbox/paultremblay/python_interface/test_files/parsed_literal.rst new file mode 100644 index 000000000..b71a017c4 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/parsed_literal.rst @@ -0,0 +1,8 @@ +paragraph text + +.. parsed-literal:: + + **bold** and *italic* and `literal` and ``so fourth`` + + +paragraph text diff --git a/sandbox/paultremblay/python_interface/test_files/peak.png b/sandbox/paultremblay/python_interface/test_files/peak.png Binary files differnew file mode 100644 index 000000000..c7e2ed3b5 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/peak.png diff --git a/sandbox/paultremblay/python_interface/test_files/pull_quote.rst b/sandbox/paultremblay/python_interface/test_files/pull_quote.rst new file mode 100644 index 000000000..2bee60322 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/pull_quote.rst @@ -0,0 +1,12 @@ +paragrah text + +.. pull-quote:: + + The depression, which brought so many changes in retailing, favored these types + of retail outlets (chain stores). The consumers had their eyes on prices. They + still wanted things. They desired to keep up their standards of living with reduced + incomes. Shopping was a job that the consumer was willing to work at. + + --Edward A. Filene, 1937 + +paragrah text diff --git a/sandbox/paultremblay/python_interface/test_files/quoted_literal_blocks.rst b/sandbox/paultremblay/python_interface/test_files/quoted_literal_blocks.rst new file mode 100644 index 000000000..958963183 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/quoted_literal_blocks.rst @@ -0,0 +1,8 @@ +ohn Doe wrote:: + +>> Great idea! +> +> Why didn't I think of that? + +You just did! ;-) + diff --git a/sandbox/paultremblay/python_interface/test_files/rubric.rst b/sandbox/paultremblay/python_interface/test_files/rubric.rst new file mode 100644 index 000000000..7b29d4a89 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/rubric.rst @@ -0,0 +1,5 @@ +Paragraph text + +.. rubric:: Rubric Title + +Paragraph text diff --git a/sandbox/paultremblay/python_interface/test_files/section.rst b/sandbox/paultremblay/python_interface/test_files/section.rst new file mode 100644 index 000000000..d2b589525 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/section.rst @@ -0,0 +1,70 @@ +.. $Id$ + +.. sectnum:: + +text + +=============== +Section Title +=============== + +text + +=============== +Section Title +=============== + +text + +--------------- + Section Title +--------------- + +text + +--------------- + Section Title +--------------- + +text + +--------------- + Section Title +--------------- + +text + +Section Title +============= + +text + +Section Title +------------- + +text + +Section Title +````````````` +text + +Section Title +''''''''''''' + +text + +Section Title +............. + +text + +Section Title +~~~~~~~~~~~~~ + +Section Title +************* + +text + + + diff --git a/sandbox/paultremblay/python_interface/test_files/sidebar.rst b/sandbox/paultremblay/python_interface/test_files/sidebar.rst new file mode 100644 index 000000000..aa5287ac0 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/sidebar.rst @@ -0,0 +1,65 @@ + +MARLEY was dead: to begin with. There is no doubt +whatever about that. The register of his burial was +signed by the clergyman, the clerk, the undertaker, +and the chief mourner. Scrooge signed it: and +Scrooge's name was good upon 'Change, for anything he +chose to put his hand to. Old Marley was as dead as a +door-nail. + +Mind! I don't mean to say that I know, of my +own knowledge, what there is particularly dead about +a door-nail. I might have been inclined, myself, to +regard a coffin-nail as the deadest piece of ironmongery +in the trade. But the wisdom of our ancestors +is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that +Marley was as dead as a door-nail. + +Scrooge knew he was dead? Of course he did. +How could it be otherwise? Scrooge and he were +partners for I don't know how many years. Scrooge +was his sole executor, his sole administrator, his sole +assign, his sole residuary legatee, his sole friend, and +sole mourner. And even Scrooge was not so dreadfully +cut up by the sad event, but that he was an excellent +man of business on the very day of the funeral, +and solemnised it with an undoubted bargain. + +.. sidebar:: Sidebar Title + :subtitle: Optional Sidebar Subtitle + + Subsequent indented lines comprise + the body of the sidebar, and are + interpreted as body elements. + + second paragraph + +MARLEY was dead: to begin with. There is no doubt +whatever about that. The register of his burial was +signed by the clergyman, the clerk, the undertaker, +and the chief mourner. Scrooge signed it: and +Scrooge's name was good upon 'Change, for anything he +chose to put his hand to. Old Marley was as dead as a +door-nail. + +Mind! I don't mean to say that I know, of my +own knowledge, what there is particularly dead about +a door-nail. I might have been inclined, myself, to +regard a coffin-nail as the deadest piece of ironmongery +in the trade. But the wisdom of our ancestors +is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that +Marley was as dead as a door-nail. + +Scrooge knew he was dead? Of course he did. +How could it be otherwise? Scrooge and he were +partners for I don't know how many years. Scrooge +was his sole executor, his sole administrator, his sole +assign, his sole residuary legatee, his sole friend, and +sole mourner. And even Scrooge was not so dreadfully +cut up by the sad event, but that he was an excellent +man of business on the very day of the funeral, +and solemnised it with an undoubted bargain. diff --git a/sandbox/paultremblay/python_interface/test_files/simple.rst b/sandbox/paultremblay/python_interface/test_files/simple.rst new file mode 100644 index 000000000..69c5be815 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/simple.rst @@ -0,0 +1,41 @@ +MARLEY was dead: to begin with. There is no doubt +whatever about that. The register of his burial was +signed by the clergyman, the clerk, the undertaker, +and the chief mourner. Scrooge signed it: and +Scrooge's name was good upon 'Change, for anything he +chose to put his hand to. Old Marley was as dead as a +door-nail. + +Mind! I don't mean to say that I know, of my +own knowledge, what there is particularly dead about +a door-nail. I might have been inclined, myself, to +regard a coffin-nail as the deadest piece of ironmongery +in the trade. But the wisdom of our ancestors +is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that +Marley was as dead as a door-nail. + +Scrooge knew he was dead? Of course he did. +How could it be otherwise? Scrooge and he were +partners for I don't know how many years. Scrooge +was his sole executor, his sole administrator, his sole +assign, his sole residuary legatee, his sole friend, and +sole mourner. And even Scrooge was not so dreadfully +cut up by the sad event, but that he was an excellent +man of business on the very day of the funeral, +and solemnised it with an undoubted bargain. + +The mention of Marley's funeral brings me back to +the point I started from. There is no doubt that Marley +was dead. This must be distinctly understood, or +nothing wonderful can come of the story I am going +to relate. If we were not perfectly convinced that +Hamlet's Father died before the play began, there +would be nothing more remarkable in his taking a +stroll at night, in an easterly wind, upon his own ramparts, +than there would be in any other middle-aged +gentleman rashly turning out after dark in a breezy +spot--say Saint Paul's Churchyard for instance-- +literally to astonish his son's weak mind. + diff --git a/sandbox/paultremblay/python_interface/test_files/simple2.rst b/sandbox/paultremblay/python_interface/test_files/simple2.rst new file mode 100644 index 000000000..5bc84a2f5 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/simple2.rst @@ -0,0 +1,105 @@ +MARLEY was dead: to begin with. There is no doubt +whatever about that. The register of his burial was +signed by the clergyman, the clerk, the undertaker, +and the chief mourner. Scrooge signed it: and +Scrooge's name was good upon 'Change, for anything he +chose to put his hand to. Old Marley was as dead as a +door-nail. + +Mind! I don't mean to say that I know, of my +own knowledge, what there is particularly dead about +a door-nail. I might have been inclined, myself, to +regard a coffin-nail as the deadest piece of ironmongery +in the trade. But the wisdom of our ancestors +is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that +Marley was as dead as a door-nail. + +Scrooge knew he was dead? Of course he did. +How could it be otherwise? Scrooge and he were +partners for I don't know how many years. Scrooge +was his sole executor, his sole administrator, his sole +assign, his sole residuary legatee, his sole friend, and +sole mourner. And even Scrooge was not so dreadfully +cut up by the sad event, but that he was an excellent +man of business on the very day of the funeral, +and solemnised it with an undoubted bargain. + +The mention of Marley's funeral brings me back to +the point I started from. There is no doubt that Marley +was dead. This must be distinctly understood, or +nothing wonderful can come of the story I am going +to relate. If we were not perfectly convinced that +Hamlet's Father died before the play began, there +would be nothing more remarkable in his taking a +stroll at night, in an easterly wind, upon his own ramparts, +than there would be in any other middle-aged +gentleman rashly turning out after dark in a breezy +spot--say Saint Paul's Churchyard for instance-- +literally to astonish his son's weak mind. + +Scrooge never painted out Old Marley's name. +There it stood, years afterwards, above the warehouse +door: Scrooge and Marley. The firm was known as +Scrooge and Marley. Sometimes people new to the +business called Scrooge Scrooge, and sometimes Marley, +but he answered to both names. It was all the +same to him. + +Oh! But he was a tight-fisted hand at the grind-stone, +Scrooge! a squeezing, wrenching, grasping, scraping, +clutching, covetous, old sinner! Hard and sharp as flint, +from which no steel had ever struck out generous fire; +secret, and self-contained, and solitary as an oyster. The +cold within him froze his old features, nipped his pointed +nose, shrivelled his cheek, stiffened his gait; made his +eyes red, his thin lips blue; and spoke out shrewdly in his +grating voice. A frosty rime was on his head, and on his +eyebrows, and his wiry chin. He carried his own low +temperature always about with him; he iced his office in +the dog-days; and didn't thaw it one degree at Christmas. + +External heat and cold had little influence on +Scrooge. No warmth could warm, no wintry weather +chill him. No wind that blew was bitterer than he, +no falling snow was more intent upon its purpose, no +pelting rain less open to entreaty. Foul weather didn't +know where to have him. The heaviest rain, and +snow, and hail, and sleet, could boast of the advantage +over him in only one respect. They often "came down" +handsomely, and Scrooge never did. +Nobody ever stopped him in the street to say, with +gladsome looks, "My dear Scrooge, how are you? +When will you come to see me?" No beggars implored +him to bestow a trifle, no children asked him +what it was o'clock, no man or woman ever once in all +his life inquired the way to such and such a place, of +Scrooge. Even the blind men's dogs appeared to +know him; and when they saw him coming on, would +tug their owners into doorways and up courts; and +then would wag their tails as though they said, "No +eye at all is better than an evil eye, dark master!" +But what did Scrooge care! It was the very thing +he liked. To edge his way along the crowded paths +of life, warning all human sympathy to keep its distance, +was what the knowing ones call "nuts" to Scrooge. + +Once upon a time--of all the good days in the year, +on Christmas Eve--old Scrooge sat busy in his +counting-house. It was cold, bleak, biting weather: foggy +withal: and he could hear the people in the court outside, +go wheezing up and down, beating their hands +upon their breasts, and stamping their feet upon the +pavement stones to warm them. The city clocks had +only just gone three, but it was quite dark already-- +it had not been light all day--and candles were flaring +in the windows of the neighbouring offices, like +ruddy smears upon the palpable brown air. The fog +came pouring in at every chink and keyhole, and was +so dense without, that although the court was of the +narrowest, the houses opposite were mere phantoms. +To see the dingy cloud come drooping down, obscuring +everything, one might have thought that Nature +lived hard by, and was brewing on a large scale. + diff --git a/sandbox/paultremblay/python_interface/test_files/table_borderless.rst b/sandbox/paultremblay/python_interface/test_files/table_borderless.rst new file mode 100644 index 000000000..aeec8f2bd --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/table_borderless.rst @@ -0,0 +1,20 @@ + +Text before table. + +.. class:: borderless + ++------------------------+------------+----------+----------+ +| Header row, column 1 | Header 2 | Header 3 | Header 4 | +| (header rows optional) | | | | ++========================+============+==========+==========+ +| body row 1, column 1 | column 2 | column 3 | column 4 | ++------------------------+------------+----------+----------+ +| body row 2 | Cells may span columns. | ++------------------------+------------+---------------------+ +| body row 3 | Cells may | - Table cells | ++------------------------+ span rows. | - contain | +| body row 4 | | - body elements. | ++------------------------+------------+---------------------+ + +Text after the table. + diff --git a/sandbox/paultremblay/python_interface/test_files/table_csv.rst b/sandbox/paultremblay/python_interface/test_files/table_csv.rst new file mode 100644 index 000000000..f1a61077f --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/table_csv.rst @@ -0,0 +1,13 @@ +Text before the table. + +.. csv-table:: Frozen Delights! + :header: "Treat", "Quantity", "Description" + :widths: 15, 10, 30 + + "Albatross", 2.99, "On a stick!" + "Crunchy Frog", 1.49, "If we took the bones out, it wouldn't be + crunchy, now would it?" + "Gannet Ripple", 1.99, "On a stick!" + +Text after the table. + diff --git a/sandbox/paultremblay/python_interface/test_files/table_grid.rst b/sandbox/paultremblay/python_interface/test_files/table_grid.rst new file mode 100644 index 000000000..d447e8291 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/table_grid.rst @@ -0,0 +1,19 @@ +.. $Id$ + +Text before table. + ++------------------------+------------+----------+----------+ +| Header row, column 1 | Header 2 | Header 3 | Header 4 | +| (header rows optional) | | | | ++========================+============+==========+==========+ +| body row 1, column 1 | column 2 | column 3 | column 4 | ++------------------------+------------+----------+----------+ +| body row 2 | Cells may span columns. | ++------------------------+------------+---------------------+ +| body row 3 | Cells may | - Table cells | ++------------------------+ span rows. | - contain | +| body row 4 | | - body elements. | ++------------------------+------------+---------------------+ + +Text after the table. + diff --git a/sandbox/paultremblay/python_interface/test_files/table_grid_class.rst b/sandbox/paultremblay/python_interface/test_files/table_grid_class.rst new file mode 100644 index 000000000..bc469fe35 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/table_grid_class.rst @@ -0,0 +1,22 @@ + +.. $Id$ + +Text before table. + +.. class:: table3 + ++------------------------+------------+----------+----------+ +| Header row, column 1 | Header 2 | Header 3 | Header 4 | +| (header rows optional) | | | | ++========================+============+==========+==========+ +| body row 1, column 1 | column 2 | column 3 | column 4 | ++------------------------+------------+----------+----------+ +| body row 2 | Cells may span columns. | ++------------------------+------------+---------------------+ +| body row 3 | Cells may | - Table cells | ++------------------------+ span rows. | - contain | +| body row 4 | | - body elements. | ++------------------------+------------+---------------------+ + +Text after the table. + diff --git a/sandbox/paultremblay/python_interface/test_files/table_long1.rst b/sandbox/paultremblay/python_interface/test_files/table_long1.rst new file mode 100644 index 000000000..957fcb134 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/table_long1.rst @@ -0,0 +1,21 @@ +.. $Id$ + +Text before the table. + + +Table Appendix B.1: Woolworth Stores in USA + +.. class:: caption-non-first-page +.. rubric:: Modernized Woolworth Stores in the USA (cont) + +.. csv-table:: Modernized Woolworth Stores in the USA + :class: long + :header: "Location", "Description", "Date" + :widths: 3, 5, 2 + :file: long_table.csv + +Text after the table. + + + + diff --git a/sandbox/paultremblay/python_interface/test_files/table_long2.rst b/sandbox/paultremblay/python_interface/test_files/table_long2.rst new file mode 100644 index 000000000..a46af6d34 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/table_long2.rst @@ -0,0 +1,21 @@ +.. $Id$ + + +Text before the table. + + +Table Appendix B.1: Woolworth Stores in USA + +.. class:: caption-non-first-page +.. rubric:: Modernized Woolworth Stores in the USA (cont) + +.. csv-table:: Modernized Woolworth Stores in the USA + :class: long + :widths: 3, 5, 2 + :file: long_table.csv + +Text after the table. + + + + diff --git a/sandbox/paultremblay/python_interface/test_files/table_simple.rst b/sandbox/paultremblay/python_interface/test_files/table_simple.rst new file mode 100644 index 000000000..537021289 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/table_simple.rst @@ -0,0 +1,17 @@ +Text before table. + +===== ===== +col 1 col 2 +===== ===== +1 Second column of row 1. +2 Second column of row 2. + Second line of paragraph. +3 - Second column of row 3. + + - Second item in bullet + list (row 3, column 2). +\ Row 4; column 1 will be empty. +===== ===== + +Text after table. + diff --git a/sandbox/paultremblay/python_interface/test_files/tent.png b/sandbox/paultremblay/python_interface/test_files/tent.png Binary files differnew file mode 100644 index 000000000..c95815033 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/tent.png diff --git a/sandbox/paultremblay/python_interface/test_files/title_subtitle.rst b/sandbox/paultremblay/python_interface/test_files/title_subtitle.rst new file mode 100644 index 000000000..032e22bda --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/title_subtitle.rst @@ -0,0 +1,26 @@ +.. $Id$ + + +############# +Main Title +############# + +Subtitle +^^^^^^^^^ + +:Author: Paul Tremblay + +.. sectnum:: + +.. contents:: Table of Contents + +============ +Section 1 +============ + +text + +Section 2 +============ + +text diff --git a/sandbox/paultremblay/python_interface/test_files/toc.rst b/sandbox/paultremblay/python_interface/test_files/toc.rst new file mode 100644 index 000000000..029e399a9 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/toc.rst @@ -0,0 +1,38 @@ +.. $Id:$ + +.. example toc file + +.. sectnum:: + +.. contents:: Table of Contents + + +Stave I: Marley's Ghost +========================== + +text + +subtitle +---------- + +text + +Stave II: The First of the Three Spirits +=========================================== + +text + +Stave III: The Second of the Three Spirits +=========================================== + +text + +Stave IV: The Last of the Spirits +=================================== + +text + +Stave V: The End of It +========================== + +text diff --git a/sandbox/paultremblay/python_interface/test_files/topic.rst b/sandbox/paultremblay/python_interface/test_files/topic.rst new file mode 100644 index 000000000..7e87e4b25 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/topic.rst @@ -0,0 +1,8 @@ +.. topic:: Topic Title + + Subsequent indented lines comprise + the body of the topic, and are + interpreted as body elements. + + 2nd para. + diff --git a/sandbox/paultremblay/python_interface/test_files/transition.rst b/sandbox/paultremblay/python_interface/test_files/transition.rst new file mode 100644 index 000000000..bdd8d9a07 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/transition.rst @@ -0,0 +1,49 @@ +.. $Id$ + +Late last night, or early this morning, an incident occurred at Lower Norwood +which points, it is feared, to a serious crime. Mr. Jonas Oldacre is a well +known resident of that suburb, where he has carried on his business as a +builder for many years. Mr. Oldacre is a bachelor, fifty-two years of age, and +lives in Deep Dene House, at the Sydenham end of the road of that name. He has +had the reputation of being a man of eccentric habits, secretive and retiring. +For some years he has practically withdrawn from the business, in which he is +said to have massed considerable wealth. A small timber-yard still exists, +however, at the back of the house, and last night, about twelve o'clock, an +alarm was given that one of the stacks was on fire. The engines were soon upon +the spot, but the dry wood burned with great fury, and it was impossible to +arrest the conflagration until the stack had been entirely consumed. Up to +this point the incident bore the appearance of an ordinary accident, but fresh +indications seem to point to serious crime. Surprise was expressed at the +absence of the master of the establishment from the scene of the fire, and an +inquiry followed, which showed that he had disappeared from the house. An +examination of his room revealed that the bed had not been slept in, that a +safe which stood in it was open, that a number of important papers were +scattered about the room, and finally, that there were signs of a murderous +struggle, slight traces of blood being found within the room, and an oaken +walking-stick, which also showed stains of blood upon the handle. It is known +that Mr. Jonas Oldacre had received a late visitor in his bedroom upon that +night, and the stick found has been identified as the property of this person, +who is a young London solicitor named John Hector McFarlane, junior partner of +Graham and McFarlane, of 426 Gresham Buildings, E. C. The police believe that +they have evidence in their possession which supplies a very convincing motive +for the crime, and altogether it cannot be doubted that sensational +developments will follow. + +----------- + +LATER.—It is rumoured as we go to press that Mr. John Hector McFarlane has +actually been arrested on the charge of the murder of Mr. Jonas Oldacre. It is +at least certain that a warrant has been issued. There have been further and +sinister developments in the investigation at Norwood. Besides the signs of a +struggle in the room of the unfortunate builder it is now known that the +French windows of his bedroom (which is on the ground floor) were found to be +open, that there were marks as if some bulky object had been dragged across to +the wood-pile, and, finally, it is asserted that charred remains have been +found among the charcoal ashes of the fire. The police theory is that a most +sensational crime has been committed, that the victim was clubbed to death in +his own bedroom, his papers rifled, and his dead body dragged across to the +wood-stack, which was then ignited so as to hide all traces of the crime. The +conduct of the criminal investigation has been left in the experienced hands +of Inspector Lestrade, of Scotland Yard, who is following up the clues with +his accustomed energy and sagacity." + diff --git a/sandbox/paultremblay/python_interface/test_files/waves.png b/sandbox/paultremblay/python_interface/test_files/waves.png Binary files differnew file mode 100644 index 000000000..e180ca1c0 --- /dev/null +++ b/sandbox/paultremblay/python_interface/test_files/waves.png diff --git a/sandbox/paultremblay/python_interface/tools/att_list_to_list.xsl b/sandbox/paultremblay/python_interface/tools/att_list_to_list.xsl new file mode 100644 index 000000000..22be29d7c --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/att_list_to_list.xsl @@ -0,0 +1,50 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:g = "http://relaxng.org/ns/structure/1.0" + xmlns:str="http://exslt.org/strings" + extension-element-prefixes="str" + + + version="1.1" + > + + <xsl:output method="text"/> + <xsl:template match = "root"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="attribute-set"> + <xsl:variable name="name" select="str:replace(@name, '.attlist', '_attlist')"/> + <xsl:value-of select="$name"/> + <xsl:text> = [
</xsl:text> + <xsl:apply-templates/> + <xsl:text>]
</xsl:text> + </xsl:template> + + + <xsl:template match="attribute" priority="2"> + <xsl:text>'</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>',
</xsl:text> + </xsl:template> + + <xsl:template match="attribute[last()]" priority="3"> + <xsl:text>'</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>'</xsl:text> + </xsl:template> + + <xsl:template match="extend"> + <xsl:variable name="name" select="str:replace(@name, '.attlist', '_attlist')"/> + <xsl:value-of select="$name"/> + <xsl:text>.extend(</xsl:text> + <xsl:variable name="inherit-name" select="str:replace(@inherit-name, '.attlist', '_attlist')"/> + <xsl:value-of select="$inherit-name"/> + <xsl:text>)
</xsl:text> + </xsl:template> + + + <xsl:template match="@*|node()"/> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/tools/condense_dicts.py b/sandbox/paultremblay/python_interface/tools/condense_dicts.py new file mode 100644 index 000000000..6485e378e --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/condense_dicts.py @@ -0,0 +1,85 @@ +from docutilsToFo.docutils_fo_dicts import * +import pprint, copy +def dump(object): + pp = pprint.PrettyPrinter(indent=0) + pp.pprint(object) + +list_of_dicts2_ = [ +block_dict, +block_container_dict, +cell_dict, +flow_dict, +footnote_body_dict, +header_dict, +inline_dict, +item_body_dict, +item_label_dict, +list_block_dict, +list_item_dict, +page_sequence_dict, +region_after_dict, +region_before_dict, +region_body_dict, +simple_page_master_dict, +table_dict, +table_body_dict, +table_row_dict, +] + + + +s_block = set(block_dict) +s_block_container = set(block_container_dict) +s_cell = set(cell_dict) +s_flow = set(flow_dict) +s_footnote_body = set(footnote_body_dict) +s_header = set(header_dict) +s_inline = set(inline_dict) +s_item_body = set(item_body_dict) +s_item_label = set(item_label_dict) +s_list_block = set(list_block_dict) +s_list_item = set(list_item_dict) +s_page_sequence = set(page_sequence_dict) +s_region_after= set(region_after_dict) +s_region_before = set(region_before_dict) +s_region_body = set(region_body_dict) +s_simple_page_master= set(simple_page_master_dict) +s_table = set(table_dict) +s_table_body = set(table_body_dict) +s_table_row = set(table_row_dict) + + + +""" +new_block_container_dict = {} +diff = set(block_container_dict).difference(set(azimuth_dict)) +new_dict = {} +for item in diff: + new_dict[item] = item +dump(new_dict) +""" +""" +new_region_after_dict = {} +new_region_after_dict.update(common_dict1) +new_region_after_dict.update(padding_dict) +diff = set(new_region_after_dict).symmetric_difference(set(region_after_dict)) +new_dict = {} +for item in diff: + new_dict[item] = item +dump(new_dict) +""" +diff = set(new_region_after_dict).symmetric_difference(set(region_after_dict)) +print diff + + + +# items in the first (list_block_dict) not in second. the second is the base. +# diff = set(list_block_dict).difference(set(list_item_dict)) + + + + + + + + diff --git a/sandbox/paultremblay/python_interface/tools/make_att_list.sh b/sandbox/paultremblay/python_interface/tools/make_att_list.sh new file mode 100755 index 000000000..119833775 --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_att_list.sh @@ -0,0 +1,6 @@ +xsltproc make_att_list1.xsl temp_prop_basic.rng |xmlformat.pl > scratch1.xml +xsltproc make_att_list2.xsl scratch1.xml |xmlformat.pl > scratch2.xml +xsltproc make_att_list3.xsl scratch2.xml |xmlformat.pl > scratch3.xml +xsltproc make_att_list5.xsl scratch3.xml |xmlformat.pl > scratch4.xml +python hack.py scratch4.xml > scratch5.xml +# python scratch2.py diff --git a/sandbox/paultremblay/python_interface/tools/make_att_list.xsl b/sandbox/paultremblay/python_interface/tools/make_att_list.xsl new file mode 100644 index 000000000..0917bcb48 --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_att_list.xsl @@ -0,0 +1,10 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + +</xsl:stylesheet> + + diff --git a/sandbox/paultremblay/python_interface/tools/make_att_list1.xsl b/sandbox/paultremblay/python_interface/tools/make_att_list1.xsl new file mode 100644 index 000000000..739a6b55b --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_att_list1.xsl @@ -0,0 +1,141 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:g = "http://relaxng.org/ns/structure/1.0" + version="1.1" + > + + <xsl:template match="/g:grammar"> + <root> + <xsl:apply-templates/> + </root> + </xsl:template> + +<!-- +/g:grammar/g:define[@name = 'root.attlist']| +/g:grammar/g:define[@name = 'meta-info.attlist']| +/g:grammar/g:define[@name = 'meta-field.attlist']| +/g:grammar/g:define[@name = 'declarations.attlist']| +/g:grammar/g:define[@name = 'color-profile.attlist']| +/g:grammar/g:define[@name = 'outline.attlist']| +/g:grammar/g:define[@name = 'bookmark.attlist']| +/g:grammar/g:define[@name = 'bookmark-label.attlist']| +/g:grammar/g:define[@name = 'layout-master-set.attlist']| +/g:grammar/g:define[@name = 'page-sequence-master.attlist']| +/g:grammar/g:define[@name = 'single-page-master-reference.attlist']| +/g:grammar/g:define[@name = 'repeatable-page-master-reference.attlist']| +/g:grammar/g:define[@name = 'repeatable-page-master-alternatives.attlist']| +/g:grammar/g:define[@name = 'conditional-page-master-reference.attlist']| +/g:grammar/g:define[@name = 'simple-page-master.attlist']| +/g:grammar/g:define[@name = 'region-body.attlist']| +/g:grammar/g:define[@name = 'region-before.attlist']| +/g:grammar/g:define[@name = 'region-after.attlist']| +/g:grammar/g:define[@name = 'region-start.attlist']| +/g:grammar/g:define[@name = 'region-end.attlist']| +/g:grammar/g:define[@name = 'page-sequence.attlist']| +/g:grammar/g:define[@name = 'title.attlist']| +/g:grammar/g:define[@name = 'flow.attlist']| +/g:grammar/g:define[@name = 'static-content.attlist']| +/g:grammar/g:define[@name = 'flow-section.attlist']| +/g:grammar/g:define[@name = 'block.attlist']| +/g:grammar/g:define[@name = 'absolute-container.attlist']| +/g:grammar/g:define[@name = 'bidi-override.attlist']| +/g:grammar/g:define[@name = 'character.attlist']| +/g:grammar/g:define[@name = 'initial-property-set.attlist']| +/g:grammar/g:define[@name = 'external-graphic.attlist']| +/g:grammar/g:define[@name = 'instream-foreign-object.attlist']| +/g:grammar/g:define[@name = 'inline.attlist']| +/g:grammar/g:define[@name = 'inline-container.attlist']| +/g:grammar/g:define[@name = 'leader.attlist']| +/g:grammar/g:define[@name = 'page-number.attlist']| +/g:grammar/g:define[@name = 'page-number-citation.attlist']| +/g:grammar/g:define[@name = 'begin-index-range.attlist']| +/g:grammar/g:define[@name = 'end-index-range.attlist']| +/g:grammar/g:define[@name = 'page-index.attlist']| +/g:grammar/g:define[@name = 'index-item.attlist']| +/g:grammar/g:define[@name = 'table-and-caption.attlist']| +/g:grammar/g:define[@name = 'table-caption.attlist']| +/g:grammar/g:define[@name = 'table.attlist']| +/g:grammar/g:define[@name = 'table-column.attlist']| +/g:grammar/g:define[@name = 'row-group.attlist']| +/g:grammar/g:define[@name = 'table-header.attlist']| +/g:grammar/g:define[@name = 'table-footer.attlist']| +/g:grammar/g:define[@name = 'table-body.attlist']| +/g:grammar/g:define[@name = 'table-row.attlist']| +/g:grammar/g:define[@name = 'table-cell.attlist']| +/g:grammar/g:define[@name = 'list-block.attlist']| +/g:grammar/g:define[@name = 'list-item.attlist']| +/g:grammar/g:define[@name = 'list-item-label.attlist']| +/g:grammar/g:define[@name = 'list-item-body.attlist']| +/g:grammar/g:define[@name = 'side-float.attlist']| +/g:grammar/g:define[@name = 'before-float.attlist']| +/g:grammar/g:define[@name = 'footnote.attlist']| +/g:grammar/g:define[@name = 'footnote-body.attlist']| +/g:grammar/g:define[@name = 'basic-link.attlist']| +/g:grammar/g:define[@name = 'wrapper.attlist']| +/g:grammar/g:define[@name = 'marker.attlist']| +/g:grammar/g:define[@name = 'retrieve-marker.attlist']| +/g:grammar/g:define[@name = 'multi-switch.attlist']| +/g:grammar/g:define[@name = 'multi-case.attlist']| +/g:grammar/g:define[@name = 'multi-toggle.attlist']| +/g:grammar/g:define[@name = 'multi-properties.attlist']| +/g:grammar/g:define[@name = 'multi-property-set.attlist']| +--> + + + <xsl:template match="/g:grammar/g:define[@name = 'block.attlist']| + /g:grammar/g:define[@name = 'block-container.attlist']| + /g:grammar/g:define[@name = 'table-cell.attlist']| + /g:grammar/g:define[@name = 'flow.attlist']| + /g:grammar/g:define[@name = 'footnote-body.attlist']| + /g:grammar/g:define[@name = 'table-header.attlist']| + /g:grammar/g:define[@name = 'inline.attlist']| + /g:grammar/g:define[@name = 'list-item-body.attlist']| + /g:grammar/g:define[@name = 'list-item-label.attlist']| + /g:grammar/g:define[@name = 'list-block.attlist']| + /g:grammar/g:define[@name = 'list-item.attlist']| + /g:grammar/g:define[@name = 'page-sequence.attlist']| + /g:grammar/g:define[@name = 'region-after.attlist']| + /g:grammar/g:define[@name = 'region-before.attlist']| + /g:grammar/g:define[@name = 'region-body.attlist']| + /g:grammar/g:define[@name = 'simple-page-master.attlist']| + /g:grammar/g:define[@name = 'table.attlist']| + /g:grammar/g:define[@name = 'table-body.attlist']| + /g:grammar/g:define[@name = 'table-row.attlist'] " priority = "2"> + + + <define name="{@name}"> + <xsl:apply-templates mode = "use"/> + </define> + </xsl:template> + + <xsl:template match="g:ref" mode="use"> + <xsl:variable name="name" select = "@name"/> + <xsl:apply-templates select="/g:grammar/g:define[@name = $name]" mode="use"/> + </xsl:template> + + <xsl:template match = "g:define" mode="use"> + <xsl:variable name="name" select="@name"/> + <xsl:choose> + <xsl:when test="contains($name, '.attr')"> + <xsl:apply-templates mode = "use"/> + </xsl:when> + <xsl:otherwise> + <define name="{@name}"> + <xsl:apply-templates mode = "use"/> + </define> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="g:optional" priority="2" mode="use"> + <xsl:apply-templates mode="use"/> + </xsl:template> + + <xsl:template match="g:attribute" priority="2" mode="use"> + <attribute name="{@name}"/> + </xsl:template> + + <xsl:template match="@*|node()"/> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/tools/make_att_list2.xsl b/sandbox/paultremblay/python_interface/tools/make_att_list2.xsl new file mode 100644 index 000000000..96b1ff526 --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_att_list2.xsl @@ -0,0 +1,49 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:str="http://exslt.org/strings" + extension-element-prefixes="str" + + + version="1.1" + > + + <xsl:template match = "root"> + <root> + <xsl:apply-templates select="define/define/define/define/define/define/define"/> + <xsl:apply-templates select="define/define/define/define/define/define"/> + <xsl:apply-templates select="define/define/define/define/define"/> + <xsl:apply-templates select="define/define/define/define"/> + <xsl:apply-templates select="define/define/define"/> + <xsl:apply-templates select="define/define"/> + <xsl:apply-templates select="define"/> + </root> + </xsl:template> + + <xsl:template match="define" priority="2"> + <xsl:variable name="name" select="str:replace(@name, '-', '_')"/> + <define name="{@name}"> + <xsl:apply-templates select="attribute"/> + </define> + <xsl:for-each select="define"> + <xsl:variable name="inherit-name" select="str:replace(@name, '-', '_')"/> + <extend name = "{$name}" inherit-name = "{$inherit-name}"/> + </xsl:for-each> + <xsl:apply-templates select="define"/> + </xsl:template> + + + <xsl:template match ="define/define/define/define/define/define/define"> + <xsl:message terminate = "yes">Too deep quiting.</xsl:message> + </xsl:template> + + + <xsl:template match="attribute" priority="2"> + <attribute name="{@name}"> + <xsl:apply-templates/> + </attribute> + </xsl:template> + + <xsl:template match="@*|node()"/> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/tools/make_att_list3.xsl b/sandbox/paultremblay/python_interface/tools/make_att_list3.xsl new file mode 100644 index 000000000..55112412c --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_att_list3.xsl @@ -0,0 +1,44 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:str="http://exslt.org/strings" + extension-element-prefixes="str" + version="1.1" + > + + <xsl:template match = "root" priority = "2"> + <root> + <xsl:apply-templates select="define"/> + <xsl:apply-templates select="extend"/> + </root> + </xsl:template> + + <xsl:template match="attribute|extend" priority="2"> + <xsl:copy-of select="."/> + </xsl:template> + + + <xsl:template match="define" priority="2"> + <xsl:variable name="name" select="str:replace(@name, '-', '_')"/> + <xsl:variable name="a-name" select="@name"/> + <xsl:if test = "not(preceding::define[@name = $a-name])"> + <attribute-set name="{$name}"> + <xsl:apply-templates/> + </attribute-set> + </xsl:if> + </xsl:template> + + <xsl:template match="extend_" priority="2"> + <xsl:variable name="name" select="@name"/> + <xsl:if test = "not(preceding::extend[@name = $name])"> + <xsl:copy-of select="."/> + </xsl:if> + </xsl:template> + + <xsl:template match="*"> + <xsl:message> + No match for + <xsl:value-of select="name(.)"/> + </xsl:message> + </xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/tools/make_att_list4.xsl b/sandbox/paultremblay/python_interface/tools/make_att_list4.xsl new file mode 100644 index 000000000..b85961b6d --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_att_list4.xsl @@ -0,0 +1,43 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:g = "http://relaxng.org/ns/structure/1.0" + xmlns:str="http://exslt.org/strings" + extension-element-prefixes="str" + + + version="1.1" + > + + <xsl:output method="text"/> + <xsl:template match = "root"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="define" priority="2"> + <!-- + <xsl:variable name="name" select="str:replace(@name, '-', '_')"/> + --> + <xsl:value-of select="$name"/> + <xsl:text> = [ 
 </xsl:text> + <xsl:apply-templates select="attribute"/> + <xsl:text>]
 </xsl:text> + <xsl:for-each select="define"> + <xsl:value-of select = "$name"/> + <xsl:text>.extend(</xsl:text> + <xsl:variable name="inherit-name" select="str:replace(@name, '-', '_')"/> + <xsl:value-of select="$inherit-name"/> + <xsl:text>)
</xsl:text> + </xsl:for-each> + <xsl:apply-templates select="define"/> + </xsl:template> + + <xsl:template match="attribute" priority="2"> + <xsl:text>'</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>',
</xsl:text> + </xsl:template> + + <xsl:template match="@*|node()"/> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/tools/make_att_list5.xsl b/sandbox/paultremblay/python_interface/tools/make_att_list5.xsl new file mode 100644 index 000000000..a58b85d81 --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_att_list5.xsl @@ -0,0 +1,32 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:str="http://exslt.org/strings" + extension-element-prefixes="str" + version="1.1" > + + <xsl:template match="root"> + <root> + <xsl:apply-templates select="attribute-set"> + <xsl:sort select="@name"/> + </xsl:apply-templates> + <xsl:apply-templates select="extend"/> + </root> + </xsl:template> + + <xsl:template match="attribute-set"> + <xsl:copy-of select="."/> + </xsl:template> + + <xsl:template match="extend"> + <xsl:variable name="name" select="@name"/> + <xsl:variable name="inherit-name" select="@inherit-name"/> + <xsl:choose> + <xsl:when test="preceding::extend[@name = $name][@inherit-name = $inherit-name]"> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="."/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/tools/make_att_set_dict.xsl b/sandbox/paultremblay/python_interface/tools/make_att_set_dict.xsl new file mode 100644 index 000000000..f79347ec8 --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_att_set_dict.xsl @@ -0,0 +1,188 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:output method="text"/> + + <xsl:template match="xsl:stylesheet"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="/"> + <xsl:text>att_set_dict = {
</xsl:text> + + <xsl:apply-templates select="document('../xsl_fo/root.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/page.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/bibliographic_fields.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/front_matter.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/header_footer.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/toc.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/section.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/body_elements.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/bullet_list.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/enumerated_list.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/definition_list.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/field_list.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/option_list.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/line_block.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/table.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/footnote.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/admonitions.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/image_figure.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/body_directives.xsl')/xsl:stylesheet"/> + <xsl:apply-templates select="document('../xsl_fo/inline.xsl')/xsl:stylesheet"/> + <xsl:text>}</xsl:text> + </xsl:template> + + <xsl:template match="xsl:attribute-set" priority="2"> + <xsl:variable name="name" select="@name"/> + <xsl:choose> + <xsl:when test="substring($name, string-length($name) -5) = '-block'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'block'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -13) = '-page-sequence'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'page-sequence'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -4) = '-flow'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'flow'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -6) = '-inline'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'inline'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -9) = '-list-item'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'list-item'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -10) = '-item-label'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'item-label'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -9) = '-item-body'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'item-body'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -15) = '-block-container'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'block-container'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -4) = 'table'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'table'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -11) = 'table-header'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'table-header'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -3) = 'cell'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'cell'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -9) = 'table-body'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'table-body'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -8) = 'table-row'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'table-row'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -10) = 'region-body'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'region-body'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -5) = 'header'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'header'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -12) = 'footnote-body'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'footnote-body'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -17) = 'simple-page-master'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'simple-page-master'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -12) = 'region-before'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'region-before'],
</xsl:text> + </xsl:when> + <xsl:when test="substring($name, string-length($name) -11) = 'region-after'"> + <xsl:text>'</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>':['</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>', 'region-after'],
</xsl:text> + </xsl:when> + + <xsl:otherwise> + <xsl:text>??? </xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>
</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="@*|node()"/> + + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/tools/make_extend_table.py b/sandbox/paultremblay/python_interface/tools/make_extend_table.py new file mode 100644 index 000000000..5ae948710 --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_extend_table.py @@ -0,0 +1,313 @@ +import os, sys +TEST = False +num_styles = 30 +if TEST: + en = 3 +else: + en = num_styles + 1 + +ss = '/Users/cynthia/tmp/paultremblay/docutilsToFo/xsl_fo/table_extended.xsl' +write_obj = file(ss, 'w') +start= """<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + + <!-- $Id$ -->\n\n""" + +write_obj.write(start) +# write attribute sets + +for n in range(1,en): + s = """\n <xsl:attribute-set name="table%s-block-container"> + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">12pt</xsl:attribute> + </xsl:attribute-set>\n""" % (n) + write_obj.write(s) + + s = """\n <xsl:attribute-set name="table%s"> + <xsl:attribute name="table-layout">fixed</xsl:attribute> + <xsl:attribute name="inline-progression-dimension">100%%</xsl:attribute> + </xsl:attribute-set>\n""" % (n) + write_obj.write(s) + + s = """\n <xsl:attribute-set name="table%s-header"> + </xsl:attribute-set>\n""" % (n) + write_obj.write(s) + + s = """\n <xsl:attribute-set name="table%s-header-cell"> + </xsl:attribute-set>\n""" % (n) + write_obj.write(s) + + s = """\n <xsl:attribute-set name="table%s-header-block"> + </xsl:attribute-set>\n""" % (n) + write_obj.write(s) + + s = """\n <xsl:attribute-set name="table%s-body"> + </xsl:attribute-set>\n""" % (n) + write_obj.write(s) + + s = """\n <xsl:attribute-set name="table%s-header-row"> + </xsl:attribute-set>\n""" % (n) + write_obj.write(s) + + s = """\n <xsl:attribute-set name="table%s-row"> + <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + </xsl:attribute-set>\n""" % (n) + write_obj.write(s) + + s = """\n <xsl:attribute-set name="table%s-cell" > + </xsl:attribute-set>\n""" % (n) + write_obj.write(s) + + s = """\n <xsl:attribute-set name="cell%s-block"> + </xsl:attribute-set>\n""" % (n) + write_obj.write(s) + +s = """\n <!--END OF ATTRIBUTE SETS-->\n""" +write_obj.write(s) + +s = """\n <xsl:template name="make-fo-table-cols"> + <xsl:param name="cols-string"/> + <xsl:param name="col-num">1</xsl:param> + <xsl:variable name="before-comma" + select="normalize-space(substring-before($cols-string, ','))" /> + <xsl:variable name="col-width"> + <xsl:choose> + <xsl:when test="$before-comma"> + <xsl:value-of select="$before-comma"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$cols-string"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:choose> + <xsl:when test="$col-width != ''"> + <fo:table-column column-number="{$col-num}" + column-width="proportional-column-width({$col-width})"/> + <xsl:call-template name="make-fo-table-cols"> + <xsl:with-param name="cols-string" + select= "normalize-space(substring-after($cols-string, ','))"/> + <xsl:with-param name="col-num" select="$col-num + 1"/> + </xsl:call-template> + </xsl:when> + </xsl:choose> + </xsl:template>\n""" +write_obj.write(s) + +s= """\n <xsl:template name="get-column-widths"> + <xsl:param name="classes"/> + <xsl:variable name="columns"> + <xsl:choose>""" + +write_obj.write(s) + +for n in range(1,en): + s= """\n <xsl:when test="$classes = 'table%s'"> + <xsl:value-of select="$table%s-cols"/> + </xsl:when>\n""" % (n, n) + write_obj.write(s) + +s= """\n <xsl:when test="$classes = 'borderless'"> + <xsl:value-of select="$table-borderless-cols"/> + </xsl:when> + + <xsl:when test="$classes = 'long'"> + <xsl:value-of select="$table-long-cols"/> + </xsl:when> + + <xsl:when test="$classes = ''"> + <xsl:value-of select="$table-cols"/> + </xsl:when> + + </xsl:choose> + </xsl:variable> + <xsl:value-of select="$columns"/> + </xsl:template>\n""" + +write_obj.write(s) + +s = """\n + <xsl:template name="make-col-specs"> + <xsl:param name="classes"/> + <xsl:variable name="columns"> + <xsl:call-template name = "get-column-widths"> + <xsl:with-param name="classes" select = "$classes"/> + </xsl:call-template> + </xsl:variable> + <xsl:choose> + <xsl:when test="$columns != ''"> + <xsl:call-template name="make-fo-table-cols"> + <xsl:with-param name="cols-string" select="$columns"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="tgroup/colspec" mode="use"> + <xsl:with-param name="classe" select="$classes"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="cols-spanned"> + <xsl:choose> + <xsl:when test="@morecols"> + <xsl:value-of select="@morecols + 1"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="rows-spanned"> + <xsl:choose> + <xsl:when test="@morerows"> + <xsl:value-of select="@morerows + 1"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:template>\n""" + +write_obj.write(s) + +s= """\n <xsl:template match="tgroup/colspec" mode="use"> + <xsl:variable name="col-num"> + <xsl:number/> + </xsl:variable> + <fo:table-column column-number="{$col-num}" + column-width="proportional-column-width({@colwidth})"/> + </xsl:template> + + <xsl:template match="tgroup" > + <xsl:param name="classes"/> + <xsl:apply-templates > + <xsl:with-param name="classes" select="$classes"/> + </xsl:apply-templates> + </xsl:template>\n""" + +write_obj.write(s) + +for n in range(1,en): + s = """\n + <xsl:template match="table[@classes='table%s']"> + <fo:block-container xsl:use-attribute-sets = "table%s-block-container"> + <xsl:if test="title and $table-title-placement = 'top'"> + <xsl:apply-templates select="title" /> + </xsl:if> + <fo:table role="table%s" xsl:use-attribute-sets="table%s"> + <xsl:call-template name="make-col-specs"> + <xsl:with-param name="classes" select="@classes"/> + </xsl:call-template> + <xsl:apply-templates > + <xsl:with-param name="classes" select="@classes"/> + </xsl:apply-templates> + </fo:table> + <xsl:if test="title and $table-title-placement = 'bottom'"> + <xsl:apply-templates select="title" /> + </xsl:if> + </fo:block-container> + </xsl:template> + + + <xsl:template match="table[@classes = 'table%s']/tgroup/thead" > + <fo:table-header xsl:use-attribute-sets = "table%s-header"> + <xsl:apply-templates /> + </fo:table-header> + </xsl:template> + + <xsl:template match="table[@classes='table%s']/tgroup//thead/row" > + <fo:table-row xsl:use-attribute-sets="table%s-header-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table%s']/tgroup/thead/row/entry" > + <fo:table-cell xsl:use-attribute-sets="table%s-header-cell"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:template> + + <xsl:template match="table[@classes='table%s']/tgroup/thead/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="table%s-header-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + + <xsl:template match="table[@classes='table%s']/tgroup/tbody" > + <fo:table-body xsl:use-attribute-sets="table%s-body"> + <xsl:apply-templates /> + </fo:table-body> + </xsl:template> + + <xsl:template match="table[@classes='table%s']/tgroup/tbody/row" > + <fo:table-row xsl:use-attribute-sets="table%s-row"> + <xsl:apply-templates /> + </fo:table-row> + </xsl:template> + + <xsl:template match="table[@classes='table%s']/tgroup/tbody/row/entry" > + <xsl:variable name="cols-spanned"> + <xsl:call-template name="cols-spanned"/> + </xsl:variable> + <xsl:variable name="rows-spanned"> + <xsl:call-template name="rows-spanned"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> + <fo:table-cell xsl:use-attribute-sets="table%s-cell"> + <xsl:apply-templates/> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$cols-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table%s-cell" + number-rows-spanned="{$rows-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:when test="$rows-spanned= 1"> + <fo:table-cell xsl:use-attribute-sets="table%s-cell" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:when> + <xsl:otherwise> + <fo:table-cell xsl:use-attribute-sets="table%s-cell" + number-rows-spanned="{$rows-spanned}" + number-columns-spanned="{$cols-spanned}"> + <xsl:apply-templates /> + <xsl:if test="not(paragraph)"> + <fo:block/> + </xsl:if> + </fo:table-cell> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="table[@classes='table%s']/tgroup/tbody/row/entry/paragraph" > + <fo:block xsl:use-attribute-sets="cell%s-block"> + <xsl:apply-templates/> + </fo:block> + </xsl:template>\n""" % (n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n) + + write_obj.write(s) + +s ="""\n <xsl:template match="title" mode="classes"/>\n\n""" +write_obj.write(s) + +end = '</xsl:stylesheet>' +write_obj.write(end) + +write_obj.close() diff --git a/sandbox/paultremblay/python_interface/tools/make_my_att_list.xsl b/sandbox/paultremblay/python_interface/tools/make_my_att_list.xsl new file mode 100644 index 000000000..189c79240 --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_my_att_list.xsl @@ -0,0 +1,73 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1" + > + <!-- $Id$ --> + + <xsl:output method="text"/> + + <xsl:template match="/|/xsl:stylesheet" priority="2"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="xsl:attribute-set" priority="2"> + <xsl:variable name="name" select="@name"/> + <xsl:variable name="element"> + <xsl:for-each select="/"> + <xsl:for-each select="descendant::*[@xsl:use-attribute-sets = $name][1]"> + <xsl:value-of select="local-name(.)"/> + </xsl:for-each> + </xsl:for-each> + </xsl:variable> + <xsl:variable name="type"> + <xsl:choose> + + <xsl:when test="$name = 'default-cell'"> + <xsl:text>table-cell</xsl:text> + </xsl:when> + <xsl:when test="$name = 'default-flow'"> + <xsl:text>flow</xsl:text> + </xsl:when> + <xsl:when test="$name = 'default-page-sequence'"> + <xsl:text>page-sequence</xsl:text> + </xsl:when> + <xsl:when test="$name = 'paper-size-simple-page-master' or + $name = 'default-simple-page-master' + + "> + <xsl:text>simple-page-master</xsl:text> + </xsl:when> + <xsl:when test="$name = 'default-footnote-label-inline'"> + <xsl:text>inline</xsl:text> + </xsl:when> + <xsl:when test="$name = 'default-admonition-outer-block' or + $name = 'default-admonition-title-block' or + $name = 'default-section-title-block' or + $name = 'toc-entry-defaults-block' + "> + <xsl:text>block</xsl:text> + </xsl:when> + <xsl:when test = "not(normalize-space($element))"> + <xsl:message terminate = "no"> + <xsl:text>No match for </xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>
</xsl:text> + </xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$element"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:value-of select="$name"/> + <xsl:text> </xsl:text> + <xsl:value-of select="$type"/> + <xsl:text>
</xsl:text> + </xsl:template> + + <xsl:template match="@*|node()"/> + + +</xsl:stylesheet> + diff --git a/sandbox/paultremblay/python_interface/tools/make_my_attset_list.py b/sandbox/paultremblay/python_interface/tools/make_my_attset_list.py new file mode 100644 index 000000000..8d9304219 --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_my_attset_list.py @@ -0,0 +1,44 @@ +import os, sys, glob, pprint, commands +sys.path.insert(0, '../docutilsToFo') +from docutils_fo_dicts import att_set_dict + +def dump(w_obj, object): + pp = pprint.PrettyPrinter(indent=0) + w_obj.write(pp.pformat(object)) + w_obj.write('\n') + +ss = '/Users/cynthia/tmp/paultremblay/tools/make_my_att_list.xsl' +current_dir = os.getcwd() +os.chdir('../docutilsToFo/xsl_fo') +paths = glob.glob('*xsl') +the_dict = {} +for the_path in paths: + command = 'xsltproc %s %s' % (ss, the_path) + status, output = commands.getstatusoutput(command) + entries = output.split('\n') + for entry in entries: + if not entry: + continue + if 'No match' in entry: + sys.stderr.write('%s\n' % (the_path)) + sys.stderr.write('%s\n' % (entry)) + sys.exit(1) + continue + try: + first, second = entry.split() + the_dict[first] = second + except: + pass + +os.chdir(current_dir) +if the_dict != att_set_dict: + write_file = os.path.join('..', 'docutilsToFo', 'att_set_dict.py') + if not os.path.isfile(write_file): + sys.stderr.write('Can\'t find %s\n' % (write_file)) + sys.exit(1) + write_obj = file(write_file, 'w') + write_obj.write('att_set_dict = ') + sys.stderr.write('Updating docutilsToFo/att_set_dict.py\n') + dump(write_obj, the_dict) + write_obj.close() + diff --git a/sandbox/paultremblay/python_interface/tools/make_params.xsl b/sandbox/paultremblay/python_interface/tools/make_params.xsl new file mode 100644 index 000000000..1f936165d --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_params.xsl @@ -0,0 +1,27 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.1"> + + <!-- $Id$ --> + + <xsl:output method="text"/> + <xsl:template match="xsl:stylesheet"> + <xsl:text>param_dict = {
</xsl:text> + <xsl:apply-templates/> + <xsl:text>}</xsl:text> + </xsl:template> + + + <xsl:template match="xsl:param"> + <xsl:text>'</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>' : '</xsl:text> + <xsl:value-of select="."/> + <xsl:text>',</xsl:text> + <xsl:text>
</xsl:text> + </xsl:template> + + <xsl:template match="@*|node()"/> + +</xsl:stylesheet> diff --git a/sandbox/paultremblay/python_interface/tools/make_templates.py b/sandbox/paultremblay/python_interface/tools/make_templates.py new file mode 100644 index 000000000..c3d41e0e6 --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/make_templates.py @@ -0,0 +1,111 @@ +import os, sys +fs = 'table' +ss = '-block-container' +s=""" <xsl:template match= "xsl:attribute-set[@name='%s1%s']|\n""" % (fs, ss) +for n in range(2,31): + s += """ xsl:attribute-set[@name='%s%s%s']|\n""" % (fs, n, ss) +s = s[:-2] +s += '"' +s += """ priority="3"/>""" + + +sys.stdout.write(s) + +s = '\n\n\n' +fs = 'table' +ss = '' +s+=""" <xsl:template match= "xsl:attribute-set[@name='%s1%s']|\n""" % (fs, ss) +for n in range(2,31): + s += """ xsl:attribute-set[@name='%s%s%s']|\n""" % (fs, n, ss) +s = s[:-2] +s += '"' +s += """ priority="3"/>""" +sys.stdout.write(s) + +s = '\n\n\n' +fs = 'thead' +ss = '-header' +s+=""" <xsl:template match= "xsl:attribute-set[@name='%s1%s']|\n""" % (fs, ss) +for n in range(2,31): + s += """ xsl:attribute-set[@name='%s%s%s']|\n""" % (fs, n, ss) +s = s[:-2] +s += '"' +s += """ priority="3"/>""" +sys.stdout.write(s) + +s = '\n\n\n' +fs = 'thead' +ss = '-cell' +s+=""" <xsl:template match= "xsl:attribute-set[@name='%s1%s']|\n""" % (fs, ss) +for n in range(2,31): + s += """ xsl:attribute-set[@name='%s%s%s']|\n""" % (fs, n, ss) +s = s[:-2] +s += '"' +s += """ priority="3"/>""" +sys.stdout.write(s) + +s = '\n\n\n' +fs = 'thead' +ss = '-block' +s+=""" <xsl:template match= "xsl:attribute-set[@name='%s1%s']|\n""" % (fs, ss) +for n in range(2,31): + s += """ xsl:attribute-set[@name='%s%s%s']|\n""" % (fs, n, ss) +s = s[:-2] +s += '"' +s += """ priority="3"/>""" +sys.stdout.write(s) + +s = '\n\n\n' +fs = 'table' +ss = '-body' +s+=""" <xsl:template match= "xsl:attribute-set[@name='%s1%s']|\n""" % (fs, ss) +for n in range(2,31): + s += """ xsl:attribute-set[@name='%s%s%s']|\n""" % (fs, n, ss) +s = s[:-2] +s += '"' +s += """ priority="3"/>""" +sys.stdout.write(s) + +s = '\n\n\n' +fs = 'table' +ss = '-header-row' +s+=""" <xsl:template match= "xsl:attribute-set[@name='%s1%s']|\n""" % (fs, ss) +for n in range(2,31): + s += """ xsl:attribute-set[@name='%s%s%s']|\n""" % (fs, n, ss) +s = s[:-2] +s += '"' +s += """ priority="3"/>""" +sys.stdout.write(s) + +s = '\n\n\n' +fs = 'table' +ss = '-row' +s+=""" <xsl:template match= "xsl:attribute-set[@name='%s1%s']|\n""" % (fs, ss) +for n in range(2,31): + s += """ xsl:attribute-set[@name='%s%s%s']|\n""" % (fs, n, ss) +s = s[:-2] +s += '"' +s += """ priority="3"/>""" +sys.stdout.write(s) + +s = '\n\n\n' +fs = 'table' +ss = '-cell' +s+=""" <xsl:template match= "xsl:attribute-set[@name='%s1%s']|\n""" % (fs, ss) +for n in range(2,31): + s += """ xsl:attribute-set[@name='%s%s%s']|\n""" % (fs, n, ss) +s = s[:-2] +s += '"' +s += """ priority="3"/>""" +sys.stdout.write(s) + +s = '\n\n\n' +fs = 'cell' +ss = '-block' +s+=""" <xsl:template match= "xsl:attribute-set[@name='%s1%s']|\n""" % (fs, ss) +for n in range(2,31): + s += """ xsl:attribute-set[@name='%s%s%s']|\n""" % (fs, n, ss) +s = s[:-2] +s += '"' +s += """ priority="3"/>""" +sys.stdout.write(s) diff --git a/sandbox/paultremblay/python_interface/tools/temp_prop_basic.rng b/sandbox/paultremblay/python_interface/tools/temp_prop_basic.rng new file mode 100644 index 000000000..87886b70a --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/temp_prop_basic.rng @@ -0,0 +1,5244 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ========================================================= + + (c) 2004, RenderX + + Author: Alexander Peshkov <peshkov@renderx.com> + + Permission is granted to use this document, copy and + modify free of charge, provided that every derived work + bear a reference to the present document. + + This document contains a computer program written in + XSL Transformations Language. It is published with no + warranty of any kind about its usability, as a mere + example of XSL technology. RenderX shall not be + considered liable for any damage or loss of data caused + by use of this program. + + ========================================================= +--> +<grammar xmlns="http://relaxng.org/ns/structure/1.0"> + <include href="basic_properties.rng"/> + + <!-- + **************************************************************************************** + Properties used by top-level elements + **************************************************************************************** + =============================================================== + Root element can bear inheritable properties, passed further to + fo:flows/fo:static-contents. Inheritable properties from fo:layout-master-set + are banned in this version of schema. + =============================================================== + --> + <define name="root.attlist"> + <optional> + <ref name="media-usage.attr"/> + </optional> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Document meta information - RenderX extension + =============================================================== + --> + <define name="meta-info.attlist"> + <empty/> + </define> + <define name="meta-field.attlist"> + <ref name="name.attr"/> + <ref name="value.attr"/> + </define> + <!-- + =============================================================== + Color profile declarations + =============================================================== + --> + <define name="declarations.attlist"> + <empty/> + </define> + <define name="color-profile.attlist"> + <ref name="src.attr"/> + <ref name="color-profile-name.attr"/> + <optional> + <ref name="rendering-intent.attr"/> + </optional> + </define> + <!-- + =============================================================== + Bookmarks - RenderX extension + =============================================================== + --> + <define name="outline.attlist"> + <empty/> + </define> + <define name="bookmark.attlist"> + <choice> + <ref name="internal-destination.attr"/> + <ref name="external-destination.attr"/> + </choice> + <optional> + <ref name="collapse-subtree.attr"/> + </optional> + </define> + <define name="bookmark-label.attlist"> + <empty/> + </define> + <!-- + =============================================================== + Layout-master-set contains a set of page-masters. Neither of + its descendants generates any area, so no inherited elements + can be specified on it or on its children. + =============================================================== + --> + <define name="layout-master-set.attlist"> + <empty/> + </define> + <!-- + =============================================================== + Page sequence master + =============================================================== + --> + <define name="page-sequence-master.attlist"> + <ref name="master-name.attr"/> + </define> + <!-- + =============================================================== + Sequence specifiers. + =============================================================== + --> + <define name="single-page-master-reference.attlist"> + <ref name="master-reference.attr"/> + </define> + <define name="repeatable-page-master-reference.attlist"> + <ref name="master-reference.attr"/> + <optional> + <ref name="maximum-repeats.attr"/> + </optional> + </define> + <define name="repeatable-page-master-alternatives.attlist"> + <optional> + <ref name="maximum-repeats.attr"/> + </optional> + </define> + <define name="conditional-page-master-reference.attlist"> + <ref name="master-reference.attr"/> + <optional> + <ref name="page-position.attr"/> + </optional> + <optional> + <ref name="odd-or-even.attr"/> + </optional> + <optional> + <ref name="blank-or-not-blank.attr"/> + </optional> + </define> + <!-- + =============================================================== + Simple page master defines a page layout. It does not + explicitly generate any content. Most of its properties are + local except for writing-mode and reference-orientation that + are inherited by the underlying region-* objects. + =============================================================== + NOTE. We could think about a common background/padding/border + for every page instance generated by the page master. For such + a scope, we may add borders/padding/background to its features. + However, in the current version this is ruled out explicitly by the XSL specs. + --> + <define name="simple-page-master.attlist"> + <ref name="margin-properties-CSS"/> + <ref name="master-name.attr"/> + <optional> + <ref name="page-height.attr"/> + </optional> + <optional> + <ref name="page-width.attr"/> + </optional> + <optional> + <ref name="reference-orientation.attr"/> + </optional> + <optional> + <ref name="size.attr"/> + </optional> + <optional> + <ref name="writing-mode.attr"/> + </optional> + </define> + <!-- + =============================================================== + Region elements by themselves do not generate any content. + Reference-orientation and writing-mode may be inherited from + the page master; all other features are local. + =============================================================== + --> + <define name="region-properties"> + <ref name="border-padding-background-properties"/> + <ref name="area-properties"/> + <optional> + <ref name="region-name.attr"/> + </optional> + </define> + <!-- + =============================================================== + Body region: middle of the page. Unlike side regions, this one + may have multiple columns. + =============================================================== + NOTE: We have restricted margin properties to be margin-only, + allowing no spaces. This is done because no clear semantics + can be ascribed to single components of a space vector. + --> + <define name="region-body.attlist"> + <ref name="region-properties"/> + <ref name="margin-properties-CSS"/> + <optional> + <ref name="column-count.attr"/> + </optional> + <optional> + <ref name="column-gap.attr"/> + </optional> + </define> + <!-- + =============================================================== + Side regions: page edges. These regions have extent and + precedence that is used to arbitrate corner conflicts. Side + regions are viewed as frames, and may not have margins. + =============================================================== + NOTE: Extent made obligatory: its default value of 0.0pt does not + make much sense. + --> + <define name="region-before.attlist"> + <ref name="region-properties"/> + <ref name="extent.attr"/> + <optional> + <ref name="precedence.attr"/> + </optional> + </define> + <define name="region-after.attlist"> + <ref name="region-properties"/> + <ref name="extent.attr"/> + <optional> + <ref name="precedence.attr"/> + </optional> + </define> + <define name="region-start.attlist"> + <ref name="region-properties"/> + <ref name="extent.attr"/> + </define> + <define name="region-end.attlist"> + <ref name="region-properties"/> + <ref name="extent.attr"/> + </define> + <!-- + =============================================================== + Page sequence. + =============================================================== + --> + <define name="page-sequence.attlist"> + <optional> + <ref name="format.attr"/> + </optional> + <optional> + <ref name="letter-value.attr"/> + </optional> + <optional> + <ref name="grouping-separator.attr"/> + </optional> + <optional> + <ref name="grouping-size.attr"/> + </optional> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <optional> + <ref name="initial-page-number.attr"/> + </optional> + <optional> + <ref name="force-page-count.attr"/> + </optional> + <ref name="master-reference.attr"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Title + =============================================================== + MEMO: Why 'id' attribute is not allowed here? + MEMO: Does it makes sence to add relative-position here? + According to Section 7.12.1. "relative-position" it is allowed everywhere except fo:block-container + Should we allow all inline properties here?? + --> + <define name="title.attlist"> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="border-padding-background-properties"/> + <ref name="margin-properties-inline"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Flows. 'flow-name' feature defines linkage of the flow to a region in the page master. + =============================================================== + --> + <define name="flow-properties"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="flow-name.attr"/> + <ref name="inheritable-properties"/> + </define> + <define name="flow.attlist"> + <ref name="flow-properties"/> + </define> + <define name="static-content.attlist"> + <ref name="flow-properties"/> + </define> + <!-- + =============================================================== + An extension element, rx:flow-section. + Acts like a top-level block with multiple columns. + =============================================================== + --> + <define name="flow-section.attlist"> + <optional> + <ref name="column-count.attr"/> + </optional> + <optional> + <ref name="column-gap.attr"/> + </optional> + <ref name="border-padding-background-properties"/> + <ref name="margin-properties-block"/> + <ref name="inheritable-properties"/> + </define> + <!-- + **************************************************************************************** + Properties used by content-bearing elements + **************************************************************************************** + --> + <!-- + =============================================================== + Properties of block formatting objects. + =============================================================== + =============================================================== + Besides properties used to format the block itself, it also conveys + formatting information to its inline-level children. + =============================================================== + --> + <define name="block.attlist"> + <ref name="block-properties"/> + <ref name="character-properties-unheritable"/> + <optional> + <ref name="text-altitude.attr"/> + </optional> + <optional> + <ref name="text-depth.attr"/> + </optional> + </define> + <!-- + =============================================================== + Block container + =============================================================== + --> + <!-- + MEMO: We are forced to create separate element 'absolute-container' in order + to satisfy XSL FO spec requirements. + --> + <define name="absolute-container.attlist"> + <ref name="absolute-position-properties"/> + <ref name="area-properties-unheritable"/> + <ref name="box-size-properties"/> + <ref name="common-block-properties"/> + <optional> + <ref name="z-index.attr"/> + </optional> + </define> + <!-- + 'Usual' container element + MEMO: XSLFO spec prohibits use of 'relative-position' for fo:block-container, + but we believe that it should be allowed for non-absolutely positioned containers. + --> + <define name="block-container.attlist"> + <ref name="area-properties-unheritable"/> + <ref name="box-size-properties"/> + <ref name="block-properties"/> + <optional> + <ref name="container-position.attr"/> + </optional> + <optional> + <ref name="z-index.attr"/> + </optional> + </define> + <!-- + =============================================================== + Properties of inline formatting objects. + =============================================================== + =============================================================== + Unicode bidi-override + =============================================================== + MEMO: This element is 'half-inline' accroding to spec, since it's exhibits the same + bahavior and used in the same context but yet cannot carry some of inline-level + properties such as margins and border. + We use the same set of properties as for inline here (except for unicode-bidi and + width properties) since we believe that this is a typical inline element. + Moreover fo:bidi-override is redundant from semantic point of view since it do not + carry any additional information compared to regular fo:inline - just add + 'unicode-bidi' to fo:inline and you do not need fo:bidi-override anymore. + --> + <define name="bidi-override.attlist"> + <ref name="inline-properties"/> + <optional> + <ref name="unicode-bidi.attr"/> + </optional> + </define> + <!-- + MEMO: 'Folint' believes that direction property is required for fo:bidi-override, + but this is against the spec since this property can be inherited. + --> + <!-- + =============================================================== + Single character + =============================================================== + --> + <define name="character.attlist"> + <ref name="character.attr"/> + <optional> + <ref name="suppress-at-line-break.attr"/> + </optional> + <optional> + <ref name="treat-as-word-space.attr"/> + </optional> + <ref name="common-inline-properties"/> + </define> + <!-- + =============================================================== + Initial property set specifies properties for one or more lines + =============================================================== + MEMO: Spec is contradictory here. It states that use of this object is equivalent to + the fo:wrapper around the first line. At the same time spec allows on this element + such properties as 'Common Border, Padding, and Background Properties' + - fo:wrapper can't have border/padding/etc and can bear inheritable properties only. + We believe that this element should be treated as inline and thus should have + appropriate properties set. + --> + <define name="initial-property-set.attlist"> + <ref name="common-inline-properties"/> + </define> + <!-- + =============================================================== + External graphic + =============================================================== + --> + <define name="external-graphic.attlist"> + <ref name="graphic-properties"/> + <optional> + <ref name="src.attr"/> + </optional> + </define> + <!-- + =============================================================== + In-stream graphic + =============================================================== + --> + <define name="instream-foreign-object.attlist"> + <ref name="graphic-properties"/> + </define> + <!-- + =============================================================== + Inline + =============================================================== + --> + <define name="inline.attlist"> + <ref name="height-properties"/> + <ref name="inline-properties"/> + </define> + <!-- + =============================================================== + Inline container + =============================================================== + FIXME! We believe that this element should not bear not-inheritable properties, + which applies to text since it can't have text children. + Therefor we do not use 'common-inline-properties' set. + --> + <define name="inline-container.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="area-alignment-properties"/> + <ref name="border-padding-background-properties"/> + <ref name="keeps-properties-atomic"/> + <ref name="margin-properties-inline"/> + <ref name="relative-position-properties"/> + <ref name="area-properties-unheritable"/> + <ref name="box-size-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Leader + =============================================================== + --> + <define name="leader.attlist"> + <ref name="inline-properties"/> + </define> + <!-- + MEMO: Note that 'inline-properties' includes block-level inheritable properties. + But it's OK in our content-model since it allows block-level descendants wrapped + into fo:inline-container. + At the same time block-level inheritable properties includes leader properties, + since they are inheritable... + --> + <!-- + =============================================================== + Page Number + =============================================================== + --> + <define name="page-number.attlist"> + <ref name="common-inline-properties"/> + <optional> + <ref name="wrap-option.attr"/> + </optional> + </define> + <!-- + =============================================================== + Page number citation + =============================================================== + --> + <define name="page-number-citation.attlist"> + <ref name="common-inline-properties"/> + <optional> + <ref name="wrap-option.attr"/> + </optional> + <ref name="ref-id.attr"/> + </define> + <!-- + =============================================================== + Atomic elements for index ranges markup + =============================================================== + --> + <define name="begin-index-range.attlist"> + <ref name="id.attr"/> + <ref name="rx-key.attr"/> + </define> + <define name="end-index-range.attlist"> + <ref name="ref-id.attr"/> + </define> + <!-- + =============================================================== + Page number list - index entry + =============================================================== + --> + <define name="page-index.attlist"> + <ref name="common-inline-properties"/> + <optional> + <ref name="wrap-option.attr"/> + </optional> + <optional> + <ref name="list-separator.attr"/> + </optional> + <optional> + <ref name="ref-key.attr"/> + </optional> + </define> + <!-- + MEMO: There is no 'ref-key' attribute on page-index now, but it is allowed for + backward compatibility. + MEMO: Actually it makes sense to exclude id/rx:key fom the set of availabe properties + for 'index-item', however we prefer no to do it just to avoid creation of yet another content + model (attribute set) for thid inline element. + --> + <define name="index-item.attlist"> + <ref name="common-inline-properties"/> + <optional> + <ref name="wrap-option.attr"/> + </optional> + <ref name="ref-key.attr"/> + <optional> + <ref name="link-back.attr"/> + </optional> + <optional> + <ref name="range-separator.attr"/> + </optional> + <optional> + <ref name="merge-subsequent-page-numbers.attr"/> + </optional> + </define> + <!-- + =============================================================== + Properties of table formatting objects. + =============================================================== + =============================================================== + Table & Caption. + =============================================================== + --> + <define name="table-and-caption.attlist"> + <ref name="common-block-properties"/> + <optional> + <ref name="clear.attr"/> + </optional> + <ref name="relative-position-properties"/> + <ref name="keeps-and-breaks-properties-atomic"/> + </define> + <!-- + MEMO: Spec do not allows margins on fo:table-caption that is against common sence + since this is a typical container. + We do allow margins (they are included in common-block-properties). + 'Folint' does the same. + --> + <define name="table-caption.attlist"> + <optional> + <ref name="clear.attr"/> + </optional> + <ref name="common-block-properties"/> + <ref name="relative-position-properties"/> + <ref name="box-size-properties"/> + </define> + <define name="table.attlist"> + <optional> + <ref name="clear.attr"/> + </optional> + <ref name="common-block-properties"/> + <ref name="box-size-properties"/> + <ref name="keeps-and-breaks-properties-atomic"/> + <ref name="table-properties-unheritable"/> + </define> + <!-- + =============================================================== + Table column specifies common properties to ascribe to all + cells in a column *or a group of columns*. Note that, if both + 'number-columns-repeated' and 'number-columns-spanned' exceed + 1, the column counter is increased by 'number-columns-spanned'. + it means that you only set properties for columns: + 'column-number' + 'column-number' + 'number-columns-spanned' + 'column-number' + 2 * 'number-columns-spanned' + and so on, leaving default properties for intermediate columns. + =============================================================== + --> + <define name="table-column.attlist"> + <optional> + <ref name="column-number.attr"/> + </optional> + <optional> + <ref name="column-width.attr"/> + </optional> + <optional> + <ref name="number-columns-repeated.attr"/> + </optional> + <optional> + <ref name="number-columns-spanned.attr"/> + </optional> + <ref name="background-properties"/> + <!-- + MEMO: Border properties applies to this formatting object only if the value of border-collapse + for the table is "collapse" or "collapse-with-precedence" + --> + <ref name="border-properties"/> + <ref name="border-precedence-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Table header, table footer, and table body. + =============================================================== + --> + <define name="row-group.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="background-properties"/> + <!-- + MEMO: Border properties applies to this formatting object only if the value of border-collapse + for the table is "collapse" or "collapse-with-precedence" + --> + <ref name="border-properties"/> + <ref name="border-precedence-properties"/> + <ref name="relative-position-properties"/> + <ref name="inheritable-properties"/> + </define> + <define name="table-header.attlist"> + <ref name="row-group.attlist"/> + </define> + <define name="table-footer.attlist"> + <ref name="row-group.attlist"/> + </define> + <!-- + MEMO: Spec do not list "Keep" properties almong applicable to fo:table-body that is a clear + case of errata. + --> + <define name="table-body.attlist"> + <ref name="row-group.attlist"/> + <ref name="keeps-and-breaks-properties-atomic"/> + </define> + <!-- + =============================================================== + Table row. + =============================================================== + MEMO: Should we create separate collection of properties in 'properties_groups.rnc' + based on row-group.attlist? + --> + <define name="table-row.attlist"> + <ref name="row-group.attlist"/> + <ref name="height-properties"/> + <ref name="keeps-and-breaks-properties-atomic"/> + </define> + <!-- + =============================================================== + Table cell. + =============================================================== + MEMO: Spec do not allows margins on fo:table-cell but 'Folint' does. + We excluded margins from this element and therefor don't use 'common-block-properties' + MEMO: Spec do not list "Keep" properties almong applicable to fo:table-cell that is a clear + case of errata. + --> + <define name="table-cell.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <optional> + <ref name="column-number.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="border-padding-background-properties"/> + <ref name="border-precedence-properties"/> + <ref name="box-size-properties"/> + <optional> + <ref name="ends-row.attr"/> + </optional> + <ref name="keeps-and-breaks-properties-atomic"/> + <optional> + <ref name="number-columns-spanned.attr"/> + </optional> + <optional> + <ref name="number-rows-spanned.attr"/> + </optional> + <optional> + <ref name="starts-row.attr"/> + </optional> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Properties of list formatting objects. + =============================================================== + =============================================================== + List block. + =============================================================== + --> + <define name="list-block.attlist"> + <optional> + <ref name="clear.attr"/> + </optional> + <ref name="common-block-properties"/> + <ref name="keeps-and-breaks-properties-atomic"/> + <ref name="relative-position-properties"/> + </define> + <!-- + =============================================================== + List item. + =============================================================== + --> + <define name="list-item.attlist"> + <ref name="common-block-properties"/> + <ref name="keeps-and-breaks-properties-atomic"/> + <ref name="relative-position-properties"/> + </define> + <!-- + =============================================================== + List item label and list item body + =============================================================== + --> + <define name="list-item-label.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <define name="list-item-body.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Floats and footnotes. + =============================================================== + MEMO: Outlines can't have id and therefor can't have rx:key properties so we are strict here. + 'Folint' is loose here - it allows use of these properties. + MEMO: We are forced to create two types of floats: side-floats and before-floats. + --> + <define name="side-float.attlist"> + <optional> + <ref name="side-float.attr"/> + </optional> + <optional> + <ref name="clear.attr"/> + </optional> + <ref name="inheritable-properties"/> + </define> + <!-- NOTE: before-float can't bear 'clear' property --> + <define name="before-float.attlist"> + <optional> + <ref name="before-float.attr"/> + </optional> + <ref name="inheritable-properties"/> + </define> + <define name="footnote.attlist"> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <define name="footnote-body.attlist"> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Simple link. + =============================================================== + --> + <define name="basic-link.attlist"> + <ref name="inline-properties"/> + <optional> + <ref name="external-destination.attr"/> + </optional> + <optional> + <ref name="internal-destination.attr"/> + </optional> + <optional> + <ref name="indicate-destination.attr"/> + </optional> + <optional> + <ref name="show-destination.attr"/> + </optional> + <optional> + <ref name="destination-placement-offset.attr"/> + </optional> + <optional> + <ref name="target-processing-context.attr"/> + </optional> + <optional> + <ref name="target-presentation-context.attr"/> + </optional> + <optional> + <ref name="target-stylesheet.attr"/> + </optional> + </define> + <!-- + =============================================================== + Wrappers. + =============================================================== + --> + <define name="wrapper.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Marker. This element may embrace any content but cannot pass + properties to its children; so, it may not have features other + than marker-class-name. + =============================================================== + MEMO: We are more strict here making marker-class-name attribute a mandatory, + but marker with no marker-class-name is meaningless. + --> + <define name="marker.attlist"> + <ref name="marker-class-name.attr"/> + </define> + <!-- + =============================================================== + Marker retrieval. + =============================================================== + FIXME! We are more strict here making retrieve-class-name attribute a mandatory, + but marker with no retrieve-class-name is meaningless. + --> + <define name="retrieve-marker.attlist"> + <ref name="retrieve-class-name.attr"/> + <optional> + <ref name="retrieve-position.attr"/> + </optional> + <optional> + <ref name="retrieve-boundary.attr"/> + </optional> + <!-- + MEMO: Is it OK to allow inheritable properties here? There are no explicit arguments + against it in the spec. + --> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Multistate stuff. + =============================================================== + =============================================================== + Switch. + =============================================================== + MEMO: Should we have Aural Properties here as well? + --> + <define name="multi-switch.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <optional> + <ref name="auto-restore.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Single case. + =============================================================== + --> + <define name="multi-case.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <optional> + <ref name="starting-state.attr"/> + </optional> + <optional> + <ref name="case-name.attr"/> + </optional> + <optional> + <ref name="case-title.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Toggle. + =============================================================== + MEMO: Should we have here inline-level properties only? + --> + <define name="multi-toggle.attlist"> + <optional> + <ref name="switch-to.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Multi-properties. + =============================================================== + Should we allow here any possible properties applicable to the objects inside of the flow? + --> + <define name="multi-properties.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Multi property set. + =============================================================== + Should we allow here any possible properties applicable to the objects inside of the flow? + --> + <define name="multi-property-set.attlist"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="active-state.attr"/> + <ref name="inheritable-properties"/> + </define> + <!-- + =============================================================== + Properties grouping. Groups used by different elements classes + =============================================================== + --> + <!-- + =============================================================== + Entity definitions for common groups of properties + This grouping reflects properties co occurrence, rather than + property semantics. It does not correspond to grouping in the + spec. + =============================================================== + --> + <!-- Accessibility Properties --> + <define name="accessibility-properties"> + <optional> + <ref name="source-document.attr"/> + </optional> + <optional> + <ref name="role.attr"/> + </optional> + </define> + <!-- + MEMO: XSLFO is selfcontradictory: + Those properties allowed on all inline elements excep to for fo:character, fo:bidi-override and fo:inline-conteiner + At the same time spec says about those properties: + XSL> It is used by all formatting objects that can be contained in fo:flow or fo:static-content (all formatting + XSL> objects that can be directly created from an XML source element). + Thus they must be present on fo:character, fo:bidi-override, fo:inline-conteiner as well + (there are more elements missing these properties) + Note also, that comment in the round brackets seems to be meaningless. + --> + <!-- + Relative Position Properties + 'position' shorthand property also makes part of this group + --> + <define name="relative-position-properties"> + <optional> + <ref name="relative-position.attr"/> + </optional> + <optional> + <ref name="relative-position-shorthand.attr"/> + </optional> + </define> + <!-- Absolute Position Properties --> + <define name="absolute-position-properties"> + <ref name="absolute-position.attr"/> + <optional> + <ref name="absolute-position-shorthand.attr"/> + </optional> + <optional> + <ref name="top.attr"/> + </optional> + <optional> + <ref name="right.attr"/> + </optional> + <optional> + <ref name="bottom.attr"/> + </optional> + <optional> + <ref name="left.attr"/> + </optional> + </define> + <!-- + Aural Properties + 'cue' and 'pause' shorthand properties are also included + MEMO: XSLFO is selfcontradictory here in the same way + it is for Accessibility Properties - Aural properties allowed everywhere + but yet not specified on some elements, e.g. fo:block-container or fo:inline-container. + We believe this is an omission and therefor those properties are available everywhere. + --> + <define name="aural-properties-inheritable"> + <optional> + <ref name="azimuth.attr"/> + </optional> + <optional> + <ref name="elevation.attr"/> + </optional> + <optional> + <ref name="pitch.attr"/> + </optional> + <optional> + <ref name="pitch-range.attr"/> + </optional> + <optional> + <ref name="play-during.attr"/> + </optional> + <optional> + <ref name="richness.attr"/> + </optional> + <optional> + <ref name="speak.attr"/> + </optional> + <optional> + <ref name="speak-header.attr"/> + </optional> + <optional> + <ref name="speak-numeral.attr"/> + </optional> + <optional> + <ref name="speak-punctuation.attr"/> + </optional> + <optional> + <ref name="speech-rate.attr"/> + </optional> + <optional> + <ref name="stress.attr"/> + </optional> + <optional> + <ref name="voice-family.attr"/> + </optional> + <optional> + <ref name="volume.attr"/> + </optional> + </define> + <define name="aural-properties-unheritable"> + <optional> + <ref name="cue.attr"/> + </optional> + <optional> + <ref name="cue-after.attr"/> + </optional> + <optional> + <ref name="cue-before.attr"/> + </optional> + <optional> + <ref name="pause.attr"/> + </optional> + <optional> + <ref name="pause-after.attr"/> + </optional> + <optional> + <ref name="pause-before.attr"/> + </optional> + </define> + <define name="aural-properties"> + <ref name="aural-properties-inheritable"/> + <ref name="aural-properties-unheritable"/> + </define> + <!-- + Common Border, Padding, and Background Properties + Related shorthand properties are also included + --> + <define name="border-properties"> + <optional> + <ref name="border.attr"/> + </optional> + <optional> + <ref name="border-after-color.attr"/> + </optional> + <optional> + <ref name="border-after-style.attr"/> + </optional> + <optional> + <ref name="border-after-width.attr"/> + </optional> + <optional> + <ref name="border-after-width.length.attr"/> + </optional> + <optional> + <ref name="border-after-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-before-color.attr"/> + </optional> + <optional> + <ref name="border-before-style.attr"/> + </optional> + <optional> + <ref name="border-before-width.attr"/> + </optional> + <optional> + <ref name="border-before-width.length.attr"/> + </optional> + <optional> + <ref name="border-before-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-bottom.attr"/> + </optional> + <optional> + <ref name="border-bottom-color.attr"/> + </optional> + <optional> + <ref name="border-bottom-style.attr"/> + </optional> + <optional> + <ref name="border-bottom-width.attr"/> + </optional> + <optional> + <ref name="border-bottom-width.length.attr"/> + </optional> + <optional> + <ref name="border-bottom-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-color.attr"/> + </optional> + <optional> + <ref name="border-end-color.attr"/> + </optional> + <optional> + <ref name="border-end-style.attr"/> + </optional> + <optional> + <ref name="border-end-width.attr"/> + </optional> + <optional> + <ref name="border-end-width.length.attr"/> + </optional> + <optional> + <ref name="border-end-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-left.attr"/> + </optional> + <optional> + <ref name="border-left-color.attr"/> + </optional> + <optional> + <ref name="border-left-style.attr"/> + </optional> + <optional> + <ref name="border-left-width.attr"/> + </optional> + <optional> + <ref name="border-left-width.length.attr"/> + </optional> + <optional> + <ref name="border-left-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-right.attr"/> + </optional> + <optional> + <ref name="border-right-color.attr"/> + </optional> + <optional> + <ref name="border-right-style.attr"/> + </optional> + <optional> + <ref name="border-right-width.attr"/> + </optional> + <optional> + <ref name="border-right-width.length.attr"/> + </optional> + <optional> + <ref name="border-right-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-start-color.attr"/> + </optional> + <optional> + <ref name="border-start-style.attr"/> + </optional> + <optional> + <ref name="border-start-width.attr"/> + </optional> + <optional> + <ref name="border-start-width.length.attr"/> + </optional> + <optional> + <ref name="border-start-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-style.attr"/> + </optional> + <optional> + <ref name="border-top.attr"/> + </optional> + <optional> + <ref name="border-top-color.attr"/> + </optional> + <optional> + <ref name="border-top-style.attr"/> + </optional> + <optional> + <ref name="border-top-width.attr"/> + </optional> + <optional> + <ref name="border-top-width.length.attr"/> + </optional> + <optional> + <ref name="border-top-width.conditionality.attr"/> + </optional> + <optional> + <ref name="border-width.attr"/> + </optional> + </define> + <define name="padding-properties"> + <optional> + <ref name="padding.attr"/> + </optional> + <optional> + <ref name="padding-after.attr"/> + </optional> + <optional> + <ref name="padding-after.length.attr"/> + </optional> + <optional> + <ref name="padding-after.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-before.attr"/> + </optional> + <optional> + <ref name="padding-before.length.attr"/> + </optional> + <optional> + <ref name="padding-before.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-bottom.attr"/> + </optional> + <optional> + <ref name="padding-bottom.length.attr"/> + </optional> + <optional> + <ref name="padding-bottom.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-end.attr"/> + </optional> + <optional> + <ref name="padding-end.length.attr"/> + </optional> + <optional> + <ref name="padding-end.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-left.attr"/> + </optional> + <optional> + <ref name="padding-left.length.attr"/> + </optional> + <optional> + <ref name="padding-left.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-right.attr"/> + </optional> + <optional> + <ref name="padding-right.length.attr"/> + </optional> + <optional> + <ref name="padding-right.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-start.attr"/> + </optional> + <optional> + <ref name="padding-start.length.attr"/> + </optional> + <optional> + <ref name="padding-start.conditionality.attr"/> + </optional> + <optional> + <ref name="padding-top.attr"/> + </optional> + <optional> + <ref name="padding-top.length.attr"/> + </optional> + <optional> + <ref name="padding-top.conditionality.attr"/> + </optional> + </define> + <define name="background-properties"> + <optional> + <ref name="background.attr"/> + </optional> + <optional> + <ref name="background-attachment.attr"/> + </optional> + <optional> + <ref name="background-color.attr"/> + </optional> + <optional> + <ref name="background-image.attr"/> + </optional> + <optional> + <ref name="background-position.attr"/> + </optional> + <optional> + <ref name="background-position-vertical.attr"/> + </optional> + <optional> + <ref name="background-position-horizontal.attr"/> + </optional> + <optional> + <ref name="background-repeat.attr"/> + </optional> + <optional> + <ref name="rx-background-content-type.attr"/> + </optional> + <optional> + <ref name="rx-background-content-height.attr"/> + </optional> + <optional> + <ref name="rx-background-content-width.attr"/> + </optional> + <optional> + <ref name="rx-background-scaling.attr"/> + </optional> + </define> + <define name="border-padding-background-properties"> + <ref name="border-properties"/> + <ref name="padding-properties"/> + <ref name="background-properties"/> + </define> + <!-- Border Precedence Properties for tables --> + <define name="border-precedence-properties"> + <optional> + <ref name="border-after-precedence.attr"/> + </optional> + <optional> + <ref name="border-before-precedence.attr"/> + </optional> + <optional> + <ref name="border-end-precedence.attr"/> + </optional> + <optional> + <ref name="border-start-precedence.attr"/> + </optional> + </define> + <!-- Box Size Properties --> + <define name="height-properties"> + <optional> + <ref name="height.attr"/> + </optional> + <optional> + <ref name="min-height.attr"/> + </optional> + <optional> + <ref name="max-height.attr"/> + </optional> + <optional> + <ref name="block-progression-dimension.attr"/> + </optional> + <optional> + <ref name="block-progression-dimension.minimum.attr"/> + </optional> + <optional> + <ref name="block-progression-dimension.optimum.attr"/> + </optional> + <optional> + <ref name="block-progression-dimension.maximum.attr"/> + </optional> + </define> + <define name="width-properties"> + <optional> + <ref name="width.attr"/> + </optional> + <optional> + <ref name="min-width.attr"/> + </optional> + <optional> + <ref name="max-width.attr"/> + </optional> + <optional> + <ref name="inline-progression-dimension.attr"/> + </optional> + <optional> + <ref name="inline-progression-dimension.minimum.attr"/> + </optional> + <optional> + <ref name="inline-progression-dimension.optimum.attr"/> + </optional> + <optional> + <ref name="inline-progression-dimension.maximum.attr"/> + </optional> + </define> + <define name="box-size-properties"> + <ref name="height-properties"/> + <ref name="width-properties"/> + </define> + <!-- Common Area Properties --> + <define name="area-properties-inheritable"> + <optional> + <ref name="display-align.attr"/> + </optional> + <optional> + <ref name="reference-orientation.attr"/> + </optional> + <optional> + <ref name="writing-mode.attr"/> + </optional> + </define> + <define name="area-properties-unheritable"> + <optional> + <ref name="clip.attr"/> + </optional> + <optional> + <ref name="overflow.attr"/> + </optional> + </define> + <define name="area-properties"> + <ref name="area-properties-inheritable"/> + <ref name="area-properties-unheritable"/> + </define> + <!-- + Common Font Properties + 'font' shorthand property is also included + --> + <define name="font-properties"> + <optional> + <ref name="font.attr"/> + </optional> + <optional> + <ref name="font-selection-strategy.attr"/> + </optional> + <optional> + <ref name="font-family.attr"/> + </optional> + <optional> + <ref name="font-size.attr"/> + </optional> + <optional> + <ref name="font-size-adjust.attr"/> + </optional> + <optional> + <ref name="font-stretch.attr"/> + </optional> + <optional> + <ref name="font-style.attr"/> + </optional> + <optional> + <ref name="font-variant.attr"/> + </optional> + <optional> + <ref name="font-weight.attr"/> + </optional> + </define> + <!-- + Common Hyphenation Properties - Inline + 'xml:lang' shorthand property is also included + --> + <define name="hyphenation-properties-inline"> + <optional> + <ref name="country.attr"/> + </optional> + <optional> + <ref name="language.attr"/> + </optional> + <optional> + <ref name="script.attr"/> + </optional> + <optional> + <attribute name="xml:lang"/> + </optional> + <optional> + <ref name="hyphenate.attr"/> + </optional> + <optional> + <ref name="hyphenation-character.attr"/> + </optional> + <optional> + <ref name="hyphenation-push-character-count.attr"/> + </optional> + <optional> + <ref name="hyphenation-remain-character-count.attr"/> + </optional> + </define> + <!-- Common Hyphenation Properties - Block --> + <define name="hyphenation-properties-block"> + <optional> + <ref name="hyphenation-keep.attr"/> + </optional> + <optional> + <ref name="hyphenation-ladder-count.attr"/> + </optional> + </define> + <define name="hyphenation-properties"> + <ref name="hyphenation-properties-inline"/> + <ref name="hyphenation-properties-block"/> + </define> + <!-- + Common CSS Margin Properties + 'margin' shorthand property is also included + --> + <define name="margin-properties-CSS"> + <optional> + <ref name="margin.attr"/> + </optional> + <optional> + <ref name="margin-bottom.attr"/> + </optional> + <optional> + <ref name="margin-left.attr"/> + </optional> + <optional> + <ref name="margin-right.attr"/> + </optional> + <optional> + <ref name="margin-top.attr"/> + </optional> + </define> + <!-- Common Margin Properties - Block --> + <define name="margin-properties-inheritable"> + <optional> + <ref name="start-indent.attr"/> + </optional> + <optional> + <ref name="end-indent.attr"/> + </optional> + </define> + <define name="margin-properties-block"> + <ref name="margin-properties-CSS"/> + <optional> + <ref name="space-after.attr"/> + </optional> + <optional> + <ref name="space-after.minimum.attr"/> + </optional> + <optional> + <ref name="space-after.optimum.attr"/> + </optional> + <optional> + <ref name="space-after.maximum.attr"/> + </optional> + <optional> + <ref name="space-after.precedence.attr"/> + </optional> + <optional> + <ref name="space-after.conditionality.attr"/> + </optional> + <optional> + <ref name="space-before.attr"/> + </optional> + <optional> + <ref name="space-before.minimum.attr"/> + </optional> + <optional> + <ref name="space-before.optimum.attr"/> + </optional> + <optional> + <ref name="space-before.maximum.attr"/> + </optional> + <optional> + <ref name="space-before.precedence.attr"/> + </optional> + <optional> + <ref name="space-before.conditionality.attr"/> + </optional> + </define> + <!-- Common Margin Properties - Inline --> + <define name="margin-properties-inline"> + <ref name="margin-properties-CSS"/> + <optional> + <ref name="space-start.attr"/> + </optional> + <optional> + <ref name="space-start.minimum.attr"/> + </optional> + <optional> + <ref name="space-start.optimum.attr"/> + </optional> + <optional> + <ref name="space-start.maximum.attr"/> + </optional> + <optional> + <ref name="space-start.precedence.attr"/> + </optional> + <optional> + <ref name="space-start.conditionality.attr"/> + </optional> + <optional> + <ref name="space-end.attr"/> + </optional> + <optional> + <ref name="space-end.minimum.attr"/> + </optional> + <optional> + <ref name="space-end.optimum.attr"/> + </optional> + <optional> + <ref name="space-end.maximum.attr"/> + </optional> + <optional> + <ref name="space-end.precedence.attr"/> + </optional> + <optional> + <ref name="space-end.conditionality.attr"/> + </optional> + </define> + <!-- + Area Alignment Properties + 'vertical-align' shorthand is added + 'relative-align' - excluded + --> + <define name="area-alignment-properties"> + <optional> + <ref name="alignment-adjust.attr"/> + </optional> + <optional> + <ref name="alignment-baseline.attr"/> + </optional> + <optional> + <ref name="baseline-shift.attr"/> + </optional> + <optional> + <ref name="dominant-baseline.attr"/> + </optional> + <optional> + <ref name="vertical-align.attr"/> + </optional> + </define> + <!-- Line Height Properties --> + <define name="line-height-properties"> + <optional> + <ref name="line-height.attr"/> + </optional> + <optional> + <ref name="line-height.minimum.attr"/> + </optional> + <optional> + <ref name="line-height.optimum.attr"/> + </optional> + <optional> + <ref name="line-height.maximum.attr"/> + </optional> + <optional> + <ref name="line-height.precedence.attr"/> + </optional> + <optional> + <ref name="line-height.conditionality.attr"/> + </optional> + <optional> + <ref name="line-height-shift-adjustment.attr"/> + </optional> + </define> + <!-- Line Related Properties --> + <define name="line-related-properties"> + <optional> + <ref name="text-align.attr"/> + </optional> + <optional> + <ref name="text-align-last.attr"/> + </optional> + <optional> + <ref name="text-indent.attr"/> + </optional> + <optional> + <ref name="last-line-end-indent.attr"/> + </optional> + <optional> + <ref name="line-stacking-strategy.attr"/> + </optional> + <optional> + <ref name="linefeed-treatment.attr"/> + </optional> + <optional> + <ref name="white-space.attr"/> + </optional> + <optional> + <ref name="white-space-treatment.attr"/> + </optional> + <optional> + <ref name="white-space-collapse.attr"/> + </optional> + <optional> + <ref name="wrap-option.attr"/> + </optional> + <optional> + <ref name="direction.attr"/> + </optional> + </define> + <!-- Character Properties --> + <define name="character-properties-inheritable"> + <optional> + <ref name="letter-spacing.attr"/> + </optional> + <optional> + <ref name="letter-spacing.minimum.attr"/> + </optional> + <optional> + <ref name="letter-spacing.optimum.attr"/> + </optional> + <optional> + <ref name="letter-spacing.maximum.attr"/> + </optional> + <optional> + <ref name="letter-spacing.precedence.attr"/> + </optional> + <optional> + <ref name="letter-spacing.conditionality.attr"/> + </optional> + <optional> + <ref name="word-spacing.attr"/> + </optional> + <optional> + <ref name="word-spacing.minimum.attr"/> + </optional> + <optional> + <ref name="word-spacing.optimum.attr"/> + </optional> + <optional> + <ref name="word-spacing.maximum.attr"/> + </optional> + <optional> + <ref name="word-spacing.precedence.attr"/> + </optional> + <optional> + <ref name="word-spacing.conditionality.attr"/> + </optional> + <optional> + <ref name="glyph-orientation-horizontal.attr"/> + </optional> + <optional> + <ref name="glyph-orientation-vertical.attr"/> + </optional> + <optional> + <ref name="score-spaces.attr"/> + </optional> + <optional> + <ref name="text-transform.attr"/> + </optional> + </define> + <define name="character-properties-unheritable"> + <optional> + <!-- + MEMO: There is a problem with these two properties in XSL FO spec. + They are assumed to be allowed everywhere but somehow on of them + missing on fo:inline, another on fo:leader and both absent on fo:bidi-override. + They are not present on fo:block also. + We suppose that those omissions are erratic. and allow them on all elements that can cotain text. + It makes sence to allow text-decoration on the graphical inlines also. + --> + <ref name="text-decoration.attr"/> + </optional> + <optional> + <ref name="text-shadow.attr"/> + </optional> + </define> + <!-- + NOTE: Those properties apllies to char elements but they are already included into 'inheritable-properties' set + font-properties, + line-height-properties + --> + <define name="character-properties"> + <ref name="character-properties-inheritable"/> + <ref name="character-properties-unheritable"/> + </define> + <!-- + Common Keeps and Breaks Properties - Atomic objects + Keeps only + --> + <define name="keeps-properties-atomic"> + <optional> + <ref name="keep-with-next.attr"/> + </optional> + <optional> + <ref name="keep-with-next.within-line.attr"/> + </optional> + <optional> + <ref name="keep-with-next.within-column.attr"/> + </optional> + <optional> + <ref name="keep-with-next.within-page.attr"/> + </optional> + <optional> + <ref name="keep-with-previous.attr"/> + </optional> + <optional> + <ref name="keep-with-previous.within-line.attr"/> + </optional> + <optional> + <ref name="keep-with-previous.within-column.attr"/> + </optional> + <optional> + <ref name="keep-with-previous.within-page.attr"/> + </optional> + </define> + <!-- + Common Keeps and Breaks Properties - Atomic objects + Keeps and Breaks + 'page-break-*' shorthand properties are also included + --> + <define name="keeps-and-breaks-properties-atomic"> + <ref name="keeps-properties-atomic"/> + <optional> + <ref name="break-after.attr"/> + </optional> + <optional> + <ref name="break-before.attr"/> + </optional> + <optional> + <ref name="page-break-after.attr"/> + </optional> + <optional> + <ref name="page-break-before.attr"/> + </optional> + </define> + <!-- + Common Keeps and Breaks Properties - Inline + 'page-break-inside' shorthand property is also included + --> + <define name="keeps-and-breaks-properties-inline-inheritable"> + <optional> + <ref name="keep-together.attr"/> + </optional> + <optional> + <ref name="keep-together.within-line.attr"/> + </optional> + <optional> + <ref name="keep-together.within-column.attr"/> + </optional> + <optional> + <ref name="keep-together.within-page.attr"/> + </optional> + <optional> + <ref name="page-break-inside.attr"/> + </optional> + </define> + <!-- MEMO: Do we really need separate block and inline groups here --> + <!-- Common Keeps and Breaks Properties - Block --> + <define name="keeps-and-breaks-properties-block-inheritable"> + <optional> + <ref name="orphans.attr"/> + </optional> + <optional> + <ref name="widows.attr"/> + </optional> + </define> + <!-- Leader and Rule Properties --> + <define name="leader-properties"> + <optional> + <ref name="leader-alignment.attr"/> + </optional> + <optional> + <ref name="leader-pattern.attr"/> + </optional> + <optional> + <ref name="leader-pattern-width.attr"/> + </optional> + <optional> + <ref name="leader-length.attr"/> + </optional> + <optional> + <ref name="leader-length.minimum.attr"/> + </optional> + <optional> + <ref name="leader-length.optimum.attr"/> + </optional> + <optional> + <ref name="leader-length.maximum.attr"/> + </optional> + <optional> + <ref name="rule-style.attr"/> + </optional> + <optional> + <ref name="rule-thickness.attr"/> + </optional> + </define> + <!-- + Table Properties + 'border-spacing' shorthand property is also included + 'inherit' property added to table-omit-...er-at-break + --> + <define name="table-properties-inheritable"> + <optional> + <ref name="border-collapse.attr"/> + </optional> + <optional> + <ref name="border-spacing.attr"/> + </optional> + <optional> + <ref name="border-separation.attr"/> + </optional> + <optional> + <ref name="border-separation.inline-progression-direction.attr"/> + </optional> + <optional> + <ref name="border-separation.block-progression-direction.attr"/> + </optional> + <optional> + <ref name="caption-side.attr"/> + </optional> + <optional> + <ref name="empty-cells.attr"/> + </optional> + </define> + <define name="table-properties-unheritable"> + <optional> + <ref name="table-layout.attr"/> + </optional> + <optional> + <ref name="table-omit-header-at-break.attr"/> + </optional> + <optional> + <ref name="table-omit-footer-at-break.attr"/> + </optional> + <optional> + <ref name="rx-table-omit-initial-header.attr"/> + </optional> + </define> + <define name="table-properties"> + <ref name="table-properties-inheritable"/> + <ref name="table-properties-unheritable"/> + </define> + <!-- List Properties --> + <define name="list-properties"> + <optional> + <ref name="provisional-distance-between-starts.attr"/> + </optional> + <optional> + <ref name="provisional-label-separation.attr"/> + </optional> + </define> + <!-- + Visibility Properties + NOTE: 'visibility' is inheritable, but 'z-index' is not. + --> + <define name="visibility-properties"> + <optional> + <ref name="visibility.attr"/> + </optional> + <optional> + <ref name="z-index.attr"/> + </optional> + </define> + <!-- + =============================================================== + Set of 'explicitly' inheritable properties. This includes attributes + marked as inheritable in the spec only! + We define two sets of inheritable properties: + 1. Basic properties applicable to inline-level elements with character-only content + 2. Full set of inheritable properties + =============================================================== + --> + <define name="inheritable-properties-inline"> + <ref name="aural-properties-inheritable"/> + <optional> + <ref name="color.attr"/> + </optional> + <ref name="character-properties-inheritable"/> + <ref name="font-properties"/> + <ref name="hyphenation-properties-inline"/> + <ref name="line-height-properties"/> + <optional> + <ref name="visibility.attr"/> + </optional> + </define> + <define name="inheritable-properties-block"> + <ref name="table-properties-inheritable"/> + <ref name="area-properties-inheritable"/> + <ref name="hyphenation-properties-block"/> + <ref name="margin-properties-inheritable"/> + <optional> + <ref name="intrusion-displace.attr"/> + </optional> + <!-- 'intrusion-displace' applies to: fo:block, fo:block-container, fo:table-and-caption, fo:table, fo:table-caption, fo:list-block, fo:list-item. --> + <ref name="keeps-and-breaks-properties-inline-inheritable"/> + <ref name="keeps-and-breaks-properties-block-inheritable"/> + <ref name="leader-properties"/> + <!-- MEMO: Should we move this one to inheritable-properties-inline? --> + <ref name="line-related-properties"/> + <ref name="list-properties"/> + <optional> + <ref name="relative-align.attr"/> + </optional> + </define> + <!-- NOTE: Property 'relative-align' applies to fo:list-item and fo:table-cell only. --> + <define name="inheritable-properties"> + <ref name="inheritable-properties-inline"/> + <ref name="inheritable-properties-block"/> + </define> + <!-- + =============================================================== + Common property subsets. + =============================================================== + Common block properties (those properties applies to any type of block-container as well + --> + <define name="common-block-properties"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="border-padding-background-properties"/> + <ref name="margin-properties-block"/> + <ref name="inheritable-properties"/> + </define> + <!-- Properties for fo:block and fo:block-container --> + <define name="block-properties"> + <ref name="common-block-properties"/> + <optional> + <ref name="clear.attr"/> + </optional> + <optional> + <ref name="span.attr"/> + </optional> + <ref name="keeps-and-breaks-properties-atomic"/> + <ref name="relative-position-properties"/> + </define> + <!-- + Common inline properties + MEMO: Spec says that text-altitude/text-depth applicable only to + fo:block, fo:character, fo:leader, fo:page-number, fo:page-number-citation + We believe this is an omission and they must be allowed on all elements + that can have text children. + --> + <define name="common-inline-properties"> + <optional> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties-unheritable"/> + <ref name="area-alignment-properties"/> + <ref name="border-padding-background-properties"/> + <ref name="character-properties-unheritable"/> + <ref name="keeps-properties-atomic"/> + <ref name="margin-properties-inline"/> + <ref name="relative-position-properties"/> + <optional> + <ref name="text-altitude.attr"/> + </optional> + <optional> + <ref name="text-depth.attr"/> + </optional> + <ref name="inheritable-properties-inline"/> + </define> + <!-- Properties for nonempty inline elements --> + <define name="inline-properties"> + <ref name="common-inline-properties"/> + <ref name="inheritable-properties-block"/> + </define> + <!-- + Properties for graphical inline elements + NOTE: src attribute exclueded since it's not applicable to fo:instream-foreign-object + --> + <define name="graphic-properties"> + <optional> + <!-- + MEMO: We can replace part of the definition here with 'common-inline-properties' set + - it will be formaly rightfil since the only difference made by text-shadow, text-altitude, + text-depth and inheritable-properties-inline and both of them are allowed here. + At the same time those properties do not make any sense being specified on those + elements since they will be never applied. + --> + <ref name="id.attr"/> + </optional> + <optional> + <ref name="rx-key.attr"/> + </optional> + <ref name="accessibility-properties"/> + <ref name="aural-properties"/> + <ref name="area-properties-unheritable"/> + <ref name="border-padding-background-properties"/> + <ref name="margin-properties-inline"/> + <ref name="relative-position-properties"/> + <ref name="area-alignment-properties"/> + <ref name="box-size-properties"/> + <ref name="keeps-properties-atomic"/> + <ref name="line-height-properties"/> + <optional> + <ref name="display-align.attr"/> + </optional> + <optional> + <ref name="content-type.attr"/> + </optional> + <optional> + <ref name="content-height.attr"/> + </optional> + <optional> + <ref name="content-width.attr"/> + </optional> + <optional> + <ref name="scaling.attr"/> + </optional> + <optional> + <ref name="scaling-method.attr"/> + </optional> + <optional> + <ref name="text-align.attr"/> + </optional> + <optional> + <ref name="text-decoration.attr"/> + </optional> + </define> + + + <!-- + =============================================================== + Common properties content models used by several attributes + =============================================================== + --> + <define name="border-style.attr-content"> + <choice> + <value>none</value> + <value>hidden</value> + <value>dotted</value> + <value>dashed</value> + <value>solid</value> + <value>double</value> + <value>groove</value> + <value>ridge</value> + <value>inset</value> + <value>outset</value> + <value>inherit</value> + </choice> + </define> + <define name="orientation.attr-content"> + <choice> + <value>0</value> + <value>90</value> + <value>180</value> + <value>270</value> + <value>-90</value> + <value>-180</value> + <value>-270</value> + <value>0deg</value> + <value>90deg</value> + <value>180deg</value> + <value>270deg</value> + <value>-90deg</value> + <value>-180deg</value> + <value>-270deg</value> + <value>inherit</value> + </choice> + </define> + <define name="keep.attr-content"> + <choice> + <value>auto</value> + <value>always</value> + <ref name="integer.datatype"/> + </choice> + </define> + <!-- + =============================================================== + Definitions of all the attributes (properties) used in XSL FO + includeing those from RX extensions + (definitions of attributes bearing 'rx' namespace named as rx-..., + but sorted according to the actual attribute name) + =============================================================== + --> + <define name="absolute-position.attr"> + <attribute name="absolute-position"> + <choice> + <value>absolute</value> + <value>fixed</value> + </choice> + </attribute> + </define> + <!-- MEMO: We forced to separate this property from actual 'absolute-position' --> + <define name="container-position.attr"> + <attribute name="absolute-position"> + <choice> + <value>auto</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="active-state.attr"> + <attribute name="active-state"> + <choice> + <value>link</value> + <value>visited</value> + <value>active</value> + <value>hover</value> + <value>focus</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="alignment-adjust.attr"> + <attribute name="alignment-adjust"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="alignment-baseline.attr"> + <attribute name="alignment-baseline"> + <choice> + <value>auto</value> + <value>baseline</value> + <value>before-edge</value> + <value>text-before-edge</value> + <value>middle</value> + <value>central</value> + <value>after-edge</value> + <value>text-after-edge</value> + <value>top</value> + <value>text-top</value> + <value>bottom</value> + <value>text-bottom</value> + <value>ideographic</value> + <value>alphabetic</value> + <value>hanging</value> + <value>mathematical</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="auto-restore.attr"> + <attribute name="auto-restore"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="azimuth.attr"> + <attribute name="azimuth"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background.attr"> + <attribute name="background"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-attachment.attr"> + <attribute name="background-attachment"> + <choice> + <value>scroll</value> + <value>fixed</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-color.attr"> + <attribute name="background-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-image.attr"> + <attribute name="background-image"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-position.attr"> + <attribute name="background-position"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-position-horizontal.attr"> + <attribute name="background-position-horizontal"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-position-vertical.attr"> + <attribute name="background-position-vertical"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="background-repeat.attr"> + <attribute name="background-repeat"> + <choice> + <value>repeat</value> + <value>repeat-x</value> + <value>repeat-y</value> + <value>no-repeat</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <!-- RenderX extension attributes --> + <define name="rx-background-content-type.attr"> + <attribute name="rx:background-content-type"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rx-background-content-height.attr"> + <attribute name="rx:background-content-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rx-background-content-width.attr"> + <attribute name="rx:background-content-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rx-background-scaling.attr"> + <attribute name="rx:background-scaling"> + <choice> + <value>uniform</value> + <value>non-uniform</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="baseline-shift.attr"> + <attribute name="baseline-shift"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="blank-or-not-blank.attr"> + <attribute name="blank-or-not-blank"> + <choice> + <value>blank</value> + <value>not-blank</value> + <value>any</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="block-progression-dimension.attr"> + <attribute name="block-progression-dimension"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="block-progression-dimension.maximum.attr"> + <attribute name="block-progression-dimension.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="block-progression-dimension.minimum.attr"> + <attribute name="block-progression-dimension.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="block-progression-dimension.optimum.attr"> + <attribute name="block-progression-dimension.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border.attr"> + <attribute name="border"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-color.attr"> + <attribute name="border-after-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-precedence.attr"> + <attribute name="border-after-precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-style.attr"> + <attribute name="border-after-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-width.attr"> + <attribute name="border-after-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-width.conditionality.attr"> + <attribute name="border-after-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-after-width.length.attr"> + <attribute name="border-after-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-color.attr"> + <attribute name="border-before-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-precedence.attr"> + <attribute name="border-before-precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-style.attr"> + <attribute name="border-before-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-width.attr"> + <attribute name="border-before-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-width.conditionality.attr"> + <attribute name="border-before-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-before-width.length.attr"> + <attribute name="border-before-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom.attr"> + <attribute name="border-bottom"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom-color.attr"> + <attribute name="border-bottom-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom-style.attr"> + <attribute name="border-bottom-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom-width.attr"> + <attribute name="border-bottom-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom-width.conditionality.attr"> + <attribute name="border-bottom-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-bottom-width.length.attr"> + <attribute name="border-bottom-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-collapse.attr"> + <attribute name="border-collapse"> + <choice> + <value>collapse</value> + <value>collapse-with-precedence</value> + <value>separate</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-color.attr"> + <attribute name="border-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-color.attr"> + <attribute name="border-end-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-precedence.attr"> + <attribute name="border-end-precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-style.attr"> + <attribute name="border-end-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-width.attr"> + <attribute name="border-end-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-width.conditionality.attr"> + <attribute name="border-end-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-end-width.length.attr"> + <attribute name="border-end-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left.attr"> + <attribute name="border-left"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left-color.attr"> + <attribute name="border-left-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left-style.attr"> + <attribute name="border-left-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left-width.attr"> + <attribute name="border-left-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left-width.conditionality.attr"> + <attribute name="border-left-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-left-width.length.attr"> + <attribute name="border-left-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right.attr"> + <attribute name="border-right"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right-color.attr"> + <attribute name="border-right-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right-style.attr"> + <attribute name="border-right-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right-width.attr"> + <attribute name="border-right-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right-width.conditionality.attr"> + <attribute name="border-right-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-right-width.length.attr"> + <attribute name="border-right-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-separation.attr"> + <attribute name="border-separation"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-separation.block-progression-direction.attr"> + <attribute name="border-separation.block-progression-direction"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-separation.inline-progression-direction.attr"> + <attribute name="border-separation.inline-progression-direction"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-spacing.attr"> + <attribute name="border-spacing"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-color.attr"> + <attribute name="border-start-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-precedence.attr"> + <attribute name="border-start-precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-style.attr"> + <attribute name="border-start-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-width.attr"> + <attribute name="border-start-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-width.conditionality.attr"> + <attribute name="border-start-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-start-width.length.attr"> + <attribute name="border-start-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-style.attr"> + <attribute name="border-style"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top.attr"> + <attribute name="border-top"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top-color.attr"> + <attribute name="border-top-color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top-style.attr"> + <attribute name="border-top-style"> + <choice> + <ref name="border-style.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top-width.attr"> + <attribute name="border-top-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top-width.conditionality.attr"> + <attribute name="border-top-width.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-top-width.length.attr"> + <attribute name="border-top-width.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="border-width.attr"> + <attribute name="border-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="bottom.attr"> + <attribute name="bottom"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="break-after.attr"> + <attribute name="break-after"> + <choice> + <value>auto</value> + <value>column</value> + <value>page</value> + <value>even-page</value> + <value>odd-page</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="break-before.attr"> + <attribute name="break-before"> + <choice> + <value>auto</value> + <value>column</value> + <value>page</value> + <value>even-page</value> + <value>odd-page</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="caption-side.attr"> + <attribute name="caption-side"> + <choice> + <value>before</value> + <value>after</value> + <value>start</value> + <value>end</value> + <value>top</value> + <value>bottom</value> + <value>left</value> + <value>right</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="case-name.attr"> + <attribute name="case-name"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="case-title.attr"> + <attribute name="case-title"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="character.attr"> + <attribute name="character"/> + </define> + <define name="clear.attr"> + <attribute name="clear"> + <choice> + <value>start</value> + <value>end</value> + <value>left</value> + <value>right</value> + <value>both</value> + <value>none</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="clip.attr"> + <attribute name="clip"> + <choice> + <ref name="shape.datatype"/> + <value>auto</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="collapse-subtree.attr"> + <attribute name="collapse-subtree"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="color.attr"> + <attribute name="color"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="color-profile-name.attr"> + <attribute name="color-profile-name"/> + </define> + <define name="column-count.attr"> + <attribute name="column-count"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="column-gap.attr"> + <attribute name="column-gap"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="column-number.attr"> + <attribute name="column-number"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="column-width.attr"> + <attribute name="column-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="content-height.attr"> + <attribute name="content-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="content-type.attr"> + <attribute name="content-type"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="content-width.attr"> + <attribute name="content-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="country.attr"> + <attribute name="country"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="cue.attr"> + <attribute name="cue"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="cue-after.attr"> + <attribute name="cue-after"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="cue-before.attr"> + <attribute name="cue-before"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="destination-placement-offset.attr"> + <attribute name="destination-placement-offset"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="direction.attr"> + <attribute name="direction"> + <choice> + <value>ltr</value> + <value>rtl</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="display-align.attr"> + <attribute name="display-align"> + <choice> + <value>auto</value> + <value>before</value> + <value>center</value> + <value>after</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="dominant-baseline.attr"> + <attribute name="dominant-baseline"> + <choice> + <value>auto</value> + <value>use-script</value> + <value>no-change</value> + <value>reset-size</value> + <value>ideographic</value> + <value>alphabetic</value> + <value>hanging</value> + <value>mathematical</value> + <value>central</value> + <value>middle</value> + <value>text-after-edge</value> + <value>text-before-edge</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="elevation.attr"> + <attribute name="elevation"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="empty-cells.attr"> + <attribute name="empty-cells"> + <choice> + <value>show</value> + <value>hide</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="end-indent.attr"> + <attribute name="end-indent"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="ends-row.attr"> + <attribute name="ends-row"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="extent.attr"> + <attribute name="extent"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="external-destination.attr"> + <attribute name="external-destination"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <!-- + MEMO: We have separated this property into the two (for side and before floats) + MEMO: Float values "inside" and "outside" are RenderX extensions. + --> + <define name="before-float.attr"> + <attribute name="float"> + <value>before</value> + </attribute> + </define> + <define name="side-float.attr"> + <attribute name="float"> + <choice> + <value>start</value> + <value>end</value> + <value>left</value> + <value>right</value> + <value>none</value> + <value>inside</value> + <value>outside</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="flow-name.attr"> + <attribute name="flow-name"/> + </define> + <define name="font.attr"> + <attribute name="font"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-family.attr"> + <attribute name="font-family"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-selection-strategy.attr"> + <attribute name="font-selection-strategy"> + <choice> + <value>auto</value> + <value>character-by-character</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-size.attr"> + <attribute name="font-size"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-size-adjust.attr"> + <attribute name="font-size-adjust"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-stretch.attr"> + <attribute name="font-stretch"> + <choice> + <value>normal</value> + <value>wider</value> + <value>narrower</value> + <value>ultra-condensed</value> + <value>extra-condensed</value> + <value>condensed</value> + <value>semi-condensed</value> + <value>semi-expanded</value> + <value>expanded</value> + <value>extra-expanded</value> + <value>ultra-expanded</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-style.attr"> + <attribute name="font-style"> + <choice> + <value>normal</value> + <value>italic</value> + <value>oblique</value> + <value>backslant</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-variant.attr"> + <attribute name="font-variant"> + <choice> + <value>normal</value> + <value>small-caps</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="font-weight.attr"> + <attribute name="font-weight"> + <choice> + <value>normal</value> + <value>bold</value> + <value>bolder</value> + <value>lighter</value> + <value>inherit</value> + <value>100</value> + <value>200</value> + <value>300</value> + <value>400</value> + <value>500</value> + <value>600</value> + <value>700</value> + <value>800</value> + <value>900</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="force-page-count.attr"> + <attribute name="force-page-count"> + <choice> + <value>auto</value> + <value>even</value> + <value>odd</value> + <value>end-on-even</value> + <value>end-on-odd</value> + <value>no-force</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="format.attr"> + <attribute name="format"/> + </define> + <define name="glyph-orientation-horizontal.attr"> + <attribute name="glyph-orientation-horizontal"> + <choice> + <ref name="orientation.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="glyph-orientation-vertical.attr"> + <attribute name="glyph-orientation-vertical"> + <choice> + <ref name="orientation.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="grouping-separator.attr"> + <attribute name="grouping-separator"/> + </define> + <define name="grouping-size.attr"> + <attribute name="grouping-size"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="height.attr"> + <attribute name="height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="hyphenate.attr"> + <attribute name="hyphenate"> + <choice> + <value>false</value> + <value>true</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="hyphenation-character.attr"> + <attribute name="hyphenation-character"/> + </define> + <define name="hyphenation-keep.attr"> + <attribute name="hyphenation-keep"> + <choice> + <value>auto</value> + <value>column</value> + <value>page</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="hyphenation-ladder-count.attr"> + <attribute name="hyphenation-ladder-count"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="hyphenation-push-character-count.attr"> + <attribute name="hyphenation-push-character-count"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="hyphenation-remain-character-count.attr"> + <attribute name="hyphenation-remain-character-count"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="id.attr"> + <attribute name="id"/> + </define> + <define name="indicate-destination.attr"> + <attribute name="indicate-destination"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="initial-page-number.attr"> + <attribute name="initial-page-number"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="inline-progression-dimension.attr"> + <attribute name="inline-progression-dimension"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="inline-progression-dimension.maximum.attr"> + <attribute name="inline-progression-dimension.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="inline-progression-dimension.minimum.attr"> + <attribute name="inline-progression-dimension.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="inline-progression-dimension.optimum.attr"> + <attribute name="inline-progression-dimension.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="internal-destination.attr"> + <attribute name="internal-destination"/> + </define> + <define name="intrusion-displace.attr"> + <attribute name="intrusion-displace"> + <choice> + <value>auto</value> + <value>none</value> + <value>line</value> + <value>indent</value> + <value>block</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-together.attr"> + <attribute name="keep-together"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-together.within-column.attr"> + <attribute name="keep-together.within-column"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-together.within-line.attr"> + <attribute name="keep-together.within-line"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-together.within-page.attr"> + <attribute name="keep-together.within-page"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-next.attr"> + <attribute name="keep-with-next"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-next.within-column.attr"> + <attribute name="keep-with-next.within-column"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-next.within-line.attr"> + <attribute name="keep-with-next.within-line"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-next.within-page.attr"> + <attribute name="keep-with-next.within-page"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-previous.attr"> + <attribute name="keep-with-previous"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-previous.within-column.attr"> + <attribute name="keep-with-previous.within-column"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-previous.within-line.attr"> + <attribute name="keep-with-previous.within-line"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="keep-with-previous.within-page.attr"> + <attribute name="keep-with-previous.within-page"> + <choice> + <ref name="keep.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <!-- RenderX extension attribute --> + <define name="rx-key.attr"> + <attribute name="rx:key"/> + </define> + <define name="language.attr"> + <attribute name="language"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="last-line-end-indent.attr"> + <attribute name="last-line-end-indent"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-alignment.attr"> + <attribute name="leader-alignment"> + <choice> + <value>none</value> + <value>reference-area</value> + <value>page</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-length.attr"> + <attribute name="leader-length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-length.maximum.attr"> + <attribute name="leader-length.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-length.minimum.attr"> + <attribute name="leader-length.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-length.optimum.attr"> + <attribute name="leader-length.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-pattern.attr"> + <attribute name="leader-pattern"> + <choice> + <value>space</value> + <value>rule</value> + <value>dots</value> + <value>use-content</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="leader-pattern-width.attr"> + <attribute name="leader-pattern-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="left.attr"> + <attribute name="left"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.attr"> + <attribute name="letter-spacing"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.conditionality.attr"> + <attribute name="letter-spacing.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.maximum.attr"> + <attribute name="letter-spacing.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.minimum.attr"> + <attribute name="letter-spacing.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.optimum.attr"> + <attribute name="letter-spacing.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-spacing.precedence.attr"> + <attribute name="letter-spacing.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="letter-value.attr"> + <attribute name="letter-value"> + <choice> + <value>auto</value> + <value>alphabetic</value> + <value>traditional</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.attr"> + <attribute name="line-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height-shift-adjustment.attr"> + <attribute name="line-height-shift-adjustment"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.conditionality.attr"> + <attribute name="line-height.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.maximum.attr"> + <attribute name="line-height.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.minimum.attr"> + <attribute name="line-height.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.optimum.attr"> + <attribute name="line-height.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-height.precedence.attr"> + <attribute name="line-height.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="line-stacking-strategy.attr"> + <attribute name="line-stacking-strategy"> + <choice> + <value>line-height</value> + <value>font-height</value> + <value>max-height</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="linefeed-treatment.attr"> + <attribute name="linefeed-treatment"> + <choice> + <value>ignore</value> + <value>preserve</value> + <value>treat-as-space</value> + <value>treat-as-zero-width-space</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="link-back.attr"> + <attribute name="link-back"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="list-separator.attr"> + <attribute name="list-separator"/> + </define> + <define name="margin.attr"> + <attribute name="margin"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="margin-bottom.attr"> + <attribute name="margin-bottom"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="margin-left.attr"> + <attribute name="margin-left"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="margin-right.attr"> + <attribute name="margin-right"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="margin-top.attr"> + <attribute name="margin-top"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="marker-class-name.attr"> + <attribute name="marker-class-name"/> + </define> + <define name="master-name.attr"> + <attribute name="master-name"/> + </define> + <define name="master-reference.attr"> + <attribute name="master-reference"/> + </define> + <define name="max-height.attr"> + <attribute name="max-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="max-width.attr"> + <attribute name="max-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="maximum-repeats.attr"> + <attribute name="maximum-repeats"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="media-usage.attr"> + <attribute name="media-usage"> + <choice> + <value>auto</value> + <value>paginate</value> + <value>bounded-in-one-dimension</value> + <value>unbounded</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="merge-subsequent-page-numbers.attr"> + <attribute name="merge-subsequent-page-numbers"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="min-height.attr"> + <attribute name="min-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="min-width.attr"> + <attribute name="min-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <!-- NOTE: It's RenderX extension attribute (belongs to rx:meta-field). It enumerates values currently available in XEP --> + <define name="name.attr"> + <attribute name="name"> + <choice> + <value>author</value> + <value>title</value> + <value>subject</value> + <value>keywords</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="number-columns-repeated.attr"> + <attribute name="number-columns-repeated"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="number-columns-spanned.attr"> + <attribute name="number-columns-spanned"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="number-rows-spanned.attr"> + <attribute name="number-rows-spanned"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="odd-or-even.attr"> + <attribute name="odd-or-even"> + <choice> + <value>odd</value> + <value>even</value> + <value>any</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rx-table-omit-initial-header.attr"> + <attribute name="rx:table-omit-initial-header"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="orphans.attr"> + <attribute name="orphans"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="overflow.attr"> + <attribute name="overflow"> + <choice> + <value>visible</value> + <value>hidden</value> + <value>scroll</value> + <value>auto</value> + <value>error-if-overflow</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding.attr"> + <attribute name="padding"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-after.attr"> + <attribute name="padding-after"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-after.conditionality.attr"> + <attribute name="padding-after.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-after.length.attr"> + <attribute name="padding-after.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-before.attr"> + <attribute name="padding-before"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-before.conditionality.attr"> + <attribute name="padding-before.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-before.length.attr"> + <attribute name="padding-before.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-bottom.attr"> + <attribute name="padding-bottom"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-bottom.conditionality.attr"> + <attribute name="padding-bottom.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-bottom.length.attr"> + <attribute name="padding-bottom.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-end.attr"> + <attribute name="padding-end"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-end.conditionality.attr"> + <attribute name="padding-end.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-end.length.attr"> + <attribute name="padding-end.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-left.attr"> + <attribute name="padding-left"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-left.conditionality.attr"> + <attribute name="padding-left.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-left.length.attr"> + <attribute name="padding-left.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-right.attr"> + <attribute name="padding-right"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-right.conditionality.attr"> + <attribute name="padding-right.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-right.length.attr"> + <attribute name="padding-right.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-start.attr"> + <attribute name="padding-start"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-start.conditionality.attr"> + <attribute name="padding-start.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-start.length.attr"> + <attribute name="padding-start.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-top.attr"> + <attribute name="padding-top"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-top.conditionality.attr"> + <attribute name="padding-top.conditionality"> + <choice> + <value>discard</value> + <value>retain</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="padding-top.length.attr"> + <attribute name="padding-top.length"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-break-after.attr"> + <attribute name="page-break-after"> + <choice> + <value>auto</value> + <value>always</value> + <value>avoid</value> + <value>left</value> + <value>right</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-break-before.attr"> + <attribute name="page-break-before"> + <choice> + <value>auto</value> + <value>always</value> + <value>avoid</value> + <value>left</value> + <value>right</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-break-inside.attr"> + <attribute name="page-break-inside"> + <choice> + <value>avoid</value> + <value>auto</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-height.attr"> + <attribute name="page-height"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-position.attr"> + <attribute name="page-position"> + <choice> + <value>first</value> + <value>last</value> + <value>rest</value> + <value>any</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="page-width.attr"> + <attribute name="page-width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="pause.attr"> + <attribute name="pause"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="pause-after.attr"> + <attribute name="pause-after"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="pause-before.attr"> + <attribute name="pause-before"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="pitch.attr"> + <attribute name="pitch"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="pitch-range.attr"> + <attribute name="pitch-range"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="play-during.attr"> + <attribute name="play-during"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <!-- MEMO: We forced to devide this shorthand since we have separate absolute-container element --> + <define name="absolute-position-shorthand.attr"> + <attribute name="position"> + <choice> + <value>absolute</value> + <value>fixed</value> + </choice> + </attribute> + </define> + <define name="relative-position-shorthand.attr"> + <attribute name="position"> + <choice> + <value>static</value> + <value>relative</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="precedence.attr"> + <attribute name="precedence"> + <choice> + <value>true</value> + <value>false</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="provisional-distance-between-starts.attr"> + <attribute name="provisional-distance-between-starts"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="provisional-label-separation.attr"> + <attribute name="provisional-label-separation"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="range-separator.attr"> + <attribute name="range-separator"/> + </define> + <define name="ref-id.attr"> + <attribute name="ref-id"/> + </define> + <define name="ref-key.attr"> + <attribute name="ref-key"/> + </define> + <define name="reference-orientation.attr"> + <attribute name="reference-orientation"> + <choice> + <ref name="orientation.attr-content"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="region-name.attr"> + <attribute name="region-name"/> + </define> + <define name="relative-align.attr"> + <attribute name="relative-align"> + <choice> + <value>before</value> + <value>baseline</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="relative-position.attr"> + <attribute name="relative-position"> + <choice> + <value>auto</value> + <value>static</value> + <value>relative</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rendering-intent.attr"> + <optional> + <attribute name="rendering-intent"> + <choice> + <value>auto</value> + <value>perceptual</value> + <value>relative-colorimetric</value> + <value>saturation</value> + <value>absolute-colorimetric</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </optional> + </define> + <define name="retrieve-boundary.attr"> + <attribute name="retrieve-boundary"> + <choice> + <value>page</value> + <value>page-sequence</value> + <value>document</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="retrieve-class-name.attr"> + <attribute name="retrieve-class-name"/> + </define> + <define name="retrieve-position.attr"> + <attribute name="retrieve-position"> + <choice> + <value>first-starting-within-page</value> + <value>first-including-carryover</value> + <value>last-starting-within-page</value> + <value>last-ending-within-page</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="richness.attr"> + <attribute name="richness"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="right.attr"> + <attribute name="right"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="role.attr"> + <attribute name="role"/> + </define> + <define name="rule-style.attr"> + <attribute name="rule-style"> + <choice> + <value>none</value> + <value>dotted</value> + <value>dashed</value> + <value>solid</value> + <value>double</value> + <value>groove</value> + <value>ridge</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="rule-thickness.attr"> + <attribute name="rule-thickness"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="scaling.attr"> + <attribute name="scaling"> + <choice> + <value>uniform</value> + <value>non-uniform</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="scaling-method.attr"> + <attribute name="scaling-method"> + <choice> + <value>auto</value> + <value>integer-pixels</value> + <value>resample-any-method</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="score-spaces.attr"> + <attribute name="score-spaces"> + <choice> + <value>true</value> + <value>false</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="script.attr"> + <attribute name="script"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="show-destination.attr"> + <attribute name="show-destination"> + <choice> + <value>replace</value> + <value>new</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="size.attr"> + <attribute name="size"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="source-document.attr"> + <attribute name="source-document"/> + </define> + <define name="space-after.attr"> + <attribute name="space-after"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-after.conditionality.attr"> + <attribute name="space-after.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-after.maximum.attr"> + <attribute name="space-after.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-after.minimum.attr"> + <attribute name="space-after.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-after.optimum.attr"> + <attribute name="space-after.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-after.precedence.attr"> + <attribute name="space-after.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.attr"> + <attribute name="space-before"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.conditionality.attr"> + <attribute name="space-before.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.maximum.attr"> + <attribute name="space-before.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.minimum.attr"> + <attribute name="space-before.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.optimum.attr"> + <attribute name="space-before.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-before.precedence.attr"> + <attribute name="space-before.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.attr"> + <attribute name="space-end"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.conditionality.attr"> + <attribute name="space-end.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.maximum.attr"> + <attribute name="space-end.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.minimum.attr"> + <attribute name="space-end.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.optimum.attr"> + <attribute name="space-end.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-end.precedence.attr"> + <attribute name="space-end.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.attr"> + <attribute name="space-start"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.conditionality.attr"> + <attribute name="space-start.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.maximum.attr"> + <attribute name="space-start.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.minimum.attr"> + <attribute name="space-start.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.optimum.attr"> + <attribute name="space-start.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="space-start.precedence.attr"> + <attribute name="space-start.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="span.attr"> + <attribute name="span"> + <choice> + <value>none</value> + <value>all</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="speak.attr"> + <attribute name="speak"> + <choice> + <value>normal</value> + <value>none</value> + <value>spell-out</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="speak-header.attr"> + <attribute name="speak-header"> + <choice> + <value>once</value> + <value>always</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="speak-numeral.attr"> + <attribute name="speak-numeral"> + <choice> + <value>digits</value> + <value>continuous</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="speak-punctuation.attr"> + <attribute name="speak-punctuation"> + <choice> + <value>code</value> + <value>none</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="speech-rate.attr"> + <attribute name="speech-rate"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="src.attr"> + <attribute name="src"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="start-indent.attr"> + <attribute name="start-indent"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="starting-state.attr"> + <attribute name="starting-state"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="starts-row.attr"> + <attribute name="starts-row"> + <choice> + <value>true</value> + <value>false</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="stress.attr"> + <attribute name="stress"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="suppress-at-line-break.attr"> + <attribute name="suppress-at-line-break"> + <choice> + <value>auto</value> + <value>suppress</value> + <value>retain</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="switch-to.attr"> + <attribute name="switch-to"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="table-layout.attr"> + <attribute name="table-layout"> + <choice> + <value>auto</value> + <value>fixed</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="table-omit-footer-at-break.attr"> + <attribute name="table-omit-footer-at-break"> + <choice> + <value>true</value> + <value>false</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="table-omit-header-at-break.attr"> + <attribute name="table-omit-header-at-break"> + <choice> + <value>true</value> + <value>false</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="target-presentation-context.attr"> + <attribute name="target-presentation-context"/> + </define> + <define name="target-processing-context.attr"> + <attribute name="target-processing-context"/> + </define> + <define name="target-stylesheet.attr"> + <attribute name="target-stylesheet"/> + </define> + <!-- MEMO: <string> values are temporarily excluded from text-align and text-align-last --> + <define name="text-align.attr"> + <attribute name="text-align"> + <choice> + <value>start</value> + <value>center</value> + <value>end</value> + <value>justify</value> + <value>inside</value> + <value>outside</value> + <value>left</value> + <value>right</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-align-last.attr"> + <attribute name="text-align-last"> + <choice> + <value>relative</value> + <value>start</value> + <value>center</value> + <value>end</value> + <value>justify</value> + <value>inside</value> + <value>outside</value> + <value>left</value> + <value>right</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-altitude.attr"> + <attribute name="text-altitude"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-decoration.attr"> + <attribute name="text-decoration"> + <choice> + <data type="NMTOKENS"/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-depth.attr"> + <attribute name="text-depth"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-indent.attr"> + <attribute name="text-indent"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-shadow.attr"> + <attribute name="text-shadow"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="text-transform.attr"> + <attribute name="text-transform"> + <choice> + <value>capitalize</value> + <value>uppercase</value> + <value>lowercase</value> + <value>none</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="top.attr"> + <attribute name="top"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="treat-as-word-space.attr"> + <attribute name="treat-as-word-space"> + <choice> + <value>auto</value> + <value>true</value> + <value>false</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="unicode-bidi.attr"> + <attribute name="unicode-bidi"> + <choice> + <value>normal</value> + <value>embed</value> + <value>bidi-override</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="value.attr"> + <attribute name="value"/> + </define> + <define name="vertical-align.attr"> + <attribute name="vertical-align"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="visibility.attr"> + <attribute name="visibility"> + <choice> + <value>visible</value> + <value>hidden</value> + <value>collapse</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="voice-family.attr"> + <attribute name="voice-family"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="volume.attr"> + <attribute name="volume"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="white-space.attr"> + <attribute name="white-space"> + <choice> + <value>normal</value> + <value>pre</value> + <value>nowrap</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="white-space-collapse.attr"> + <attribute name="white-space-collapse"> + <choice> + <value>false</value> + <value>true</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="white-space-treatment.attr"> + <attribute name="white-space-treatment"> + <choice> + <value>ignore</value> + <value>preserve</value> + <value>ignore-if-before-linefeed</value> + <value>ignore-if-after-linefeed</value> + <value>ignore-if-surrounding-linefeed</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="widows.attr"> + <attribute name="widows"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="width.attr"> + <attribute name="width"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.attr"> + <attribute name="word-spacing"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.conditionality.attr"> + <attribute name="word-spacing.conditionality"> + <choice> + <value>retain</value> + <value>discard</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.maximum.attr"> + <attribute name="word-spacing.maximum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.minimum.attr"> + <attribute name="word-spacing.minimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.optimum.attr"> + <attribute name="word-spacing.optimum"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="word-spacing.precedence.attr"> + <attribute name="word-spacing.precedence"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="wrap-option.attr"> + <attribute name="wrap-option"> + <choice> + <value>no-wrap</value> + <value>wrap</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="writing-mode.attr"> + <attribute name="writing-mode"> + <choice> + <value>lr-tb</value> + <value>rl-tb</value> + <value>tb-rl</value> + <value>lr</value> + <value>rl</value> + <value>tb</value> + <value>inherit</value> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + <define name="z-index.attr"> + <attribute name="z-index"> + <choice> + <text/> + <ref name="expr.datatype"/> + </choice> + </attribute> + </define> + +</grammar> diff --git a/sandbox/paultremblay/python_interface/tools/test_shortcuts.py b/sandbox/paultremblay/python_interface/tools/test_shortcuts.py new file mode 100644 index 000000000..c02572704 --- /dev/null +++ b/sandbox/paultremblay/python_interface/tools/test_shortcuts.py @@ -0,0 +1,19 @@ +import os, sys +sys.path.insert(0, '../docutilsToFo') +from docutils_fo_dicts import att_set_dict, short_cut_att_sets +import pprint + +def dump(object): + pp = pprint.PrettyPrinter(indent=4) + sys.stdout.write(pp.pformat(object)) + sys.stdout.write('\n') + +set_shortcut = set(short_cut_att_sets.values()) +set_att_set = set(att_set_dict.keys()) + +if set_shortcut.issubset(set_att_set): + print 'No problems' +else: + print 'missing att sets' + diff = set_shortcut.difference(set_att_set) + dump(diff) |
