Fix editionStmt metadata parsing
Change-Id: I8a3fc86961c64661463ddb9ba9523097944f8200
diff --git a/lib/KorAP/XML/Meta/I5.pm b/lib/KorAP/XML/Meta/I5.pm
index e887279..48565ae 100644
--- a/lib/KorAP/XML/Meta/I5.pm
+++ b/lib/KorAP/XML/Meta/I5.pm
@@ -321,14 +321,14 @@
$self->{A_bibl_edition_statement} = $temp if $temp;
};
- if ($temp = $dom->at('fileDescl editionStmt')) {
- $temp = _squish $temp->all_text;
- $self->{A_file_edition_statement} = $temp if $temp;
- };
-
if ($temp = $dom->at('fileDesc')) {
my $temp2;
+ if (my $editionStmt = $temp->at('editionStmt')) {
+ $temp2 = _squish $editionStmt->all_text;
+ $self->{A_file_edition_statement} = $temp2 if $temp2;
+ };
+
if (my $availability = $temp->at('publicationStmt > availability')) {
$temp2 = _squish $availability->all_text;
$self->{S_availability} = $temp2 if $temp2;
@@ -407,3 +407,4 @@
1;
+
diff --git a/t/real/hnc.t b/t/real/hnc.t
index 88578db..9aca507 100644
--- a/t/real/hnc.t
+++ b/t/real/hnc.t
@@ -52,7 +52,7 @@
is($meta->{D_creation_date}, '20130302', 'Creation Date');
ok(!$meta->{pages}, 'Pages');
-ok(!$meta->{A_file_edition_statement}, 'File Ed Statement');
+is($meta->{A_file_edition_statement}, 'Magyar Nemzeti Szövegtár 2. változat - XML formátum', 'File Ed Statement');
ok(!$meta->{A_bibl_edition_statement}, 'Bibl Ed Statement');
ok(!$meta->{A_reference}, 'Reference');
is($meta->{S_language}, 'hu', 'Language');