save the name of the text too
Tara L Andrews [Tue, 4 Oct 2011 00:46:21 +0000 (02:46 +0200)]
lib/Text/Tradition/Parser/GraphML.pm
lib/Text/Tradition/Parser/Self.pm

index 3ecd936..9fe2911 100644 (file)
@@ -79,6 +79,7 @@ sub graphml_parse {
     }
 
     my $graph_el = $xpc->find( '/g:graphml/g:graph' )->[0];
+    $graph_hash->{'name'} = $graph_el->getAttribute( 'id' );
 
     my $node_reg = {};
     
index 95ec304..895ca4d 100644 (file)
@@ -132,6 +132,7 @@ sub parse {
     # Set up the graph-global attributes.  They will appear in the
     # hash under their accessor names.
     print STDERR "Setting graph globals\n";
+    $tradition->name( $graph_data->{'name'} );
     foreach my $gkey ( keys %{$graph_data->{'attr'}} ) {
                my $val = $graph_data->{'attr'}->{$gkey};
                $collation->$gkey( $val );