For an assignment we have been told, for additional functionality output a graph, possible using GraphViz. That is all the info we have been given.
The assignment is perl outputting XML. I am pretty sure that I can ouput the code, I just need to know how to process it from there.
I have done some research i have been trying to test some simple code.
for DOTML I found this simple example from http://www.martin-loetzsch.de/DOTML/
<graph file-name="graphs/nice_graph" rankdir="LR">
<node id="a" label="node1" fontsize="9" fontname="Arial"/>
<node id="b" label="node2" fontsize="9" fontname="Arial"/>
<node id="c" label="node3" fontsize="9" fontname="Arial"/>
<node id="d" label="node4" fontsize="9" fontname="Arial"/>
<edge from="a" to="b" fontname="Arial" fontsize="9" label="edge1"/>
<edge from="a" to="c" fontname="Arial" fontsize="9" label="edge2"/>
<edge from="b" to="c" fontname="Arial" fontsize="9" label="edge3"/>
<edge from="b" to="d" fontname="Arial" fontsize="9" label="edge4"/>
<edge from="c" to="d" fontname="Arial" fontsize="9" label="edge5"/>
</graph>
I tried to run it from the command line with this
dot -Tps graph1.dot -o graph1.ps
and
dot -Tps graph1.dot -o graph
which throws this error
Error: graph_test.dotml:1: syntax error near line 1
context: <graph file-name="graph" >>> rankdir="LR"> <<<
I have also tried the same for a graphml file, here is the head of the file
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<graph id="G" edgedefault="undirected">
which basically throws the same error
Error: simple.graphml:1: syntax error near line 1
context: <?xml version="1.0" >>> encoding="UTF-8"?> <<
If anyone could at least direct me where to get some good, basic instructions on how to implement it would be good. Cheers
EDIT: we are only able to use default CPAN modules