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.

bookmarks_1.xml 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 the handling of the bookmarks tree in the area tree.
  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="normal" page-width="5in" page-height="5in"
  27. margin="20pt">
  28. <fo:region-body background-color="yellow"/>
  29. </fo:simple-page-master>
  30. </fo:layout-master-set>
  31. <fo:bookmark-tree>
  32. <fo:bookmark internal-destination="chapter1">
  33. <fo:bookmark-title>Chapter 1</fo:bookmark-title>
  34. </fo:bookmark>
  35. <fo:bookmark internal-destination="chapter2" starting-state="hide">
  36. <fo:bookmark-title>Chapter 2</fo:bookmark-title>
  37. <fo:bookmark internal-destination="chapter2-sec1">
  38. <fo:bookmark-title>Section 1</fo:bookmark-title>
  39. </fo:bookmark>
  40. <fo:bookmark internal-destination="chapter2-sec2">
  41. <fo:bookmark-title>Section 2</fo:bookmark-title>
  42. </fo:bookmark>
  43. <!-- add a reference to a non-existing id; should only trigger a warning
  44. see Bugzilla 50593
  45. -->
  46. <fo:bookmark internal-destination="chapterX-secX">
  47. <fo:bookmark-title>Section X</fo:bookmark-title>
  48. </fo:bookmark>
  49. </fo:bookmark>
  50. <fo:bookmark internal-destination="bc">
  51. <fo:bookmark-title>Fixed Block Container</fo:bookmark-title>
  52. </fo:bookmark>
  53. </fo:bookmark-tree>
  54. <fo:page-sequence id="page-sequence" master-reference="normal" white-space-collapse="true">
  55. <fo:flow flow-name="xsl-region-body">
  56. <fo:block id="chapter1" font-weight="bold" font-size="larger">Chapter 1</fo:block>
  57. <fo:block>Blah blah bla.</fo:block>
  58. <fo:block id="chapter2" font-weight="bold" font-size="larger" break-before="page">Chapter 2</fo:block>
  59. <fo:block>Blah blah bla.</fo:block>
  60. <fo:block id="chapter2-sec1" font-weight="bold">Section 1</fo:block>
  61. <fo:block>Blah blah bla.</fo:block>
  62. <fo:block id="chapter2-sec2" font-weight="bold">Section 2</fo:block>
  63. <fo:block>Blah blah bla.</fo:block>
  64. <fo:block-container absolute-position="fixed" left="3in" top="3in" width="1.5in" height="1in">
  65. <fo:block id="bc">
  66. Text in a block-container.
  67. </fo:block>
  68. </fo:block-container>"
  69. </fo:flow>
  70. </fo:page-sequence>
  71. </fo:root>
  72. </fo>
  73. <checks>
  74. <eval expected="2" xpath="count(//pageViewport)"/>
  75. <eval expected="Chapter 1" xpath="//bookmarkTree/bookmark[1]/@title"/>
  76. <eval expected="true" xpath="//bookmarkTree/bookmark[1]/@show-children"/>
  77. <eval expected="Chapter 2" xpath="//bookmarkTree/bookmark[2]/@title"/>
  78. <eval expected="false" xpath="//bookmarkTree/bookmark[2]/@show-children"/>
  79. <eval expected="Section 2" xpath="//bookmarkTree/bookmark[2]/bookmark[2]/@title"/>
  80. <eval expected="true" xpath="//bookmarkTree/bookmark[2]/bookmark[2]/@show-children"/>
  81. <eval expected="(P1,chapter1)" xpath="//bookmarkTree/bookmark[1]/@internal-link"/>
  82. <eval expected="(P2,chapter2)" xpath="//bookmarkTree/bookmark[2]/@internal-link"/>
  83. <eval expected="(P2,chapter2-sec1)" xpath="//bookmarkTree/bookmark[2]/bookmark[1]/@internal-link"/>
  84. <eval expected="(P2,chapter2-sec2)" xpath="//bookmarkTree/bookmark[2]/bookmark[2]/@internal-link"/>
  85. </checks>
  86. <if-checks xmlns:n="http://xmlgraphics.apache.org/fop/intermediate/document-navigation">
  87. <eval expected="show" xpath="//n:bookmark-tree/n:bookmark[1]/@starting-state"/>
  88. <eval expected="Chapter 1" xpath="//n:bookmark-tree/n:bookmark[1]/@title"/>
  89. <eval expected="0" xpath="//n:bookmark-tree/n:bookmark[1]/n:goto-xy/@page-index"/>
  90. <eval expected="20000" xpath="//n:bookmark-tree/n:bookmark[1]/n:goto-xy/@x"/>
  91. <eval expected="20000" xpath="//n:bookmark-tree/n:bookmark[1]/n:goto-xy/@y"/>
  92. <eval expected="hide" xpath="//n:bookmark-tree/n:bookmark[2]/@starting-state"/>
  93. <eval expected="Chapter 2" xpath="//n:bookmark-tree/n:bookmark[2]/@title"/>
  94. <eval expected="1" xpath="//n:bookmark-tree/n:bookmark[2]/n:goto-xy/@page-index"/>
  95. <eval expected="20000" xpath="//n:bookmark-tree/n:bookmark[2]/n:goto-xy/@x"/>
  96. <eval expected="20000" xpath="//n:bookmark-tree/n:bookmark[2]/n:goto-xy/@y"/>
  97. <eval expected="show" xpath="//n:bookmark-tree/n:bookmark[2]/n:bookmark[1]/@starting-state"/>
  98. <eval expected="Section 1" xpath="//n:bookmark-tree/n:bookmark[2]/n:bookmark[1]/@title"/>
  99. <eval expected="1" xpath="//n:bookmark-tree/n:bookmark[2]/n:bookmark[1]/n:goto-xy/@page-index"/>
  100. <eval expected="20000" xpath="//n:bookmark-tree/n:bookmark[2]/n:bookmark[1]/n:goto-xy/@x"/>
  101. <eval expected="51680" xpath="//n:bookmark-tree/n:bookmark[2]/n:bookmark[1]/n:goto-xy/@y"/>
  102. <eval expected="show" xpath="//n:bookmark-tree/n:bookmark[3]/@starting-state"/>
  103. <eval expected="Fixed Block Container" xpath="//n:bookmark-tree/n:bookmark[3]/@title"/>
  104. <eval expected="1" xpath="//n:bookmark-tree/n:bookmark[3]/n:goto-xy/@page-index"/>
  105. <eval expected="216000" xpath="//n:bookmark-tree/n:bookmark[3]/n:goto-xy/@x"/>
  106. <eval expected="216000" xpath="//n:bookmark-tree/n:bookmark[3]/n:goto-xy/@y"/>
  107. </if-checks>
  108. </testcase>