File: xml.pl

package info (click to toggle)
libgraphviz-perl 2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 960 kB
  • sloc: perl: 2,056; makefile: 2
file content (18 lines) | stat: -rwxr-xr-x 386 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl -w
#
# A example which represents some XML as a tree

use strict;
use lib '../lib';
use GraphViz::XML;

my $xml = '<html><head><title>news</title></head><body>
<p>Check out the <a href="/news/">latest news</a>.</p>
<p>Under construction!!!</p></body></html>';

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

$graph->as_png("xml.png");
#print $g->as_text;
#print $g->_as_debug;