I'm trying to embed a stylesheet into an SVG document but the sample
code isn't working for me:

http://xmlgraphics.apache.org/batik/using/svg-generator.html#Customizing+the+generated+SVG+style

If I do this:

  org.w3c.dom.Document svgDoc =
      GenericDOMImplementation.getDOMImplementation()
      .createDocument("http://www.w3.org/2000/svg";, "svg", null);
  System.out.println("el: " + svgDoc.getDocumentElement());
  System.out.println("ns: " + svgDoc.getDocumentElement().getNamespaceURI());
  System.out.println("name: " + svgDoc.getDocumentElement().getNodeName());
  SVGSVGElement s = (SVGSVGElement)svgDoc.getDocumentElement();

I get the following output:

  el: org.apache.batik.dom.genericelemen...@1ac88440
  ns: http://www.w3.org/2000/svg
  name: svg
  Exception in thread "main" java.lang.ClassCastException: 
org.apache.batik.dom.GenericElementNS cannot be cast to 
org.w3c.dom.svg.SVGSVGElement
    at ReportRenderer.main(ReportRenderer.java:120)

Is there an obvious reason why this cast is failing?

Fri Jun 4 23:09:25 PDT 2010

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org

Reply via email to