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.

fo_tree.xml 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?xml version="1.0"?>
  2. <document>
  3. <header>
  4. <title>FO Tree</title>
  5. <subtitle>All you wanted to know about FO Tree !</subtitle>
  6. <authors> <person name="Keiron Liddle" email="keiron@aftexsw.com"/>
  7. </authors>
  8. </header>
  9. <body><s1 title="FO Tree">
  10. <p>
  11. The FO Tree is a representation of the XSL:FO document. This
  12. represents the <strong>Objectify</strong> step from the
  13. spec. The <strong>Refinement</strong> step is part of reading
  14. and using the properties which may happen immediately or
  15. during the layout process.
  16. </p>
  17. <p>Each xml element is represented by a java object. For pagination the
  18. classes are in <code>org.apache.fop.fo.pagination.*</code>, for elements in the flow
  19. they are in <code>org.apache.fop.fo.flow.*</code> and some others are in
  20. <code>org.apache.fop.fo.*.</code></p>
  21. <p>The base class for all objects in the tree is FONode. The base class for
  22. all FO Objects is FObj.</p>
  23. <p>(insert diagram here)</p>
  24. <p>There is a class for each element in the FO set. An object is created for
  25. each element in the FO Tree. This object holds the properties for the FO
  26. Object.</p>
  27. <p>
  28. When the object is created it is setup. It is given its
  29. element name, the FOUserAgent - for resolving properties
  30. etc. - the logger and the attributes. The methods
  31. <code>handleAttributes()</code> and
  32. <code>setuserAgent()</code>, common to <code>FONode</code>,
  33. are used in this process. The object will then be given any
  34. text data or child elements. Then the <code>end()</code>
  35. method is called. The end method is used by a number of
  36. elements to indicate that it can do certain processing since
  37. all the children have been added.
  38. </p>
  39. <p>Some validity checking is done during these steps. The user can be warned of the error and processing can continue if possible.
  40. </p>
  41. <p>
  42. The FO Tree is simply a heirarchy of java objects that
  43. represent the fo elements from xml. The traversal is done by
  44. the layout or structure process only in the flow elements.
  45. </p>
  46. <s2 title="Properties">
  47. <p>The XML attributes on each element are passed to the object. The objects
  48. that represent FO objects then convert the attributes into properties.
  49. </p>
  50. <p>Since properties can be inherited the PropertyList class handles resolving
  51. properties for a particular element.
  52. All properties are specified in an XML file. Classes are created
  53. automatically during the build process.
  54. </p>
  55. <p>(insert diagram here)</p>
  56. <p>In some cases the element may be moved to have a different parent, for
  57. example markers, or the inheritance could be different, for example
  58. initial property set.</p></s2>
  59. <s2 title="Foreign XML">
  60. <p>The base class for foreign XML is XMLObj. This class handles creating a
  61. DOM Element and the setting of attributes. It also can create a DOM
  62. Document if it is a top level element, class XMLElement.
  63. This class must be extended for the namespace of the XML elements. For
  64. unknown namespaces the class is UnknowXMLObj.</p>
  65. <p>(insert diagram here)</p>
  66. <p>If some special processing is needed then the top level element can extend
  67. the XMLObj. For example the SVGElement makes the special DOM required for
  68. batik and gets the size of the svg.
  69. </p>
  70. <p>Foreign XML will usually be in an fo:instream-foreign-object, the XML will
  71. be passed to the render as a DOM where the render will be able to handle
  72. it. Other XML from an unknwon namespace will be ignored.
  73. </p>
  74. <p>By using element mappings it is possible to read other XML and either</p>
  75. <ul><li>set information on the area tree</li>
  76. <li>create pseudo FO Objects that create areas in the area tree</li>
  77. <li>create FO Objects</li></ul>
  78. </s2>
  79. <s2 title="Unknown Elements">
  80. <p>If an element is in a known namespace but the element is unknown then an
  81. Unknown object is created. This is mainly to provide information to the
  82. user.
  83. This could happen if the fo document contains an element from a different
  84. version or the element is misspelt.</p>
  85. </s2>
  86. <s2 title="Page Masters">
  87. <p>
  88. The first elements in a document are the elements for the
  89. page master setup. This is usually only a small number and
  90. will be used throughout the document to create new pages.
  91. These elements are kept as a factory to create the page and
  92. appropriate regions whenever a new page is requested by the
  93. layout. The objects in the FO Tree that represent these
  94. elements are themselves the factory. The root element keeps
  95. these objects as a factory for the page sequences.
  96. </p>
  97. </s2>
  98. <s2 title="Flow">
  99. <p>The elements that are in the flow of the document are a set of elements
  100. that is needed for the layout process. Each element is important in the
  101. creation of areas.</p>
  102. </s2>
  103. <s2 title="Other Elements">
  104. <p>
  105. The remaining FO Objects are things like page-sequence,
  106. title and color-profile. These are handled by their parent
  107. element; i.e. the root looks after the declarations and the
  108. declarations maintains a list of colour profiles. The
  109. page-sequences are direct descendents of root.
  110. </p>
  111. </s2>
  112. <s2 title="Associated Tasks">
  113. <ul><li>Create diagrams</li>
  114. <li>Setup all properties and elements for XSL:FO</li>
  115. <li>Setup user agent for property resolution</li>
  116. <li>Verify all XML is handled appropriately</li></ul></s2></s1></body></document>