Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

multi-switch_select-first-fitting_forced-page-break.xml 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 forced page breaks.
  20. </p>
  21. </info>
  22. <fo>
  23. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
  24. <fo:layout-master-set>
  25. <fo:simple-page-master master-name="page" page-width="300pt" page-height="200pt" margin="10pt">
  26. <fo:region-body/>
  27. </fo:simple-page-master>
  28. </fo:layout-master-set>
  29. <fo:page-sequence master-reference="page">
  30. <fo:flow flow-name="xsl-region-body">
  31. <fo:block break-after="page">
  32. Block 1 page 1
  33. <fo:multi-switch fox:auto-toggle="select-first-fitting">
  34. <fo:multi-case>
  35. <fo:block>MS1 Variant 1</fo:block>
  36. </fo:multi-case>
  37. </fo:multi-switch>
  38. </fo:block>
  39. <fo:multi-switch fox:auto-toggle="select-first-fitting">
  40. <fo:multi-case>
  41. <fo:block>MS2 Variant 1</fo:block>
  42. </fo:multi-case>
  43. </fo:multi-switch>
  44. <fo:block break-before="page">
  45. Block 2 page 3
  46. <fo:multi-switch fox:auto-toggle="select-first-fitting">
  47. <fo:multi-case>
  48. <fo:block>MS3 Variant 1</fo:block>
  49. </fo:multi-case>
  50. </fo:multi-switch>
  51. </fo:block>
  52. </fo:flow>
  53. </fo:page-sequence>
  54. </fo:root>
  55. </fo>
  56. <checks>
  57. <eval expected="3" xpath="count(//pageSequence[1]/pageViewport)"/>
  58. <eval expected="Block 1 page 1" xpath="//pageSequence[1]/pageViewport[1]//flow/block[1]/lineArea[1]"/>
  59. <eval expected="MS1 Variant 1" xpath="//pageSequence[1]/pageViewport[1]//flow/block[1]/block[1]"/>
  60. <eval expected="MS2 Variant 1" xpath="//pageSequence[1]/pageViewport[2]//flow/block[1]"/>
  61. <eval expected="Block 2 page 3" xpath="//pageSequence[1]/pageViewport[3]//flow/block[1]/lineArea[1]"/>
  62. <eval expected="MS3 Variant 1" xpath="//pageSequence[1]/pageViewport[3]//flow/block[1]/block[1]"/>
  63. </checks>
  64. </testcase>