From: Tara L Andrews Date: Tue, 4 Oct 2011 00:46:21 +0000 (+0200) Subject: save the name of the text too X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3196b2a34d403f922af145e2bb1b21356d5c94b;p=scpubgit%2Fstemmatology.git save the name of the text too --- diff --git a/lib/Text/Tradition/Parser/GraphML.pm b/lib/Text/Tradition/Parser/GraphML.pm index 3ecd936..9fe2911 100644 --- a/lib/Text/Tradition/Parser/GraphML.pm +++ b/lib/Text/Tradition/Parser/GraphML.pm @@ -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 = {}; diff --git a/lib/Text/Tradition/Parser/Self.pm b/lib/Text/Tradition/Parser/Self.pm index 95ec304..895ca4d 100644 --- a/lib/Text/Tradition/Parser/Self.pm +++ b/lib/Text/Tradition/Parser/Self.pm @@ -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 );