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_2.xml 3.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 bug="37993">
  18. <info>
  19. <p>
  20. This test checks the handling of duplicate destination in the bookmarks tree. There was a
  21. bug earlier (#37993) which made two bookmarks pointing to the same destination impossible.
  22. </p>
  23. </info>
  24. <fo>
  25. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  26. <fo:layout-master-set>
  27. <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"
  28. margin="20pt">
  29. <fo:region-body background-color="yellow"/>
  30. </fo:simple-page-master>
  31. </fo:layout-master-set>
  32. <fo:bookmark-tree>
  33. <fo:bookmark internal-destination="chapter1">
  34. <fo:bookmark-title>Chapter 1</fo:bookmark-title>
  35. <fo:bookmark internal-destination="chapter1">
  36. <fo:bookmark-title>Nested Chapter 1</fo:bookmark-title>
  37. </fo:bookmark>
  38. </fo:bookmark>
  39. <fo:bookmark internal-destination="chapter1" starting-state="hide">
  40. <fo:bookmark-title>Again Chapter 1</fo:bookmark-title>
  41. </fo:bookmark>
  42. <fo:bookmark internal-destination="chapter2">
  43. <fo:bookmark-title>Chapter 2</fo:bookmark-title>
  44. </fo:bookmark>
  45. </fo:bookmark-tree>
  46. <fo:page-sequence id="page-sequence" master-reference="normal">
  47. <fo:flow flow-name="xsl-region-body">
  48. <fo:block id="chapter1" font-weight="bold" font-size="larger">Chapter 1</fo:block>
  49. <fo:block>Blah blah bla.</fo:block>
  50. <fo:block id="chapter2" font-weight="bold" font-size="larger" break-before="page">Chapter 2</fo:block>
  51. <fo:block>Blah blah bla.</fo:block>
  52. <fo:block id="chapter2-sec1" font-weight="bold">Section 1</fo:block>
  53. <fo:block>Blah blah bla.</fo:block>
  54. <fo:block id="chapter2-sec2" font-weight="bold">Section 2</fo:block>
  55. <fo:block>Blah blah bla.</fo:block>
  56. </fo:flow>
  57. </fo:page-sequence>
  58. </fo:root>
  59. </fo>
  60. <checks>
  61. <eval expected="2" xpath="count(//pageViewport)"/>
  62. <eval expected="Chapter 1" xpath="//bookmarkTree/bookmark[1]/@title"/>
  63. <eval expected="true" xpath="//bookmarkTree/bookmark[1]/@show-children"/>
  64. <eval expected="Nested Chapter 1" xpath="//bookmarkTree/bookmark[1]/bookmark[1]/@title"/>
  65. <eval expected="true" xpath="//bookmarkTree/bookmark[1]/bookmark[1]/@show-children"/>
  66. <eval expected="Again Chapter 1" xpath="//bookmarkTree/bookmark[2]/@title"/>
  67. <eval expected="false" xpath="//bookmarkTree/bookmark[2]/@show-children"/>
  68. <eval expected="(P1,chapter1)" xpath="//bookmarkTree/bookmark[1]/@internal-link"/>
  69. <eval expected="(P1,chapter1)" xpath="//bookmarkTree/bookmark[1]/bookmark[1]/@internal-link"/>
  70. <eval expected="(P1,chapter1)" xpath="//bookmarkTree/bookmark[2]/@internal-link"/>
  71. </checks>
  72. </testcase>