The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::MarkLogic::XDBC::Result- A sequence of XQUERY values returned from the execution of an XQUERY statement.

SYNOPSIS

  use Net::MarkLogic::XDBC::Result

  my $result = $xdbc->query($xquery);

  print $result->content;
  print $result->as_xml;

  @items = $result->items;
  print $item->content;
  

DESCRIPTION

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().

METHODS

new()

  $resp = Net::MarkLogic::XDBC::ResultSet->new( response => $http_resp );

Result objects are normally created for you after calls to XDBC->query.

content()

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.

as_xml()

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()

  @items= $result->items();

Return Net::MarkLogic::CIS::Result::Item objects for each part of the response.

response()

my $http_resp = $result->response;

Returns the HTTP::Response object used to create this object.

BUGS

Big time. Watch out for changing APIs.

AUTHOR

    Tony Stubblebine
    tonys@oreilly.com

COPYRIGHT

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.

SEE ALSO

MarkLogic CIS documentation: http://xqzone.marklogic.com