GraphViz::XML(3pm)

GraphViz::XML3pm

Visualise xml as a tree

Usage

  use GraphViz::XML;
  my $graph = GraphViz::XML->new($xml);
  print $g->as_png;

Overview

This module makes it easy to visualise XML as a tree. XML is hard for humans to grasp, especially if the XML is computer-generated. This modules aims to visualise the XML as a graph in order to make the structure of the XML clear and to aid in understanding the XML.

XML elements are represented as diamond nodes, with links to elements within them. Character data is represented in round nodes.

Note that the XML::Twig module should be installed.

Methods

new

This is the constructor. It takes one mandatory argument, which is the XML to be visualised. A GraphViz object is returned.

  my $graph = GraphViz::XML->new($xml);

as_*

The XML can be visualised in a number of different graphical formats. Methods include as_ps, as_hpgl, as_pcl, as_mif, as_pic, as_gd, as_gd2, as_gif, as_jpeg, as_png, as_wbmp, as_ismap, as_imap, as_vrml, as_vtx, as_mp, as_fig, as_svg. See the GraphViz documentation for more information. The two most common methods are:

  # Print out a PNG-format file
  print $g->as_png;
  # Print out a PostScript-format file
  print $g->as_ps;

Releases

12 releases since Debian 3.1 (Sarge); the text changed 7 times.

  1. 3.1–4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9–10
  7. 11–13
  8. Arch

Bugs

GraphViz tends to reorder the nodes. I hope to find a work around soon (possibly with ports).

Author

Leon Brocard <[email protected]>

From perl-graphviz 2.26-4 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.