[Xml-compile] Beginner's question: Using XML::eXistDB::RPC
with XQuery
Mark Overmeer
mark at overmeer.net
Thu Jun 17 10:39:36 GMT 2010
* Mirco Hilbert (Mirco.Hilbert at germanistik.uni-giessen.de) [100617 10:08]:
> I started testing your Perl module XML::eXistDB sending XQuery
> requests to an eXist database on my local host.
> The first message I run into is the following warning (but, apparently,
> I can ignore it):
>> Prototype mismatch: sub XML::Compile::RPC::Client::trace (@) vs () at /usr/local/share/perl/5.10.0/XML/Compile/RPC/Client.pm line 54.
>> Subroutine trace redefined at /usr/local/share/perl/5.10.0/XML/Compile/RPC/Client.pm line 54.
Hum... there was still a version XML::Compile::RPC 0.15 waiting in the
queue to be released (Just did it) It is caused by a change in Log::Report.
Change in XML::Compile::RPC::Client
+ use Log::Report 'xml-compile-rpc';
+ use Log::Report 'xml-compile-rpc', syntax => 'LONG';
It is a warning.
> The result I get here in @data is a nested hash structure.
> But I wonder if there is a possibility to get the result as an
> XML::LibXML::Document or XML::LibXML::Element object?
My idea behind the module is to connect pure Perl space with ExistDB.
I strongly prefer to use my ($rc, $info) = $db->describeUser($user);
than to manually construct XML nodes first. And when the call parameters
are plain Perl, the returned data should be that as well...
> Is there such a possibility which I maybe have overlooked reading the
> documentation? Maybe using the FORMAT parameter of retrieveResults?
The FORMAT is part of the query: how eXist must produce the document.
It does not describe how XML::eXistDB should handle it; which is
regulated by parameters to new() or the methods at stake.
Your idea for extension is not too bad... probably, a few selective
methods should be influencable, for instance retrieveResults().
my ($rc, $hash) = $db->retrieveResults($set, decode => 1);
my ($rc, $xml) = $db->retrieveResults($set, decode => 0);
(very unsure on the 'decode' name)
Not hard to implement. Which methods should be configurable to return
XML and how do we use them?
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark at Overmeer.net solutions at overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
More information about the Xml-compile
mailing list