trouble reading xml file from web server

Help
yuan wang
2013-10-21
2013-10-21
  • yuan wang

    yuan wang - 2013-10-21

    I am new to prefuse so I created a toy project but it seems I always have trouble with reading xml file:

    public class testProfusion {

    public static void main(String[]args){
    
    Graph graph = null;
    
    try {
        graph = new GraphMLReader().readGraph("http://www.w3schools.com/xml/note.xml");
    } catch ( DataIOException e ) {
        e.printStackTrace();
        System.err.println("Error loading graph. Exiting...");
        System.exit(1);
    }
    
    }
    

    }

    node.xml is the url and can be directly accessed. However no matter how I change, I always get error:
    at prefuse.data.io.GraphMLReader.readGraph(Unknown Source)
    at prefuse.data.io.AbstractGraphReader.readGraph(Unknown Source)
    at testProfusion.main(testProfusion.java:13)
    Caused by: java.lang.NullPointerException
    at prefuse.data.io.GraphMLReader$GraphMLHandler.endDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:737)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:516)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
    ... 3 more
    Error loading graph. Exiting...

    Please help me;-)!!!

     
  • Björn Kruse

    Björn Kruse - 2013-10-21

    Hi,
    I'm not sure if that noTe XML file you use fits the GraphML format (regarding noDes) that is expected by prefuse GraphMLReader.
    Have you tried one of the example files that come with pre fuse (I believe in "data" folder)?

    Best regards,
    Björn

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks