Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: RPC connection to eXist XML O.K how to print results to file

by spencerr1 (Novice)
on May 04, 2013 at 19:54 UTC ( #1032078=note: print w/ replies, xml ) Need Help??


in reply to Re: RPC connection to eXist XML O.K how to print results to file
in thread RPC connection to eXist XML O.K how to print results to file

Sorry about that I do have my challenges with printing to file. Sorry again

#!/usr/bin/perl use RPC::XML; use RPC::XML::Client; # print "Please specify a document path as first argument"; # chomp($doc = <STDIN>); chomp($doc = "/db/Shakespeare/hamlet.xml"); 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"; } $file = "C:/Results.xml"; open (XMLFILE, ">$file") || die "Can't open file: $!\n"; print XMLFILE $resp->value ."\n"; #print $resp->value . "\n"; close XMLFILE;


Comment on Re^2: RPC connection to eXist XML O.K how to print results to file
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1032078]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2015-07-29 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls