xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r830563 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java
Date Wed, 28 Oct 2009 14:42:11 GMT
Author: jeremias
Date: Wed Oct 28 14:42:11 2009
New Revision: 830563

URL: http://svn.apache.org/viewvc?rev=830563&view=rev
Log:
Do explicit prefix mappings for foi and fox prefixes to make AT XML slightly smaller.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java?rev=830563&r1=830562&r2=830563&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java Wed Oct 28 14:42:11
2009
@@ -36,6 +36,7 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
+
 import org.xml.sax.SAXException;
 
 import org.apache.xmlgraphics.util.QName;
@@ -81,6 +82,8 @@
 import org.apache.fop.area.inline.WordArea;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.extensions.ExtensionAttachment;
+import org.apache.fop.fo.extensions.ExtensionElementMapping;
+import org.apache.fop.fo.extensions.InternalElementMapping;
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.FontTriplet;
 import org.apache.fop.render.Renderer;
@@ -148,6 +151,10 @@
         }
     }
 
+    /**
+     * Controls whether to create a more compact format which omit certain attributes.
+     * @param compact true to activate the compact format
+     */
     public void setCompactFormat(boolean compact) {
         this.compactFormat = compact;
     }
@@ -447,14 +454,23 @@
         if (this.getUserAgent().isAccessibilityEnabled()) {
             String structureTreeElement = "structureTree";
             startElement(structureTreeElement);
-            NodeList nodes = getUserAgent().getStructureTree().getPageSequence(pageSequenceIndex++);
-            for (int i = 0, n = nodes.getLength(); i < n; i++) {
-                Node node = nodes.item(i);
-                try {
-                    new DOM2SAX(handler).writeFragment(node);
-                } catch (SAXException e) {
-                    handleSAXException(e);
+            try {
+                this.handler.startPrefixMapping("foi", InternalElementMapping.URI);
+                this.handler.startPrefixMapping("fox", ExtensionElementMapping.URI);
+                NodeList nodes = getUserAgent().getStructureTree().getPageSequence(
+                        pageSequenceIndex++);
+                for (int i = 0, n = nodes.getLength(); i < n; i++) {
+                    Node node = nodes.item(i);
+                    try {
+                        new DOM2SAX(handler).writeFragment(node);
+                    } catch (SAXException e) {
+                        handleSAXException(e);
+                    }
                 }
+                this.handler.endPrefixMapping("fox");
+                this.handler.endPrefixMapping("foi");
+            } catch (SAXException se) {
+                handleSAXException(se);
             }
             endElement(structureTreeElement);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message