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.

images.xml 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?xml version="1.0" standalone="no"?>
  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. This test checks that IDs coming from images properly appear in the IF output.
  20. </p>
  21. </info>
  22. <fo>
  23. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  24. <fo:layout-master-set>
  25. <fo:simple-page-master master-name="page"
  26. page-height="320pt" page-width="420pt" margin="10pt">
  27. <fo:region-body/>
  28. </fo:simple-page-master>
  29. </fo:layout-master-set>
  30. <fo:page-sequence master-reference="page">
  31. <fo:flow flow-name="xsl-region-body" text-align="justify">
  32. <fo:block>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce rutrum leo a diam
  33. bibendum auctor. <fo:external-graphic src="../resources/images/fop-logo-color-24bit.png"
  34. id="external-graphic"/>Vivamus porttitor sollicitudin tortor eu vulputate. In vel
  35. libero libero, a semper est.</fo:block>
  36. </fo:flow>
  37. </fo:page-sequence>
  38. <fo:page-sequence master-reference="page">
  39. <fo:flow flow-name="xsl-region-body" text-align="justify">
  40. <fo:block>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce rutrum leo a diam
  41. bibendum auctor. <fo:instream-foreign-object id="instream-foreign-object" width="120pt"
  42. display-align="center" content-width="scale-to-fit">
  43. <svg xmlns="http://www.w3.org/2000/svg" width="300" height="286.6">
  44. <g style="fill-opacity:0.7; stroke:black; stroke-width:3"
  45. transform="translate(0, 286.6) scale(1, -1) translate(100, 100)">
  46. <circle cx="50" cy="86.6" r="80" style="fill:red;"/>
  47. <circle cx="0" cy="0" r="80" style="fill:green;"/>
  48. <circle cx="100" cy="0" r="80" style="fill:blue;"/>
  49. </g>
  50. </svg>
  51. </fo:instream-foreign-object> Vivamus porttitor sollicitudin tortor eu vulputate. In vel
  52. libero libero, a semper est.</fo:block>
  53. </fo:flow>
  54. </fo:page-sequence>
  55. </fo:root>
  56. </fo>
  57. <if-checks xmlns:if="http://xmlgraphics.apache.org/fop/intermediate">
  58. <!-- Page 1 -->
  59. <eval expected="7" xpath="count(//if:page-sequence[1]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'])"/>
  60. <eval expected="text" xpath="local-name(//if:page-sequence[1]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][1])"/>
  61. <eval expected="text" xpath="local-name(//if:page-sequence[1]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][2])"/>
  62. <eval expected="id" xpath="local-name(//if:page-sequence[1]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][3])"/>
  63. <eval expected="image" xpath="local-name(//if:page-sequence[1]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][4])"/>
  64. <eval expected="id" xpath="local-name(//if:page-sequence[1]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][5])"/>
  65. <eval expected="text" xpath="local-name(//if:page-sequence[1]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][6])"/>
  66. <eval expected="text" xpath="local-name(//if:page-sequence[1]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][7])"/>
  67. <eval expected="external-graphic" xpath="//if:page-sequence[1]/descendant::*[local-name() = 'id'][1]/@name"/>
  68. <eval expected="" xpath="//if:page-sequence[1]/descendant::*[local-name() = 'id'][2]/@name"/>
  69. <!-- Page 2 -->
  70. <eval expected="7" xpath="count(//if:page-sequence[2]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'])"/>
  71. <eval expected="text" xpath="local-name(//if:page-sequence[2]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][1])"/>
  72. <eval expected="text" xpath="local-name(//if:page-sequence[2]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][2])"/>
  73. <eval expected="id" xpath="local-name(//if:page-sequence[2]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][3])"/>
  74. <eval expected="image" xpath="local-name(//if:page-sequence[2]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][4])"/>
  75. <eval expected="id" xpath="local-name(//if:page-sequence[2]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][5])"/>
  76. <eval expected="text" xpath="local-name(//if:page-sequence[2]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][6])"/>
  77. <eval expected="text" xpath="local-name(//if:page-sequence[2]/descendant::*[local-name() = 'text' or local-name() = 'image' or local-name() = 'id'][7])"/>
  78. <eval expected="instream-foreign-object" xpath="//if:page-sequence[2]/descendant::*[local-name() = 'id'][1]/@name"/>
  79. <eval expected="" xpath="//if:page-sequence[2]/descendant::*[local-name() = 'id'][2]/@name"/>
  80. </if-checks>
  81. </testcase>