.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RPC::XML::Parser 3pm" .TH RPC::XML::Parser 3pm "2021-01-10" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" RPC::XML::Parser \- Interface for parsers created by RPC::XML::ParserFactory .SH "SYNOPSIS" .IX Header "SYNOPSIS" This class is not instantiated directly; see RPC::XML::ParserFactory. .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \fBRPC::XML::Parser\fR class encapsulates the interface for the parsing process. It is an empty class that is used in conjuntion with the \&\fBRPC::XML::ParserFactory\fR class. .PP All parser implementations that are intended to be returned by calls to \&\fBRPC::XML::ParserFactory::new()\fR should declare this as their parent class. .SH "SUBROUTINES/METHODS" .IX Header "SUBROUTINES/METHODS" This class provides empty implementations for the following methods. A parser implementation must provide definitions for \fBboth\fR of these methods. If the versions from this class are triggered they will throw exceptions (\f(CW\*(C`die\*(C'\fR). .PP The descriptions below define the interface that implementations must adhere to. .IP "new([\s-1ARGS\s0])" 4 .IX Item "new([ARGS])" Create a new instance of the class. Any extra data passed to the constructor is taken as key/value pairs (\fBnot\fR a hash reference) and attached to the object. .Sp The following parameters are currently recognized: .RS 4 .IP "base64_to_fh" 8 .IX Item "base64_to_fh" If passed with a true value, this tells the parser that incoming Base64 data is to be spooled to a filehandle opened onto an anonymous temporary file. The file itself is unlinked after opening, though the resulting \fBRPC::XML::base64\fR object can use its \f(CW\*(C`to_file\*(C'\fR method to save the data to a specific file at a later point. No checks on size are made; if this option is set, \fBall\fR Base64 data goes to filehandles. .IP "base64_temp_dir" 8 .IX Item "base64_temp_dir" If this argument is passed, the value is taken as the directory under which the temporary files are created. This is so that the application is not locked in to the list of directories that \fBFile::Spec\fR defaults to with its \&\f(CW\*(C`tmpdir\*(C'\fR method. If this is not passed, the previously-mentioned method is used to derive the directory in which to create the temporary files. Only relevant if \fBbase64_to_fh\fR is set. .RE .RS 4 .Sp The \f(CW\*(C`base64*\*(C'\fR parameters do not have to be implemented if the user has no plans to use the \f(CW\*(C`to_file\*(C'\fR method of the \fBRPC::XML::base64\fR data-class. .Sp As a special-case, to preserve backwards compatibility with pre\-0.69 versions of this package, \fBnew()\fR has special behavior when specifically called for the package \fBRPC::XML::Parser\fR. When called for this package, the constructor quietly loads \fBRPC::XML::ParserFactory\fR and uses it to construct and return an instance of a parser based on \fBXML::Parser\fR. .RE .IP "parse [ \s-1STRING\s0 | \s-1STREAM\s0 ]" 4 .IX Item "parse [ STRING | STREAM ]" Parse the \s-1XML\s0 document specified in either a string or a stream. The stream may be any file descriptor, derivative of \fBIO::Handle\fR, etc. .Sp The value returned must be one of the following: .RS 4 .IP "RPC::XML::request instance" 4 .IX Item "RPC::XML::request instance" When passed a valid XML-RPC request message, the return value should be an instance of the \fBRPC::XML::request\fR class. .IP "RPC::XML::response instance" 4 .IX Item "RPC::XML::response instance" Likewise, when passed a valid XML-RPC response, the return value should be an instance of the \fBRPC::XML::response\fR class. .IP "string containing an error message" 4 .IX Item "string containing an error message" If the message does not conform to either a request or a response, or does not properly parse, the return value must be a string containing the error message. .IP "A non-blocking (push) parser instance" 4 .IX Item "A non-blocking (push) parser instance" If no arguments are passed in, the return value must be a parser object that implements push-parsing (non-blocking). It does not have to be of the same class as the original object, but it must support the remaining two methods .RE .RS 4 .RE .PP The next two methods are only called on push-parser instances, and as such do not have to be implemented by the actual factory-compatible parser. It is enough if the non-blocking parser instance it returns from the no-argument call to \fBparse()\fR implements these: .IP "parse_more \s-1STRING\s0" 4 .IX Item "parse_more STRING" Send a chunk of the current \s-1XML\s0 document to the parser for processing. .IP "parse_done" 4 .IX Item "parse_done" Signal the end of parsing. The return value from this should be one of the same three possibilities that the direct use of \fBparse()\fR (above) returns: .RS 4 .IP "RPC::XML::request instance" 4 .IX Item "RPC::XML::request instance" .PD 0 .IP "RPC::XML::response instance" 4 .IX Item "RPC::XML::response instance" .IP "string containing an error message" 4 .IX Item "string containing an error message" .RE .RS 4 .PD .Sp \&\fBparse_done()\fR may also signal an error by throwing an exception. .RE .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" Unless otherwises specified, routines return the object reference itself upon a successful operation, and an error string (which is not a blessed reference) upon error. .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to \&\f(CW\*(C`bug\-rpc\-xml at rt.cpan.org\*(C'\fR, or through the web interface at . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "SUPPORT" .IX Header "SUPPORT" .IP "\(bu" 4 \&\s-1RT: CPAN\s0's request tracker .Sp .IP "\(bu" 4 AnnoCPAN: Annotated \s-1CPAN\s0 documentation .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Ratings .Sp .IP "\(bu" 4 Search \s-1CPAN\s0 .Sp .IP "\(bu" 4 MetaCPAN .Sp .IP "\(bu" 4 Source code on GitHub .Sp .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" This file and the code within are copyright (c) 2011 by Randy J. Ray. .PP Copying and distribution are permitted under the terms of the Artistic License 2.0 () or the \s-1GNU LGPL 2.1\s0 (). .SH "CREDITS" .IX Header "CREDITS" The \fBXML-RPC\fR standard is Copyright (c) 1998\-2001, UserLand Software, Inc. See for more information about the \fBXML-RPC\fR specification. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1RPC::XML\s0, RPC::XML::ParserFactory, RPC::XML::Parser::XMLParser .SH "AUTHOR" .IX Header "AUTHOR" Randy J. Ray