Net::MarkLogic::XDBC::Result- A sequence of XQUERY values returned from the execution of an XQUERY statement.
use Net::MarkLogic::XDBC::Result my $result = $xdbc->query($xquery); print $result->content; print $result->as_xml; @items = $result->items; print $item->content;
Alpha. API will change.
The XDBC server returns results as a multipart message. If your xquery statement returns a series of XML nodes instead of one XML node with subnodes, expect lots of items. Otherwise, you can probably get away with calling content().
If you want to deal with your results piece by piece, call items().
$resp = Net::MarkLogic::XDBC::ResultSet->new( response => $http_resp );
Result objects are normally created for you after calls to XDBC->query.
print $result->content();
The content of the response, usually XML. Doesn't contain any info about the content's data type. If the response contains multiple parts, the content of each part is concatenated. The results are returned inside of a <result> tag to ensure a complete XML document.
print $result->as_xml
Returns an XML representation of the result including content type and xml type. The document has a root node of result and each part of the response is inside an entry node. The entry node contains two attributes, content_type and x_type.
@items= $result->items();
Return Net::MarkLogic::CIS::Result::Item objects for each part of the response.
my $http_resp = $result->response;
Returns the HTTP::Response object used to create this object.
Big time. Watch out for changing APIs.
Tony Stubblebine tonys@oreilly.com
Copyright 2004 Tony Stubblebine
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
MarkLogic CIS documentation: http://xqzone.marklogic.com
To install Net::MarkLogic::XDBC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::MarkLogic::XDBC
CPAN shell
perl -MCPAN -e shell install Net::MarkLogic::XDBC
For more information on module installation, please visit the detailed CPAN module installation guide.