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/docutilsToFo | |
| 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/docutilsToFo')
45 files changed, 26592 insertions, 0 deletions
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> |
