Interpret number as integer
Change-Id: Id069cb73ff7359d18880c6195bd9159a7c7467b6
diff --git a/lib/KorAP/XML/Meta/I5.pm b/lib/KorAP/XML/Meta/I5.pm
index 49841c7..c3a6659 100644
--- a/lib/KorAP/XML/Meta/I5.pm
+++ b/lib/KorAP/XML/Meta/I5.pm
@@ -291,10 +291,9 @@
$key = 'A_';
my $title = $_->att('desc');
$value = $self->korap_data_uri($value, title => ($title // $value));
- } elsif ($xtype eq 'number') {
- $self->log->warn('Number currently not supported as xenodata type, treated as string');
- $key = 'S_';
- # Maybe render as Integer - but it's understood as a string
+ } elsif ($xtype eq 'integer' || $xtype eq 'number') {
+ $self->log->warn('Number is treated as integer');
+ $key = 'I_';
} else {
$self->log->warn('Unknown xenodata type: ' . $xtype);
return;
diff --git a/t/real/corpusexplorer.t b/t/real/corpusexplorer.t
index 021345e..dba6178 100644
--- a/t/real/corpusexplorer.t
+++ b/t/real/corpusexplorer.t
@@ -66,7 +66,7 @@
ok(!$meta->{T_doc_author}, 'Correct Doc author');
ok(!$meta->{A_doc_editor}, 'Correct doc editor');
-is($meta->{S_Jahr},'2003', 'XenoData');
+is($meta->{I_Jahr},'2003', 'XenoData');
is($meta->{T_Person},'Johannes Rau', 'XenoData');
is($meta->{T_GUID},'5d6a6c99-23b5-47eb-902f-f646ef7e24f5', 'XenoData');