Graph::Reader::XML(3pm)

Graph::Reader::XML3pm

Class for reading a graph instance from xml

Usage

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

Overview

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.

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.

Known bugs

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

Repository

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

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 5 times.

  1. 6.0
  2. 7
  3. 8
  4. 9–10
  5. 11
  6. 12–13

Author

Neil Bowers <[email protected]>

From libgraph-readwrite-perl 2.10-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.