line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Net::MarkLogic::XDBC::Result::Item; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Net::MarkLogic::CIS::Result::Item - Part of the response returned after an XDBC query. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
print $item->content; |
12
|
|
|
|
|
|
|
print $item->as_xml; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
$type = $item->content_type; |
15
|
|
|
|
|
|
|
$type = $item->x_type; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 DESCRIPTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Alpha. API will change. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
This class represents a single part of a multipart XDBC response. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
26
|
1
|
|
|
1
|
|
5
|
use Data::Dumper; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
47
|
|
27
|
1
|
|
|
1
|
|
6
|
use LWP::UserAgent; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
28
|
1
|
|
|
1
|
|
5
|
use Class::Accessor; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
29
|
1
|
|
|
1
|
|
25
|
use Class::Fields; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
145
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our $VERSION = 0.01; |
32
|
|
|
|
|
|
|
our @BASIC_FIELDS = qw(content_type type content); |
33
|
1
|
|
|
1
|
|
4
|
use base qw(Class::Accessor Class::Fields); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
151
|
|
34
|
1
|
|
|
1
|
|
1064
|
use fields @BASIC_FIELDS; |
|
1
|
|
|
|
|
3809
|
|
|
1
|
|
|
|
|
7
|
|
35
|
|
|
|
|
|
|
Net::MarkLogic::XDBC::Result::Item->mk_accessors( @BASIC_FIELDS ); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 METHODS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub new |
42
|
|
|
|
|
|
|
{ |
43
|
0
|
|
|
0
|
1
|
|
my ($class, %args) = @_; |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
0
|
|
|
|
my $self = bless ({}, ref ($class) || $class); |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
$self->content_type($args{content_type}); |
48
|
0
|
|
|
|
|
|
$self->type($args{type}); |
49
|
0
|
|
|
|
|
|
$self->content($args{content}); |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
return $self; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 content() |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
print $part->content; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
The content returned in this part, often XML or an XML snippit. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 as_xml() |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
An XML representation of this part including content type and xml type. The |
63
|
|
|
|
|
|
|
part content is wrapped inside an entry node. The entry node contains two |
64
|
|
|
|
|
|
|
attributes, content_type and type. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub as_xml { |
69
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
my $xml .= "-
|
72
|
|
|
|
|
|
|
. " type='" . $self->type . "'>\n" |
73
|
|
|
|
|
|
|
. $self->content |
74
|
|
|
|
|
|
|
. "\n\n"; |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
return $xml; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 content_type() |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Content type, ex: text/xml |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 type |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Schema type, Ex: node() |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 BUGS |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Big time. Watch out for changing APIs. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 AUTHOR |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Tony Stubblebine |
96
|
|
|
|
|
|
|
tonys@oreilly.com |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 COPYRIGHT |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Copyright 2004 Tony Stubblebine |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); |
103
|
|
|
|
|
|
|
you may not use this file except in compliance with the License. |
104
|
|
|
|
|
|
|
You may obtain a copy of the License at |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0 |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software |
109
|
|
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS, |
110
|
|
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
111
|
|
|
|
|
|
|
See the License for the specific language governing permissions and |
112
|
|
|
|
|
|
|
limitations under the License. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 SEE ALSO |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
1; |
119
|
|
|
|
|
|
|
__END__ |