You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

table-header_table-footer_4.xml 7.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <testcase>
  18. <info>
  19. <p>
  20. This test checks tables, especially headers and footers. Focus is on respect for after
  21. regions when headers and footers are used.
  22. </p>
  23. </info>
  24. <fo>
  25. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  26. <fo:layout-master-set>
  27. <fo:simple-page-master master-name="normal" page-width="5in" page-height="3in">
  28. <fo:region-body margin-top="0.5in" margin-bottom="0.5in"/>
  29. <fo:region-before extent="0.5in" background-color="lightgray"/>
  30. <fo:region-after extent="0.5in" background-color="lightgray"/>
  31. </fo:simple-page-master>
  32. </fo:layout-master-set>
  33. <fo:page-sequence master-reference="normal" white-space-collapse="true">
  34. <fo:flow flow-name="xsl-region-body">
  35. <fo:table table-layout="fixed" width="100%">
  36. <fo:table-column/>
  37. <fo:table-header color="red">
  38. <fo:table-row>
  39. <fo:table-cell id="outer-header">
  40. <fo:block>Outer header</fo:block>
  41. </fo:table-cell>
  42. </fo:table-row>
  43. </fo:table-header>
  44. <fo:table-footer color="red">
  45. <fo:table-row>
  46. <fo:table-cell id="outer-footer">
  47. <fo:block>Outer footer</fo:block>
  48. </fo:table-cell>
  49. </fo:table-row>
  50. </fo:table-footer>
  51. <fo:table-body>
  52. <fo:table-row>
  53. <fo:table-cell id="outer-table-cell">
  54. <fo:table table-layout="fixed" width="100%">
  55. <fo:table-column/>
  56. <fo:table-header color="orange">
  57. <fo:table-row>
  58. <fo:table-cell id="inner-header">
  59. <fo:block>Inner header</fo:block>
  60. </fo:table-cell>
  61. </fo:table-row>
  62. </fo:table-header>
  63. <fo:table-footer color="orange">
  64. <fo:table-row>
  65. <fo:table-cell id="inner-footer">
  66. <fo:block>Inner footer</fo:block>
  67. </fo:table-cell>
  68. </fo:table-row>
  69. </fo:table-footer>
  70. <fo:table-body>
  71. <fo:table-row>
  72. <fo:table-cell>
  73. <fo:block>content content content</fo:block>
  74. </fo:table-cell>
  75. </fo:table-row>
  76. <fo:table-row>
  77. <fo:table-cell>
  78. <fo:block>content content content</fo:block>
  79. </fo:table-cell>
  80. </fo:table-row>
  81. <fo:table-row>
  82. <fo:table-cell>
  83. <fo:block>content content content</fo:block>
  84. </fo:table-cell>
  85. </fo:table-row>
  86. <fo:table-row>
  87. <fo:table-cell>
  88. <fo:block>content content content</fo:block>
  89. </fo:table-cell>
  90. </fo:table-row>
  91. <fo:table-row>
  92. <fo:table-cell>
  93. <fo:block>content content content</fo:block>
  94. </fo:table-cell>
  95. </fo:table-row>
  96. <fo:table-row>
  97. <fo:table-cell>
  98. <fo:block>content content content</fo:block>
  99. </fo:table-cell>
  100. </fo:table-row>
  101. <fo:table-row>
  102. <fo:table-cell>
  103. <fo:block>content content content</fo:block>
  104. </fo:table-cell>
  105. </fo:table-row>
  106. <fo:table-row>
  107. <fo:table-cell>
  108. <fo:block>content content content</fo:block>
  109. </fo:table-cell>
  110. </fo:table-row>
  111. <fo:table-row>
  112. <fo:table-cell>
  113. <fo:block>content content content</fo:block>
  114. </fo:table-cell>
  115. </fo:table-row>
  116. <fo:table-row>
  117. <fo:table-cell>
  118. <fo:block>content content content</fo:block>
  119. </fo:table-cell>
  120. </fo:table-row>
  121. <fo:table-row>
  122. <fo:table-cell>
  123. <fo:block>content content content</fo:block>
  124. </fo:table-cell>
  125. </fo:table-row>
  126. </fo:table-body>
  127. </fo:table>
  128. </fo:table-cell>
  129. </fo:table-row>
  130. </fo:table-body>
  131. </fo:table>
  132. </fo:flow>
  133. </fo:page-sequence>
  134. </fo:root>
  135. </fo>
  136. <checks>
  137. <element-list category="breaker">
  138. <box w="14400"/>
  139. <penalty w="57600" p="0"/> <!-- outer and inner header/footer = 4 * 14400 = 57600 -->
  140. <box w="14400"/>
  141. <penalty w="57600" p="0"/>
  142. <box w="14400"/>
  143. <penalty w="57600" p="0"/>
  144. <box w="14400"/>
  145. <penalty w="57600" p="0"/>
  146. <box w="14400"/>
  147. <penalty w="57600" p="0"/>
  148. <box w="14400"/>
  149. <penalty w="57600" p="0"/>
  150. <box w="14400"/>
  151. <penalty w="57600" p="0"/>
  152. <box w="14400"/>
  153. <penalty w="57600" p="0"/>
  154. <box w="14400"/>
  155. <penalty w="57600" p="0"/>
  156. <box w="14400"/>
  157. <penalty w="57600" p="0"/>
  158. <box w="43200"/> <!-- including nested header/footer -->
  159. <box w="14400"/> <!--header-->
  160. <box w="14400"/> <!--footer-->
  161. <skip>3</skip>
  162. </element-list>
  163. <!-- top-offset of outer table-cell on first page -->
  164. <eval expected="14400" xpath="//pageViewport[@nr=1]//flow/block[1]/block[2]/@top-offset"/>
  165. <!-- last row in nested table on first page -->
  166. <eval expected="86400" xpath="//pageViewport[@nr=1]//flow/block[1]/block[2]/block[1]/block[7]/@top-offset"/>
  167. <!-- top-offset of footer of nested tableon first page -->
  168. <eval expected="100800" xpath="//pageViewport[@nr=1]//flow/block[1]/block[2]/block[1]/block[8]/@top-offset"/>
  169. <!-- top-offset of outer footer on first page -->
  170. <eval expected="129600" xpath="//pageViewport[@nr=1]//flow/block[1]/block[3]/@top-offset"/>
  171. <!-- content lengths of both pages -->
  172. <eval expected="144000" xpath="//pageViewport[@nr=1]//flow/@bpd"/>
  173. <eval expected="129600" xpath="//pageViewport[@nr=2]//flow/@bpd"/>
  174. </checks>
  175. </testcase>