aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/image
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-07-20 21:28:50 +0000
committerGlen Mazza <gmazza@apache.org>2004-07-20 21:28:50 +0000
commitc66411ce9e7466c21a0d4821fbdaff9476677f57 (patch)
tree1f1e47c4aed41c997d99e203e4dc9a54ed509018 /src/java/org/apache/fop/image
parent360f509474a210793d4449793d93aa119de6e17e (diff)
downloadxmlgraphics-fop-c66411ce9e7466c21a0d4821fbdaff9476677f57.tar.gz
xmlgraphics-fop-c66411ce9e7466c21a0d4821fbdaff9476677f57.zip
1.) Moved the SAXParser-creating method from FOFileHandler to CommandLineOptions,
the latter being the class directly using it. 2.) Decoupled the SVG classes from apps.FOFileHandler, the SVG classes for some reason want a string containing a name of a SAXParser. We'll need to look in the future for the actual need for this--normally error messages are done by the caller, not the callee. It would appear that Batik can generate a SAXParser name by default, and use that when not explicitly overridden by the caller. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197804 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/image')
-rw-r--r--src/java/org/apache/fop/image/XMLImage.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/java/org/apache/fop/image/XMLImage.java b/src/java/org/apache/fop/image/XMLImage.java
index 5bb96a118..cc71016a8 100644
--- a/src/java/org/apache/fop/image/XMLImage.java
+++ b/src/java/org/apache/fop/image/XMLImage.java
@@ -20,9 +20,7 @@ package org.apache.fop.image;
// Java
import org.w3c.dom.Document;
-
-// FOP
-import org.apache.fop.apps.FOFileHandler;
+import javax.xml.parsers.SAXParserFactory;
/**
* This is an implementation for XML-based images such as SVG.
@@ -48,14 +46,17 @@ public class XMLImage extends AbstractFopImage {
}
/**
- * creates a SAX parser, using the value of org.xml.sax.parser
- * defaulting to org.apache.xerces.parsers.SAXParser
- *
- * @return the created SAX parser
+ * Returns the fully qualified classname of an XML parser for
+ * Batik classes that apparently need it (error messages, perhaps)
+ * @return an XML parser classname
*/
public static String getParserName() {
- String parserClassName = FOFileHandler.getParserClassName();
- return parserClassName;
+ try {
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ return factory.newSAXParser().getXMLReader().getClass().getName();
+ } catch (Exception e) {
+ return null;
+ }
}
/**