From d986c1d60ffe91e6fdbb722936e066d8069d7cd4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 6 Jun 2015 12:29:54 +0200 Subject: EFA: Add identified_data method --- lib/Travel/Status/DE/EFA.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib') diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm index c134698..00338b7 100644 --- a/lib/Travel/Status/DE/EFA.pm +++ b/lib/Travel/Status/DE/EFA.pm @@ -247,6 +247,20 @@ sub check_for_ambiguous { return; } +sub identified_data { + my ($self) = @_; + + my $xp_place + = XML::LibXML::XPathExpression->new('//itdOdv/itdOdvPlace/odvPlaceElem'); + my $xp_name + = XML::LibXML::XPathExpression->new('//itdOdv/itdOdvName/odvNameElem'); + + my $e_place = ( $self->{tree}->findnodes($xp_place) )[0]; + my $e_name = ( $self->{tree}->findnodes($xp_name) )[0]; + + return ( $e_place->textContent, $e_name->textContent ); +} + sub lines { my ($self) = @_; my @lines; -- cgit v1.2.3