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.

page-position_only_elastic.xml 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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>There is a possibility to lay out this document on two pages by stretching the elastic
  20. spaces. The best layout though is a one-page layout, and despite the presence of the two-page
  21. possibility, the page-master for page-position="only" must still be chosen.</p>
  22. </info>
  23. <fo>
  24. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-size="8pt" line-height="10pt">
  25. <fo:layout-master-set>
  26. <fo:simple-page-master master-name="default" page-height="120pt" page-width="220pt"
  27. margin="10pt">
  28. <fo:region-body/>
  29. </fo:simple-page-master>
  30. <fo:simple-page-master master-name="only" page-height="120pt" page-width="220pt"
  31. margin="10pt">
  32. <fo:region-body background-color="#E0E0E0"/>
  33. </fo:simple-page-master>
  34. <fo:page-sequence-master master-name="with-only">
  35. <fo:repeatable-page-master-alternatives>
  36. <fo:conditional-page-master-reference master-reference="only" page-position="only"/>
  37. <fo:conditional-page-master-reference master-reference="default"/>
  38. </fo:repeatable-page-master-alternatives>
  39. </fo:page-sequence-master>
  40. </fo:layout-master-set>
  41. <fo:page-sequence master-reference="with-only">
  42. <fo:flow flow-name="xsl-region-body" text-align="justify" space-after.minimum="5pt"
  43. space-after.optimum="10pt" space-after.maximum="30pt">
  44. <fo:block space-after="inherit">Only page</fo:block>
  45. <fo:block space-after="inherit">Only page</fo:block>
  46. <fo:block space-after="inherit">Only page</fo:block>
  47. <fo:block space-after="inherit">Only page</fo:block>
  48. <fo:block space-after="inherit">Only page</fo:block>
  49. </fo:flow>
  50. </fo:page-sequence>
  51. </fo:root>
  52. </fo>
  53. <checks>
  54. <eval expected="1" xpath="count(//pageSequence[1]/pageViewport)"/>
  55. <eval expected="only" xpath="//pageSequence[1]/pageViewport/@simple-page-master-name"/>
  56. </checks>
  57. </testcase>