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.

afp-extension_1.xml 5.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 AFP extension. The extension attachments need to show
  21. up in the area tree XML so the AreaTreeParser can fully restore the area tree.
  22. </p>
  23. </info>
  24. <fo>
  25. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
  26. xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp"
  27. xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
  28. <fo:layout-master-set>
  29. <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
  30. <afp:include-page-overlay name="O1SAMP1 "/>
  31. <afp:include-page-segment name="S1ISLOGO" src="../../resources/images/bgimg300dpi.jpg"/>
  32. <afp:tag-logical-element name="The TLE Name" value="The TLE Value"/>
  33. <afp:no-operation name="My NOP">insert up to 32k of character data here!</afp:no-operation>
  34. <fo:region-body/>
  35. </fo:simple-page-master>
  36. </fo:layout-master-set>
  37. <fo:declarations>
  38. <afp:include-form-map name="FORMMAP1" src="file:../../resources/afp/F1SAMPLE.afp"/>
  39. </fo:declarations>
  40. <fo:page-sequence master-reference="normal" fox:test-ignore="this">
  41. <afp:invoke-medium-map name="NOPAR"/>
  42. <afp:tag-logical-element name="foo" value="bar"/>
  43. <fo:flow flow-name="xsl-region-body">
  44. <fo:block>Text on page <fo:page-number/>.</fo:block>
  45. <fo:block break-before="page">Text on page <fo:page-number/>.</fo:block>
  46. </fo:flow>
  47. </fo:page-sequence>
  48. </fo:root>
  49. </fo>
  50. <checks xmlns:afp="apache:fop:extensions:afp">
  51. <eval expected="FORMMAP1" xpath="/areaTree/extension-attachments/afp:include-form-map/@name"/>
  52. <eval expected="file:../../resources/afp/F1SAMPLE.afp" xpath="/areaTree/extension-attachments/afp:include-form-map/@src"/>
  53. <eval expected="4" xpath="count(/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*)"/>
  54. <eval expected="O1SAMP1 " xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[1]/@name"/>
  55. <eval expected="S1ISLOGO" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[2]/@name"/>
  56. <eval expected="The TLE Name" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[3]/@name"/>
  57. <eval expected="The TLE Value" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[3]/@value"/>
  58. <eval expected="My NOP" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[4]/@name"/>
  59. <eval expected="4" xpath="count(/areaTree/pageSequence/pageViewport[@nr=2]/page/extension-attachments/child::*)"/>
  60. <eval expected="2" xpath="count(/areaTree/pageSequence/extension-attachments/child::*)"/>
  61. <eval expected="NOPAR" xpath="/areaTree/pageSequence/extension-attachments/child::*[1]/@name"/>
  62. <eval expected="bar" xpath="/areaTree/pageSequence/extension-attachments/afp:tag-logical-element[@name = 'foo']/@value"/>
  63. <!-- This just tests if extension attributes make it through to the PageSequence object. -->
  64. <eval expected="this" xpath="/areaTree/pageSequence/@fox:test-ignore" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"/>
  65. </checks>
  66. <if-checks xmlns:if="http://xmlgraphics.apache.org/fop/intermediate"
  67. xmlns:afp="apache:fop:extensions:afp">
  68. <eval expected="FORMMAP1" xpath="/if:document/if:header/afp:include-form-map/@name"/>
  69. <eval expected="file:../../resources/afp/F1SAMPLE.afp" xpath="/if:document/if:header/afp:include-form-map/@src"/>
  70. <eval expected="4" xpath="count(//if:page[@name = '1']/if:page-header/child::*)"/>
  71. <eval expected="O1SAMP1 " xpath="//if:page[@name = '1']/if:page-header/afp:include-page-overlay[1]/@name"/>
  72. <eval expected="S1ISLOGO" xpath="//if:page[@name = '1']/if:page-header/afp:include-page-segment[1]/@name"/>
  73. <eval expected="The TLE Value" xpath="//if:page[@name = '1']/if:page-header/afp:tag-logical-element[@name = 'The TLE Name']/@value"/>
  74. <eval expected="My NOP" xpath="//if:page[@name = '1']/if:page-header/afp:no-operation[1]/@name"/>
  75. <eval expected="insert up to 32k of character data here!" xpath="//if:page[@name = '1']/if:page-header/afp:no-operation[1]"/>
  76. <eval expected="4" xpath="count(//if:page[@name = '2']/if:page-header/child::*)"/>
  77. <eval expected="NOPAR" xpath="//if:page-sequence/afp:invoke-medium-map/@name"/>
  78. <eval expected="bar" xpath="//if:page-sequence/afp:tag-logical-element[@name = 'foo']/@value"/>
  79. <!-- This just tests if extension attributes make it through to the PageSequence object. -->
  80. <eval expected="this" xpath="//if:page-sequence/@fox:test-ignore" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"/>
  81. </if-checks>
  82. </testcase>