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_table-row_break-before.xml 3.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 that there is only one page break when break-before is specified both on a
  21. table and its first row.
  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="page" page-height="10cm" page-width="15cm"
  28. margin-top="1cm" margin-bottom="0" margin-left="1cm" margin-right="1cm">
  29. <fo:region-body/>
  30. </fo:simple-page-master>
  31. </fo:layout-master-set>
  32. <fo:page-sequence master-reference="page">
  33. <fo:flow flow-name="xsl-region-body">
  34. <fo:block>Before the table</fo:block>
  35. <fo:table width="100%" table-layout="fixed" border-collapse="collapse" border="4pt solid black"
  36. break-before="page">
  37. <fo:table-column number-columns-repeated="2" column-width="proportional-column-width(1)"/>
  38. <fo:table-header>
  39. <fo:table-row>
  40. <fo:table-cell border="2pt solid blue">
  41. <fo:block>Header 1</fo:block>
  42. </fo:table-cell>
  43. <fo:table-cell border="2pt solid blue">
  44. <fo:block>Header 2</fo:block>
  45. </fo:table-cell>
  46. </fo:table-row>
  47. </fo:table-header>
  48. <fo:table-body>
  49. <fo:table-row break-before="page">
  50. <fo:table-cell border="2pt solid black">
  51. <fo:block>Cell 1.1</fo:block>
  52. </fo:table-cell>
  53. <fo:table-cell border="2pt solid black">
  54. <fo:block>Cell 1.2</fo:block>
  55. </fo:table-cell>
  56. </fo:table-row>
  57. </fo:table-body>
  58. </fo:table>
  59. <fo:block>After the table</fo:block>
  60. </fo:flow>
  61. </fo:page-sequence>
  62. </fo:root>
  63. </fo>
  64. <checks>
  65. <!-- Two pages -->
  66. <eval expected="2" xpath="count(//pageViewport)"/>
  67. <!-- Only one line on the first page -->
  68. <eval expected="1" xpath="count(//pageViewport[@nr=1]//flow/block)"/>
  69. <eval expected="Before the table" xpath="//pageViewport[@nr=1]//flow/block[1]/lineArea/text[1]"/>
  70. <!-- Table plus line "After the table" on the second page -->
  71. <eval expected="2" xpath="count(//pageViewport[@nr=2]//flow/block)"/>
  72. <eval expected="After the table" xpath="//pageViewport[@nr=2]//flow/block[2]/lineArea/text[1]"/>
  73. </checks>
  74. </testcase>