Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-943

ClassCastException using org.apache.batik.swing.JSVGCanvas.setDocument

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Incomplete
    • Affects Version/s: 1.7
    • Fix Version/s: None
    • Component/s: SVG DOM
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC

      Description

      If the document is set to one with a different implementation, an exception is thrown, for example:
      Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(FILENAME);
      JSVGCanvas canvas = new JSVGCanvas();
      canvas.setDocument(d);
      Gives an exception:
      Exception in thread "main" java.lang.ClassCastException: org.apache.batik.dom.GenericElement cannot be cast to org.w3c.dom.svg.SVGSVGElement
      Example project attached.

        Attachments

        1. JavaApplication34.zip
          12 kB
          Peter Hull

          Activity

            People

            • Assignee:
              batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
              Reporter:
              peterhull90@gmail.com Peter Hull
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: