Class XMLGraph

  • All Implemented Interfaces:
    ContentHandler, DTDHandler, EntityResolver, ErrorHandler
    Direct Known Subclasses:
    EmbeddedXMLGraph

    public class XMLGraph
    extends DefaultHandler
    The XMLGraph class provides a simple XML interface into the Graph library. At it's simplest, it can be used as follows to parse an InputStream containing XML and convert that to a PNG image written to an OutputStream
     XMLGraph parser = new XMLGraph();
     parser.parse(new InputSource(inputstream));
     Graph graph = parser.getGraph();
     ImageOutput out = new ImageOutput(parser.getWidth(), parser.getHeight());
     graph.draw(out);
     out.writePNG(outputstream, 256);
     
    Alternatively, as this class implements ContentHandler users may extend the class as necessary or use it as the end stage of an XSL transformation.