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.

marker_instream-foreign-object.xml 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 for fo:instream-foreign-object in fo:markers.
  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="first"
  27. margin-right="1.5cm"
  28. margin-left="1.5cm"
  29. margin-bottom="2cm"
  30. margin-top="1cm"
  31. page-width="21cm"
  32. page-height="29.7cm">
  33. <fo:region-body margin-top="1cm"/>
  34. <fo:region-before extent="1cm"/>
  35. <fo:region-after extent="1.5cm"/>
  36. </fo:simple-page-master>
  37. </fo:layout-master-set>
  38. <fo:page-sequence master-reference="first" initial-page-number="1">
  39. <fo:static-content flow-name="xsl-region-before">
  40. <fo:block-container height="1cm" width="15cm" top="0cm" left="0cm" position="absolute">
  41. <fo:block font-size="0pt">
  42. <fo:retrieve-marker retrieve-class-name="mark"
  43. retrieve-boundary="page"
  44. retrieve-position="last-ending-within-page"/>
  45. </fo:block>
  46. </fo:block-container>
  47. </fo:static-content>
  48. <fo:static-content flow-name="xsl-region-after">
  49. <fo:block text-align="start" font-size="10pt" font-family="serif" line-height="1em + 2pt">
  50. Page (<fo:page-number/> / <fo:page-number-citation ref-id="end-of-document"/>)
  51. </fo:block>
  52. </fo:static-content>
  53. <fo:flow flow-name="xsl-region-body">
  54. <fo:block text-align="start" font-size="12pt" font-family="sans-serif">
  55. Some text.
  56. </fo:block>
  57. <fo:block id="end-of-document">
  58. <fo:marker marker-class-name="mark">
  59. <fo:instream-foreign-object width="15cm" height="1cm" id="ifo1">
  60. <svg xmlns="http://www.w3.org/2000/svg" width="15cm" height="1cm" xml:space="preserve">
  61. <rect style="fill:red;stroke:red" x="0" y="0" width="15cm" height="1cm"/>
  62. </svg>
  63. </fo:instream-foreign-object>
  64. </fo:marker>
  65. </fo:block>
  66. </fo:flow>
  67. </fo:page-sequence>
  68. </fo:root>
  69. </fo>
  70. <checks>
  71. <!-- check whether the i-f-o viewport exists -->
  72. <true xpath="boolean(//viewport[@prod-id='ifo1'])" fail-msg="foreign object viewport not found" />
  73. <!-- check whether the i-f-o viewport has any content -->
  74. <true xpath="boolean(//viewport[@prod-id='ifo1']/*)" fail-msg="foreign object not rendered" />
  75. <!-- check whether the foreign object itself survives marker-cloning -->
  76. <eval expected="1" xpath="count(//foreignObject[@prod-id='ifo1'][1]/*)" />
  77. <eval expected="svg" xpath="local-name(//foreignObject[@prod-id='ifo1'][1]/*[1])" />
  78. <eval expected="1" xpath="count(//foreignObject[@prod-id='ifo1'][1]/*/*)" />
  79. <eval expected="rect" xpath="local-name(//foreignObject[@prod-id='ifo1'][1]/*[1]/*[1])" />
  80. </checks>
  81. </testcase>