X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FText%2FTradition%2FCollation.pm;h=8609c9663c55f1645f1959f1a642b6be16c75189;hb=255875b8b5d34bbb40eb4b101657e4ca0ac256d3;hp=996e7fed8875f9eda5505f672894e7a3b59646fc;hpb=1d3104950074a3d7470f01ef0ec8e9046d95b124;p=scpubgit%2Fstemmatology.git diff --git a/lib/Text/Tradition/Collation.pm b/lib/Text/Tradition/Collation.pm index 996e7fe..8609c96 100644 --- a/lib/Text/Tradition/Collation.pm +++ b/lib/Text/Tradition/Collation.pm @@ -487,7 +487,7 @@ sub as_graphml { my $ndi = 0; my %node_data = ( id => 'string', - reading => 'string', + text => 'string', rank => 'string', is_start => 'boolean', is_end => 'boolean', @@ -547,10 +547,11 @@ sub as_graphml { my $node_xmlid = 'n' . $node_ctr++; $node_hash{ $n->id } = $node_xmlid; $node_el->setAttribute( 'id', $node_xmlid ); - _add_graphml_data( $node_el, $node_data_keys{'id'}, $n->id ); - _add_graphml_data( $node_el, $node_data_keys{'reading'}, $n->text ); - _add_graphml_data( $node_el, $node_data_keys{'rank'}, $n->rank ) - if $n->has_rank; + foreach my $d ( keys %node_data ) { + my $nval = $n->$d; + _add_graphml_data( $node_el, $node_data_keys{$d}, $nval ) + if defined $nval; + } } # Add the path edges