logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Graph::Reader::XML - class for reading a Graph instance from XML

Author

       Neil Bowers <neil@bowers.com>

Description

Graph::Reader::XML is a perl class used to read a directed graph stored as XML, and return an instance of
       the Graph class.

       The XML format is designed to support the Graph classes: it can be used to represent a single graph with
       a collection of nodes, and edges between those nodes.  The graph, nodes, and edges can all have
       attributes specified,

       Graph::Reader::XML is a subclass of Graph::Reader, which defines the generic interface for Graph reader
       classes.

Known Bugs

       Attribute values must be scalar. If they're not, well, you're on your own.

Methods

new()
       Constructor - generate a new reader instance.

         $reader = Graph::Reader::XML->new();

       This doesn't take any arguments.

   read_graph()
       Read a graph from a file:

         $graph = $reader->read_graph( $file );

       The $file argument can be either a filename or a filehandle of a previously opened file.

Name

       Graph::Reader::XML - class for reading a Graph instance from XML

Repository

       <https://github.com/neilb/Graph-ReadWrite>

See Also

       Graph::Reader
           The base class for Graph::Reader::XML.

       Graph::Writer::XML
           Used to serialise a Graph instance as XML.

       Graph
           Jarkko Hietaniemi's classes for representing directed graphs.

Synopsis

         use Graph::Reader::XML;
         use Graph;

         $reader = Graph::Reader::XML->new();
         $graph = $reader->read_graph('mygraph.xml');

See Also