aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/render/xml
diff options
context:
space:
mode:
authorarved <arved@unknown>2000-12-18 04:07:47 +0000
committerarved <arved@unknown>2000-12-18 04:07:47 +0000
commit4a6ecf1f795b0a10437543f65155655d2790acb9 (patch)
tree9f9761614a5426b249e52be36a394eb096b6da9a /src/org/apache/fop/render/xml
parentfcc4bef8d45118da37da4b1808bb9f3290340d5b (diff)
downloadxmlgraphics-fop-4a6ecf1f795b0a10437543f65155655d2790acb9.tar.gz
xmlgraphics-fop-4a6ecf1f795b0a10437543f65155655d2790acb9.zip
Support for rendering complex body regions
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193902 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/render/xml')
-rw-r--r--src/org/apache/fop/render/xml/XMLRenderer.java40
1 files changed, 35 insertions, 5 deletions
diff --git a/src/org/apache/fop/render/xml/XMLRenderer.java b/src/org/apache/fop/render/xml/XMLRenderer.java
index 6330db0fc..9b17daad5 100644
--- a/src/org/apache/fop/render/xml/XMLRenderer.java
+++ b/src/org/apache/fop/render/xml/XMLRenderer.java
@@ -64,7 +64,6 @@ import org.apache.fop.fo.properties.LeaderPattern;
// Java
import java.io.IOException;
import java.io.PrintWriter;
-import java.io.OutputStream;
import java.util.Enumeration;
/**
@@ -96,10 +95,10 @@ public class XMLRenderer implements Renderer {
* @param areaTree the laid-out area tree
* @param writer the PrintWriter to give the XML to
*/
- public void render(AreaTree areaTree, OutputStream stream)
+ public void render(AreaTree areaTree, PrintWriter writer)
throws IOException {
MessageHandler.logln("rendering areas to XML");
- this.writer = new PrintWriter(stream);
+ this.writer = writer;
this.writer.write("<?xml version=\"1.0\"?>\n<!-- produced by "
+ this.producer + " -->\n");
writeStartTag("<AreaTree>");
@@ -192,6 +191,36 @@ public class XMLRenderer implements Renderer {
}
/**
+ * render a body area container to XML
+ *
+ * @param area the body area container to render
+ */
+ public void renderBodyAreaContainer(BodyAreaContainer area) {
+ writeStartTag("<BodyAreaContainer>");
+ Enumeration e = area.getChildren().elements();
+ while (e.hasMoreElements()) {
+ Box b = (Box) e.nextElement();
+ b.render(this);
+ }
+ writeEndTag("</BodyAreaContainer>");
+ }
+
+ /**
+ * render a span area to XML
+ *
+ * @param area the span area to render
+ */
+ public void renderSpanArea(SpanArea area) {
+ writeStartTag("<SpanArea>");
+ Enumeration e = area.getChildren().elements();
+ while (e.hasMoreElements()) {
+ Box b = (Box) e.nextElement();
+ b.render(this);
+ }
+ writeEndTag("</SpanArea>");
+ }
+
+ /**
* render a block area to XML
*
* @param area the block area to render
@@ -303,7 +332,8 @@ public class XMLRenderer implements Renderer {
* @param page the page to render
*/
public void renderPage(Page page) {
- AreaContainer body, before, after;
+ BodyAreaContainer body;
+ AreaContainer before, after;
writeStartTag("<Page>");
body = page.getBody();
before = page.getBefore();
@@ -311,7 +341,7 @@ public class XMLRenderer implements Renderer {
if (before != null) {
renderAreaContainer(before);
}
- renderAreaContainer(body);
+ renderBodyAreaContainer(body);
if (after != null) {
renderAreaContainer(after);
}