shift->{file};
}
+=method file_version
+
+ $version = $homebank->file_version;
+
+Get the file format version.
+
+=cut
+
+sub file_version {
+ shift->{homebank}{version};
+}
+
=method title
$title = $homebank->title;
$account = $homebank->find_account_by_key($key);
-Find a account with the given key.
+Find an account with the given key.
=cut
sub parse_string {
my $str = shift or die _usage(q{parse_string($str)});
+ my %homebank;
my %properties;
my @accounts;
my @payees;
$attr{$key} = _decode_xml_entities($attr{$key});
}
- if ($node eq 'properties') {
+ if ($node eq 'homebank') {
+ $attr{version} = delete $attr{v} if $attr{v};
+ %homebank = %attr;
+ }
+ elsif ($node eq 'properties') {
$attr{currency} = delete $attr{curr} if $attr{curr};
%properties = %attr;
}
$xml_parser->parse($str);
return {
+ homebank => \%homebank,
properties => \%properties,
accounts => \@accounts,
payees => \@payees,