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_keep-with-previous.xml 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 keep-with-previous works on tables.
  21. </p>
  22. </info>
  23. <fo>
  24. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  25. <fo:layout-master-set>
  26. <fo:simple-page-master master-name="page" page-height="6cm" page-width="15cm"
  27. margin-top="1cm" margin-bottom="0" margin-left="1cm" margin-right="1cm">
  28. <fo:region-body/>
  29. </fo:simple-page-master>
  30. </fo:layout-master-set>
  31. <fo:page-sequence master-reference="page" font-family="serif" font-size="14pt">
  32. <fo:flow flow-name="xsl-region-body">
  33. <fo:block space-after="100pt">First line</fo:block>
  34. <fo:block>Before the table</fo:block>
  35. <fo:table width="100%" table-layout="fixed" border-collapse="separate" border="4pt solid black"
  36. keep-with-previous="always">
  37. <fo:table-column number-columns-repeated="2" column-width="proportional-column-width(1)"/>
  38. <fo:table-body>
  39. <fo:table-row>
  40. <fo:table-cell border="2pt solid blue">
  41. <fo:block>Cell 1.1 Line 1</fo:block>
  42. <fo:block>Cell 1.1 Line 2</fo:block>
  43. </fo:table-cell>
  44. <fo:table-cell border="2pt solid teal">
  45. <fo:block>Cell 1.2 Line 1</fo:block>
  46. <fo:block>Cell 1.2 Line 2</fo:block>
  47. </fo:table-cell>
  48. </fo:table-row>
  49. <fo:table-row>
  50. <fo:table-cell border="2pt solid green">
  51. <fo:block>Cell 2.1 Line 1</fo:block>
  52. <fo:block>Cell 2.1 Line 2</fo:block>
  53. </fo:table-cell>
  54. <fo:table-cell border="2pt solid olive">
  55. <fo:block>Cell 2.1 Line 1</fo:block>
  56. <fo:block>Cell 2.1 Line 2</fo:block>
  57. </fo:table-cell>
  58. </fo:table-row>
  59. </fo:table-body>
  60. </fo:table>
  61. </fo:flow>
  62. </fo:page-sequence>
  63. </fo:root>
  64. </fo>
  65. <checks>
  66. <!-- Two pages -->
  67. <eval expected="2" xpath="count(//pageViewport)"/>
  68. <!-- Only one line on the first page -->
  69. <eval expected="1" xpath="count(//pageViewport[@nr=1]//flow/block)"/>
  70. <eval expected="First line" xpath="//pageViewport[@nr=1]//flow/block[1]/lineArea/text[1]"/>
  71. <!-- Line "Before the table" plus the table itself on the second page -->
  72. <eval expected="2" xpath="count(//pageViewport[@nr=2]//flow/block)"/>
  73. <eval expected="Before the table" xpath="//pageViewport[@nr=2]//flow/block[1]/lineArea/text[1]"/>
  74. <!-- table -->
  75. <eval expected="75200" xpath="//pageViewport[@nr=2]//flow/block[2]/@bpd"/>
  76. <eval expected="83200" xpath="//pageViewport[@nr=2]//flow/block[2]/@bpda"/>
  77. <eval expected="(solid,#000000,4000)" xpath="//pageViewport[@nr=2]//flow/block[2]/@border-before"/>
  78. <eval expected="(solid,#000000,4000)" xpath="//pageViewport[@nr=2]//flow/block[2]/@border-after"/>
  79. <!-- cell 1.1 -->
  80. <eval expected="33600" xpath="//pageViewport[@nr=2]//flow/block[2]/block[1]/@bpd"/>
  81. <eval expected="37600" xpath="//pageViewport[@nr=2]//flow/block[2]/block[1]/@bpda"/>
  82. <eval expected="(solid,#0000ff,2000)" xpath="//pageViewport[@nr=2]//flow/block[2]/block[1]/@border-before"/>
  83. <eval expected="(solid,#0000ff,2000)" xpath="//pageViewport[@nr=2]//flow/block[2]/block[1]/@border-after"/>
  84. <!-- cell 1.2 -->
  85. <eval expected="33600" xpath="//pageViewport[@nr=2]//flow/block[2]/block[2]/@bpd"/>
  86. <eval expected="37600" xpath="//pageViewport[@nr=2]//flow/block[2]/block[2]/@bpda"/>
  87. <eval expected="(solid,#008080,2000)" xpath="//pageViewport[@nr=2]//flow/block[2]/block[2]/@border-before"/>
  88. <eval expected="(solid,#008080,2000)" xpath="//pageViewport[@nr=2]//flow/block[2]/block[2]/@border-after"/>
  89. <!-- cell 2.1 -->
  90. <eval expected="33600" xpath="//pageViewport[@nr=2]//flow/block[2]/block[3]/@bpd"/>
  91. <eval expected="37600" xpath="//pageViewport[@nr=2]//flow/block[2]/block[3]/@bpda"/>
  92. <eval expected="(solid,#008000,2000)" xpath="//pageViewport[@nr=2]//flow/block[2]/block[3]/@border-before"/>
  93. <eval expected="(solid,#008000,2000)" xpath="//pageViewport[@nr=2]//flow/block[2]/block[3]/@border-after"/>
  94. <!-- cell 2.2 -->
  95. <eval expected="33600" xpath="//pageViewport[@nr=2]//flow/block[2]/block[4]/@bpd"/>
  96. <eval expected="37600" xpath="//pageViewport[@nr=2]//flow/block[2]/block[4]/@bpda"/>
  97. <eval expected="(solid,#808000,2000)" xpath="//pageViewport[@nr=2]//flow/block[2]/block[4]/@border-before"/>
  98. <eval expected="(solid,#808000,2000)" xpath="//pageViewport[@nr=2]//flow/block[2]/block[4]/@border-after"/>
  99. </checks>
  100. </testcase>