xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent L Johnson" <br...@bjohnson.net>
Subject DOMImplementation
Date Sun, 29 Jul 2001 23:39:19 GMT
I'm currently using Xerces as my XML parser (version 1.4.1 I think).  I'm
simply trying to get the DOMImplementation setup (without getting an error
message).  I keep getting a createDocument() error (I've seen another post
to this list about the error).

It was suggested that the person was using DOM1 instead of DOM2.  I know
Xerces is a DOM2 parser so it should work fine with Batik right?  Here is
the error message and code from a JSP page - I'm interested in creating some
bar and pie charts for reports using Batik (after reading some of the docs
and info it looks like it would be fairly simple to do this with Batik).
Also, from the things I've read, I'm assuming that it's possible to output
the SVG file in JPEG format to the browser using the transcoder?

------------------ ERROR ------------------

/home/www/jakarta/tomcat/work/localhost_8080/_0002fbatik_0002ftest_0002finde
x_0002ejspindex_jsp_1.java:83: Method createDocument(java.lang.String,
java.lang.String, null) not found in interface
org.w3c.dom.DOMImplementation.
Document doc = impl.createDocument(svgNS, "svg", null);

------------------ CODE ------------------
<%@ page import="org.w3c.dom.DOMImplementation" %>
<%@ page import="org.apache.batik.dom.svg.SVGDOMImplementation" %>
<%@ page import="org.apache.batik.svggen.SVGGraphics2D" %>
<%@ page import="org.w3c.dom.Document" %>
<%@ page import="java.awt.Dimension" %>
<html>
<head>
<title>test title</title>
</head>
<%
DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
// we are using a constant available on the SVGDOMImplementation
// but we could have used "http://www.w3.org/2000/svg"
String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
Document doc = impl.createDocument(svgNS, "svg", null);
%>
<body>
</body>
</html>

------------------ CLASSPATH ------------------
CLASSPATH=$CLASSPATH:/home/www/batik/lib/batik-dom.jar:/home/www/batik/lib/b
atik-svg-dom.jar:/home/www/batik/
lib/batik-svggen.jar:/home/www/batik/lib/batik-css.jar:/home/www/batik/batik
.jar:/home/www/batik/batik-raster
izer.jar

I also noticed this error message:
Class org.w3c.dom.css.DOMImplementationCSS not found in class
org.apache.batik.dom.svg.SVGDOMImplementation.

>From what I understand Xerces does not support CSS?  Is there a way around
that?  I also tried taking out the reference to Xerces in my CLASSPATH and
tried the crimson-parser.jar implementation and that did not work.

Also, when I looking into batik-ext.jar I saw there was an org.w3c.dom.*
implementation there - which also gives me the same createDocument() error.

Any help would be greatly appreciated,

- Brent


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message