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 {
-[% INCLUDE 'includes/header.inc' %]
+[%# INCLUDE 'includes/header.inc' %]
<NCIPMessage>
<[% messagetype %]>
<ResponseHeader>
<FromAgencyId>
- <AgencyId>[% fromagency %]</AgencyId>
+ <AgencyId>[% fromagency | trim%]</AgencyId>
</FromAgencyId>
<ToAgencyId>
- <AgencyId>[% toagency %]</AgencyId>
+ <AgencyId>[% toagency | trim %]</AgencyId>
</ToAgencyId>
</ResponseHeader>
[% myfile = "includes/$messagetype" _ ".inc" %]