1RPC::XML::Parser(3) User Contributed Perl Documentation RPC::XML::Parser(3)
2
3
4
6 RPC::XML::Parser - Interface for parsers created by
7 RPC::XML::ParserFactory
8
10 This class is not instantiated directly; see RPC::XML::ParserFactory.
11
13 The RPC::XML::Parser class encapsulates the interface for the parsing
14 process. It is an empty class that is used in conjuntion with the
15 RPC::XML::ParserFactory class.
16
17 All parser implementations that are intended to be returned by calls to
18 RPC::XML::ParserFactory::new() should declare this as their parent
19 class.
20
22 This class provides empty implementations for the following methods. A
23 parser implementation must provide definitions for both of these
24 methods. If the versions from this class are triggered they will throw
25 exceptions ("die").
26
27 The descriptions below define the interface that implementations must
28 adhere to.
29
30 new([ARGS])
31 Create a new instance of the class. Any extra data passed to the
32 constructor is taken as key/value pairs (not a hash reference) and
33 attached to the object.
34
35 The following parameters are currently recognized:
36
37 base64_to_fh
38 If passed with a true value, this tells the parser that
39 incoming Base64 data is to be spooled to a filehandle
40 opened onto an anonymous temporary file. The file itself is
41 unlinked after opening, though the resulting
42 RPC::XML::base64 object can use its "to_file" method to
43 save the data to a specific file at a later point. No
44 checks on size are made; if this option is set, all Base64
45 data goes to filehandles.
46
47 base64_temp_dir
48 If this argument is passed, the value is taken as the
49 directory under which the temporary files are created. This
50 is so that the application is not locked in to the list of
51 directories that File::Spec defaults to with its "tmpdir"
52 method. If this is not passed, the previously-mentioned
53 method is used to derive the directory in which to create
54 the temporary files. Only relevant if base64_to_fh is set.
55
56 The "base64*" parameters do not have to be implemented if the user
57 has no plans to use the "to_file" method of the RPC::XML::base64
58 data-class.
59
60 parse [ STRING | STREAM ]
61 Parse the XML document specified in either a string or a stream.
62 The stream may be any file descriptor, derivative of IO::Handle,
63 etc.
64
65 The value returned must be one of the following:
66
67 RPC::XML::request instance
68 When passed a valid XML-RPC request message, the return value
69 should be an instance of the RPC::XML::request class.
70
71 RPC::XML::response instance
72 Likewise, when passed a valid XML-RPC response, the return
73 value should be an instance of the RPC::XML::response class.
74
75 string containing an error message
76 If the message does not conform to either a request or a
77 response, or does not properly parse, the return value must be
78 a string containing the error message.
79
80 A non-blocking (push) parser instance
81 If no arguments are passed in, the return value must be a
82 parser object that implements push-parsing (non-blocking). It
83 does not have to be of the same class as the original object,
84 but it must support the remaining two methods
85
86 The next two methods are only called on push-parser instances, and as
87 such do not have to be implemented by the actual factory-compatible
88 parser. It is enough if the non-blocking parser instance it returns
89 from the no-argument call to parse() implements these:
90
91 parse_more STRING
92 Send a chunk of the current XML document to the parser for
93 processing.
94
95 parse_done
96 Signal the end of parsing. The return value from this should be one
97 of the same three possibilities that the direct use of parse()
98 (above) returns:
99
100 RPC::XML::request instance
101 RPC::XML::response instance
102 string containing an error message
103
104 parse_done() may also signal an error by throwing an exception.
105
107 Please report any bugs or feature requests to "bug-rpc-xml at
108 rt.cpan.org", or through the web interface at
109 http://rt.cpan.org/NoAuth/ReportBug.html?Queue=RPC-XML
110 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=RPC-XML>. I will be
111 notified, and then you'll automatically be notified of progress on your
112 bug as I make changes.
113
115 · RT: CPAN's request tracker
116
117 http://rt.cpan.org/NoAuth/Bugs.html?Dist=RPC-XML
118 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=RPC-XML>
119
120 · AnnoCPAN: Annotated CPAN documentation
121
122 http://annocpan.org/dist/RPC-XML <http://annocpan.org/dist/RPC-XML>
123
124 · CPAN Ratings
125
126 http://cpanratings.perl.org/d/RPC-XML
127 <http://cpanratings.perl.org/d/RPC-XML>
128
129 · Search CPAN
130
131 http://search.cpan.org/dist/RPC-XML
132 <http://search.cpan.org/dist/RPC-XML>
133
134 · Source code on GitHub
135
136 http://github.com/rjray/rpc-xml/tree/master
137 <http://github.com/rjray/rpc-xml/tree/master>
138
140 This file and the code within are copyright (c) 2009 by Randy J. Ray.
141
142 Copying and distribution are permitted under the terms of the Artistic
143 License 2.0
144 (http://www.opensource.org/licenses/artistic-license-2.0.php
145 <http://www.opensource.org/licenses/artistic-license-2.0.php>) or the
146 GNU LGPL 2.1 (http://www.opensource.org/licenses/lgpl-2.1.php
147 <http://www.opensource.org/licenses/lgpl-2.1.php>).
148
150 The XML-RPC standard is Copyright (c) 1998-2001, UserLand Software,
151 Inc. See <http://www.xmlrpc.com> for more information about the XML-
152 RPC specification.
153
155 RPC::XML, RPC::XML::ParserFactory, RPC::XML::Parser::XMLParser
156
158 Randy J. Ray <rjray@blackperl.com>
159
160
161
162perl v5.12.0 2009-09-03 RPC::XML::Parser(3)