]> source.dussan.org Git - xmlgraphics-fop.git/commit
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written...
authorJeremias Maerki <jeremias@apache.org>
Tue, 17 Jan 2006 11:07:10 +0000 (11:07 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 17 Jan 2006 11:07:10 +0000 (11:07 +0000)
commitc7d04323247a0d75f773c6fbe00cc1d68844a2e5
tree7f1a575839a1e3fa35417ee97652350e0ff3bd4e
parentf56c315df5921953702f6ab9c2a331ff7c0caa0f
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes.

The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser.

The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient.

XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though.

ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null.

The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document.

The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format.

The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected.

Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation.

Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser.

Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
42 files changed:
build.xml
examples/embedding/java/embedding/intermediate/ExampleConcat.java [new file with mode: 0644]
examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java
examples/plan/src/org/apache/fop/plan/PlanElementMapping.java
src/java/org/apache/fop/area/AreaTreeParser.java [new file with mode: 0644]
src/java/org/apache/fop/area/BeforeFloat.java
src/java/org/apache/fop/area/Block.java
src/java/org/apache/fop/area/BlockParent.java
src/java/org/apache/fop/area/Footnote.java
src/java/org/apache/fop/area/LineArea.java
src/java/org/apache/fop/area/Page.java
src/java/org/apache/fop/area/PageViewport.java
src/java/org/apache/fop/area/RegionReference.java
src/java/org/apache/fop/area/RenderPagesModel.java
src/java/org/apache/fop/area/Trait.java
src/java/org/apache/fop/area/inline/ForeignObject.java
src/java/org/apache/fop/area/inline/InlineArea.java
src/java/org/apache/fop/area/inline/InlineParent.java
src/java/org/apache/fop/area/inline/Leader.java
src/java/org/apache/fop/area/inline/Viewport.java
src/java/org/apache/fop/fo/ElementMapping.java
src/java/org/apache/fop/fo/ElementMappingRegistry.java [new file with mode: 0644]
src/java/org/apache/fop/fo/FOTreeBuilder.java
src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java
src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java
src/java/org/apache/fop/fonts/LazyFont.java
src/java/org/apache/fop/render/XMLHandlerRegistry.java
src/java/org/apache/fop/render/xml/XMLRenderer.java
src/java/org/apache/fop/traits/BorderProps.java
src/java/org/apache/fop/util/DefaultErrorListener.java [new file with mode: 0644]
status.xml
test/java/org/apache/fop/UtilityCodeTestSuite.java
test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java [new file with mode: 0644]
test/java/org/apache/fop/intermediate/IntermediateFormatTestSuite.java [new file with mode: 0644]
test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java
test/java/org/apache/fop/traits/BorderPropsTestCase.java [new file with mode: 0644]
test/java/org/apache/fop/traits/TraitColorTestCase.java [new file with mode: 0644]
test/layoutengine/standard-testcases/external-graphic_border_padding.xml
test/layoutengine/standard-testcases/external-graphic_display-align.xml
test/layoutengine/standard-testcases/external-graphic_svg.xml
test/layoutengine/standard-testcases/instream-foreign-object_border_padding.xml
test/layoutengine/standard-testcases/instream-foreign-object_display-align.xml