summaryrefslogtreecommitdiff
path: root/sandbox/paultremblay/python_interface/docutilsToFo/valid
diff options
context:
space:
mode:
authorpaultremblay <paultremblay@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2011-09-26 19:27:15 +0000
committerpaultremblay <paultremblay@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2011-09-26 19:27:15 +0000
commit8c616ca52509e49abfbb2b4013587fe62db2fd17 (patch)
tree748eedfe3384265e78f5b00a49838702f8f2e17b /sandbox/paultremblay/python_interface/docutilsToFo/valid
parent3929d5c5aa6463da2451c38fde34356318311dd6 (diff)
downloaddocutils-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/valid')
-rw-r--r--sandbox/paultremblay/python_interface/docutilsToFo/valid/basic_properties.rng3087
-rw-r--r--sandbox/paultremblay/python_interface/docutilsToFo/valid/datatype.rng115
-rw-r--r--sandbox/paultremblay/python_interface/docutilsToFo/valid/docutils.dtd618
-rw-r--r--sandbox/paultremblay/python_interface/docutilsToFo/valid/docutils.rng1503
-rw-r--r--sandbox/paultremblay/python_interface/docutilsToFo/valid/elements.rng1143
-rw-r--r--sandbox/paultremblay/python_interface/docutilsToFo/valid/folint.xsl3554
-rw-r--r--sandbox/paultremblay/python_interface/docutilsToFo/valid/main.rng474
-rw-r--r--sandbox/paultremblay/python_interface/docutilsToFo/valid/properties.rng991
-rw-r--r--sandbox/paultremblay/python_interface/docutilsToFo/valid/properties_groups.rng1209
-rw-r--r--sandbox/paultremblay/python_interface/docutilsToFo/valid/soextblx.dtd309
-rw-r--r--sandbox/paultremblay/python_interface/docutilsToFo/valid/soextblx.rng518
11 files changed, 13521 insertions, 0 deletions
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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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 &gt; 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 &gt; 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 &lt;?xep-postscript-* ?&gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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 &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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 &gt; 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 &gt; 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 &gt; 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 &gt; 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>