keiron 01/10/05 03:29:48
Modified: src/org/apache/fop/svg SVGElement.java
SVGElementMapping.java
Log:
fixed a couple of occasional problems with svg + batik
Revision Changes Path
1.15 +7 -1 xml-fop/src/org/apache/fop/svg/SVGElement.java
Index: SVGElement.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/SVGElement.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- SVGElement.java 2001/09/26 12:00:43 1.14
+++ SVGElement.java 2001/10/05 10:29:48 1.15
@@ -1,5 +1,5 @@
/*
- * $Id: SVGElement.java,v 1.14 2001/09/26 12:00:43 keiron Exp $
+ * $Id: SVGElement.java,v 1.15 2001/10/05 10:29:48 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -17,6 +17,7 @@
import org.apache.fop.configuration.Configuration;
import org.apache.batik.dom.svg.*;
+import org.apache.batik.dom.util.XMLSupport;
import org.w3c.dom.*;
import org.w3c.dom.svg.*;
import org.w3c.dom.svg.SVGLength;
@@ -146,6 +147,11 @@
}
Element e = ((SVGDocument)doc).getRootElement();
+
+ //if(!e.hasAttributeNS(XMLSupport.XMLNS_NAMESPACE_URI, "xmlns")) {
+ e.setAttributeNS(XMLSupport.XMLNS_NAMESPACE_URI, "xmlns",
SVGDOMImplementation.SVG_NAMESPACE_URI);
+ //}
+
String s;
SVGUserAgent userAgent = new SVGUserAgent(new AffineTransform());
userAgent.setLogger(log);
1.17 +9 -1 xml-fop/src/org/apache/fop/svg/SVGElementMapping.java
Index: SVGElementMapping.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/SVGElementMapping.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- SVGElementMapping.java 2001/09/24 09:17:12 1.16
+++ SVGElementMapping.java 2001/10/05 10:29:48 1.17
@@ -1,5 +1,5 @@
/*
- * $Id: SVGElementMapping.java,v 1.16 2001/09/24 09:17:12 keiron Exp $
+ * $Id: SVGElementMapping.java,v 1.17 2001/10/05 10:29:48 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -14,7 +14,10 @@
import org.apache.fop.fo.TreeBuilder;
import org.apache.fop.fo.FOTreeBuilder;
import org.apache.fop.fo.ElementMapping;
+import org.apache.fop.apps.Driver;
+import org.apache.batik.util.XMLResourceDescriptor;
+
public class SVGElementMapping implements ElementMapping {
private static HashMap foObjs = null;
@@ -22,6 +25,11 @@
public synchronized void addToBuilder(TreeBuilder builder) {
if(foObjs == null) {
+ // this sets the parser that will be used
+ // by default (SVGBrokenLinkProvider)
+ // normally the user agent value is used
+
XMLResourceDescriptor.setXMLParserClassName(Driver.getParserClassName());
+
foObjs = new HashMap();
foObjs.put("svg", SVGElement.maker());
foObjs.put("rect", SVGObj.maker("rect"));
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]