#!/usr/bin/perl use CGI; use XML::Simple; use XML::Parser; use LWP::UserAgent; my $input = new CGI; # request my $ua = LWP::UserAgent->new; my $response = $ua->get("https://sisi.num.edu.mn/studentservic +e/service.asmx/give_to_koha_byStudentCard?cardNR=126186D2&ip=10.0.120 +.1"); my $xml=$response->content; # parse my $xs = new XML::Simple(keeproot =>0,searchpath => ".",forcea +rray => 1,); my $ref = $xs->XMLin($xml); my $firstname=${$ref->{firstname}}[0]; my $lastname=${$ref->{lastname}}[0]; my $sisiid=${$ref->{sisiid}}[0]; print "$firstname $lastname $sisiid";
In reply to Re^8: {KOHA}Parse XML and assign to variables.
by scolife
in thread {KOHA}Parse XML and assign to variables.
by scolife
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |