Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

table_keep-with-next.xml 5.6KB

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-next 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="40pt">First line</fo:block>
  34. <fo:table width="100%" table-layout="fixed" border-collapse="separate" border="4pt solid black"
  35. keep-with-next="always" keep-together="always">
  36. <fo:table-column number-columns-repeated="2" column-width="proportional-column-width(1)"/>
  37. <fo:table-body>
  38. <fo:table-row>
  39. <fo:table-cell border="2pt solid blue">
  40. <fo:block>Cell 1.1 Line 1</fo:block>
  41. <fo:block>Cell 1.1 Line 2</fo:block>
  42. </fo:table-cell>
  43. <fo:table-cell border="2pt solid teal">
  44. <fo:block>Cell 1.2 Line 1</fo:block>
  45. <fo:block>Cell 1.2 Line 2</fo:block>
  46. </fo:table-cell>
  47. </fo:table-row>
  48. <fo:table-row>
  49. <fo:table-cell border="2pt solid green">
  50. <fo:block>Cell 2.1 Line 1</fo:block>
  51. <fo:block>Cell 2.1 Line 2</fo:block>
  52. </fo:table-cell>
  53. <fo:table-cell border="2pt solid olive">
  54. <fo:block>Cell 2.1 Line 1</fo:block>
  55. <fo:block>Cell 2.1 Line 2</fo:block>
  56. </fo:table-cell>
  57. </fo:table-row>
  58. </fo:table-body>
  59. </fo:table>
  60. <fo:block>After the table</fo:block>
  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="After the table" xpath="//pageViewport[@nr=2]//flow/block[2]/lineArea/text[1]"/>
  74. <!-- table -->
  75. <eval expected="75200" xpath="//pageViewport[@nr=2]//flow/block[1]/@bpd"/>
  76. <eval expected="83200" xpath="//pageViewport[@nr=2]//flow/block[1]/@bpda"/>
  77. <eval expected="(solid,#000000,4000)" xpath="//pageViewport[@nr=2]//flow/block[1]/@border-before"/>
  78. <eval expected="(solid,#000000,4000)" xpath="//pageViewport[@nr=2]//flow/block[1]/@border-after"/>
  79. <!-- cell 1.1 -->
  80. <eval expected="33600" xpath="//pageViewport[@nr=2]//flow/block[1]/block[1]/@bpd"/>
  81. <eval expected="37600" xpath="//pageViewport[@nr=2]//flow/block[1]/block[1]/@bpda"/>
  82. <eval expected="(solid,#0000ff,2000)" xpath="//pageViewport[@nr=2]//flow/block[1]/block[1]/@border-before"/>
  83. <eval expected="(solid,#0000ff,2000)" xpath="//pageViewport[@nr=2]//flow/block[1]/block[1]/@border-after"/>
  84. <!-- cell 1.2 -->
  85. <eval expected="33600" xpath="//pageViewport[@nr=2]//flow/block[1]/block[2]/@bpd"/>
  86. <eval expected="37600" xpath="//pageViewport[@nr=2]//flow/block[1]/block[2]/@bpda"/>
  87. <eval expected="(solid,#008080,2000)" xpath="//pageViewport[@nr=2]//flow/block[1]/block[2]/@border-before"/>
  88. <eval expected="(solid,#008080,2000)" xpath="//pageViewport[@nr=2]//flow/block[1]/block[2]/@border-after"/>
  89. <!-- cell 2.1 -->
  90. <eval expected="33600" xpath="//pageViewport[@nr=2]//flow/block[1]/block[3]/@bpd"/>
  91. <eval expected="37600" xpath="//pageViewport[@nr=2]//flow/block[1]/block[3]/@bpda"/>
  92. <eval expected="(solid,#008000,2000)" xpath="//pageViewport[@nr=2]//flow/block[1]/block[3]/@border-before"/>
  93. <eval expected="(solid,#008000,2000)" xpath="//pageViewport[@nr=2]//flow/block[1]/block[3]/@border-after"/>
  94. <!-- cell 2.2 -->
  95. <eval expected="33600" xpath="//pageViewport[@nr=2]//flow/block[1]/block[4]/@bpd"/>
  96. <eval expected="37600" xpath="//pageViewport[@nr=2]//flow/block[1]/block[4]/@bpda"/>
  97. <eval expected="(solid,#808000,2000)" xpath="//pageViewport[@nr=2]//flow/block[1]/block[4]/@border-before"/>
  98. <eval expected="(solid,#808000,2000)" xpath="//pageViewport[@nr=2]//flow/block[1]/block[4]/@border-after"/>
  99. </checks>
  100. </testcase>