From 3d2a43b678d54eb3c2c579cb9e66d782805b01f4 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 4 Mar 2014 15:45:00 +1300 Subject: [PATCH] Response headers behaving better --- lib/NCIP/Handler.pm | 10 +++++----- templates/response.tt | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/NCIP/Handler.pm b/lib/NCIP/Handler.pm index 2618e79..df25530 100644 --- a/lib/NCIP/Handler.pm +++ b/lib/NCIP/Handler.pm @@ -104,11 +104,11 @@ sub get_agencies { my $root = $xmldoc->documentElement(); - my @from = - $xpc->findnodes( '//ns:InitiationHeader/FromAgencyId/AgencyId', $root ); - my @to = - $xpc->findnodes( '//ns:InitiationHeader/ToAgencyId/AgencyId', $root ); - return ( $from[0]->textContent, $to[0]->textContent ); + my $from = + $xpc->find( '//ns:FromAgencyId', $root ); + my $to = + $xpc->find( '//ns:ToAgencyId', $root ); + return ( $from, $to ); } sub render_output { diff --git a/templates/response.tt b/templates/response.tt index 167ce2e..68519ae 100644 --- a/templates/response.tt +++ b/templates/response.tt @@ -1,13 +1,13 @@ -[% INCLUDE 'includes/header.inc' %] +[%# INCLUDE 'includes/header.inc' %] <[% messagetype %]> - [% fromagency %] + [% fromagency | trim%] - [% toagency %] + [% toagency | trim %] [% myfile = "includes/$messagetype" _ ".inc" %] -- 2.43.2