Hi,

    I am getting this error while compiling my code:

CreateSpatial.java:17: cannot resolve symbol
symbol  : class SVGLocatable
location: package svg
import org.apache.batik.dom.svg.SVGLocatable;

Can anyone tell me what might be the problem?  Below is my code

Thanks,
Riyaz

My code is:

import java.io.*;
import java.sql.*;
import java.text.*;
import java.util.*;
import java.awt.*;

import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.net.URLDecoder;

import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.*;

import org.apache.batik.dom.svg.*;
import org.apache.batik.dom.svg.SVGLocatable;
import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
import org.apache.batik.util.XMLResourceDescriptor;

public class CreateSpatial{
                 
     public static void main(String [] args) throws Exception  {
        try
       {        
        BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
                                             
        System.out.println("Enter name of the file: ");
        String inpData = buff.readLine();
                                       
        String uri = "/home/groups/smarttools/web/java/images/" + inpData;
               
                  String parser = XMLResourceDescriptor.getXMLParserClassName();
        SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
                  Document doc = f.createDocument(uri);
         
        Element junk = doc.getElementById("junk");
                  NodeList svgNodes = junk.getChildNodes();
        for (int i=0; i<svgNodes.getLength(); i++) {
                          Element subElemNode = (Element)svgNodes.item(i);// Get element
                          if (subElemNode instanceof SVGLocatable) {
                            SVGRect bb = ((SVGLocatable)subElemNode).getBBox();
                            }        
              }                                                                    
      }
      catch(Exception e)
      {
         System.out.println(e);
      }
  }
}

Reply via email to