spencerr1 has asked for the wisdom of the Perl Monks concerning the following question:
I have connected to an eXist XML database and find a xml file and print the contents of the file to the consol is there a way to print the contents to a file instead.
#!/usr/bin/perl use RPC::XML; use RPC::XML::Client; print "Please specify a document path as first argument"; chomp($doc = <STDIN>); if(!$doc) { die "Please specify a document path as first argument!\n"; } $URL = "http://admin:spencerr\@localhost:8080/exist/xmlrpc"; print "connecting to $URL...\n"; $client = new RPC::XML::Client $URL; # Output options $options = RPC::XML::struct->new( 'indent' => 'yes', 'encoding' => 'UTF-8'); $req = RPC::XML::request->new("getDocument", $doc, $options); $resp = $client->send_request($req); if($resp->is_fault) { die "An error occurred: " . $resp->string . "\n"; } print $resp->value . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RPC connection to eXist XML O.K how to print results to file (print to file)
by Anonymous Monk on May 04, 2013 at 18:25 UTC | |
|
Re: RPC connection to eXist XML O.K how to print results to file
by ww (Archbishop) on May 04, 2013 at 19:21 UTC | |
by spencerr1 (Novice) on May 04, 2013 at 19:54 UTC |