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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Incomplete
    • 1.7
    • None
    • SVG DOM
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: