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.

multi-switch_select-first-fitting_several-multi-switch.xml 4.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. <testcase>
  17. <info>
  18. <p>
  19. Test that multiple whitespace managment elements on the same page are handled nicely.
  20. </p>
  21. </info>
  22. <fo>
  23. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
  24. xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" font-size="8pt" line-height="10pt">
  25. <fo:layout-master-set>
  26. <fo:simple-page-master master-name="page"
  27. page-height="70pt" page-width="220pt" margin="10pt">
  28. <fo:region-body background-color="#F0F0F0"/>
  29. </fo:simple-page-master>
  30. </fo:layout-master-set>
  31. <fo:page-sequence master-reference="page">
  32. <fo:flow flow-name="xsl-region-body">
  33. <fo:multi-switch fox:auto-toggle="select-first-fitting">
  34. <fo:multi-case>
  35. <fo:block>MS 1 Variant 1</fo:block>
  36. </fo:multi-case>
  37. </fo:multi-switch>
  38. <fo:multi-switch fox:auto-toggle="select-first-fitting">
  39. <fo:multi-case>
  40. <fo:block>MS 2 Variant 1</fo:block>
  41. </fo:multi-case>
  42. </fo:multi-switch>
  43. <fo:multi-switch fox:auto-toggle="select-first-fitting">
  44. <fo:multi-case>
  45. <fo:block>MS 3 Variant 1</fo:block>
  46. </fo:multi-case>
  47. </fo:multi-switch>
  48. </fo:flow>
  49. </fo:page-sequence>
  50. <fo:page-sequence master-reference="page">
  51. <fo:flow flow-name="xsl-region-body">
  52. <fo:multi-switch fox:auto-toggle="select-first-fitting">
  53. <fo:multi-case>
  54. <fo:block line-height="70pt">MS 1 Variant 1</fo:block>
  55. </fo:multi-case>
  56. </fo:multi-switch>
  57. <fo:multi-switch fox:auto-toggle="select-first-fitting">
  58. <fo:multi-case>
  59. <fo:block>MS 2 Variant 1</fo:block>
  60. </fo:multi-case>
  61. </fo:multi-switch>
  62. <fo:multi-switch fox:auto-toggle="select-first-fitting">
  63. <fo:multi-case>
  64. <fo:block line-height="50pt">MS 3 Variant 1</fo:block>
  65. </fo:multi-case>
  66. <fo:multi-case>
  67. <fo:block>MS 3 Variant 2</fo:block>
  68. </fo:multi-case>
  69. </fo:multi-switch>
  70. <fo:multi-switch fox:auto-toggle="select-first-fitting">
  71. <fo:multi-case>
  72. <fo:block>MS 4 Variant 1</fo:block>
  73. </fo:multi-case>
  74. </fo:multi-switch>
  75. </fo:flow>
  76. </fo:page-sequence>
  77. </fo:root>
  78. </fo>
  79. <checks>
  80. <!-- 1. 3 multi-switch on the same page -->
  81. <eval expected="1" xpath="count(//pageSequence[1]/pageViewport)"/>
  82. <eval expected="3" xpath="count(//pageSequence[1]/pageViewport[1]//flow/block)"/>
  83. <eval expected="MS 1 Variant 1" xpath="//pageSequence[1]/pageViewport[1]//flow/block[1]"/>
  84. <eval expected="MS 2 Variant 1" xpath="//pageSequence[1]/pageViewport[1]//flow/block[2]"/>
  85. <eval expected="MS 3 Variant 1" xpath="//pageSequence[1]/pageViewport[1]//flow/block[3]"/>
  86. <!-- 2. 4 multi-switch, one cannot fit, one uses the 2nd variant -->
  87. <eval expected="1" xpath="count(//pageSequence[2]/pageViewport)"/>
  88. <eval expected="3" xpath="count(//pageSequence[2]/pageViewport[1]//flow/block)"/>
  89. <eval expected="MS 2 Variant 1" xpath="//pageSequence[2]/pageViewport[1]//flow/block[1]"/>
  90. <eval expected="MS 3 Variant 2" xpath="//pageSequence[2]/pageViewport[1]//flow/block[2]"/>
  91. <eval expected="MS 4 Variant 1" xpath="//pageSequence[2]/pageViewport[1]//flow/block[3]"/>
  92. </checks>
  93. </testcase>