vinothjaguva has asked for the wisdom of the Perl Monks concerning the following question:

This is my script to get the filemaker xml

use LWP::UserAgent; use Net::FileMaker; use Net::FileMaker::XML; use Net::FileMaker::XML::Database; $host = "localhost"; $user = ""; $pass = ""; $db = "test.fp7"; my $fm = Net::FileMaker::XML->new(host => $host, type=> 'xml'); my $db = $fm->database(db => $db, user => $user, pass => $pass); my $layouts = $db->layoutnames; my $scripts = $db->scriptnames; my $records = $db->findall( layout => $layout, params => { '-max' +=> '10'}); my $records = $db->findany( layout => $layout, params => { '-skip' + => '10'

But i am getting the error while running this

syntax error at line 1, column 49, byte 49 at C:/Perl/site/lib/XML/Parser.pm lin e 187 at C:/Perl/site/lib/Net/FileMaker/XML.pm line 163

Thanks in Advance

Replies are listed 'Best First'.
Re: Net filemaker issue
by Anonymous Monk on Oct 12, 2011 at 10:34 UTC

    That seems to indicate that what you're getting from the server is not valid xml

    Try adding one of these for more output
    $fm->{ua}->add_handler("request_send", sub { shift->dump; return }); $fm->{ua}->add_handler("response_done", sub { shift->dump; return });

    $fm->{ua}->add_handler("request_send", \&pp_dump ); $fm->{ua}->add_handler("response_done", \&pp_dump ); sub pp { use XML::Twig; open my($fh), '>', \my $str; no warnings 'newline'; XML::Twig->new(qw! pretty_print record !)->xparse(@_)->print( $fh +); return $str; } sub pp_dump { my $content = $_[0]->content(''); $_[0]->content( pp($content) ); print $_[0]->as_string,"\n"; return; }