.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" 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 "AnyEvent::XMPP::Parser 3pm" .TH AnyEvent::XMPP::Parser 3pm "2022-12-06" "perl v5.36.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" AnyEvent::XMPP::Parser \- Parser for XML streams (helper for AnyEvent::XMPP) .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use AnyEvent::XMPP::Parser; \& ... .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a \s-1XMPP XML\s0 parser helper class, which helps me to cope with the \s-1XMPP XML.\s0 .PP See also AnyEvent::XMPP::Writer for a discussion of the issues with \s-1XML\s0 in \s-1XMPP.\s0 .SH "METHODS" .IX Header "METHODS" .IP "\fBnew\fR" 4 .IX Item "new" This creates a new AnyEvent::XMPP::Parser and calls \f(CW\*(C`init\*(C'\fR. .IP "\fBset_stanza_cb ($cb)\fR" 4 .IX Item "set_stanza_cb ($cb)" Sets the '\s-1XML\s0 stanza' callback. .Sp \&\f(CW$cb\fR must be a code reference. The first argument to the callback will be this AnyEvent::XMPP::Parser instance and the second will be the stanzas root AnyEvent::XMPP::Node as first argument. .Sp If the second argument is undefined the end of the stream has been found. .IP "\fBset_error_cb ($cb)\fR" 4 .IX Item "set_error_cb ($cb)" This sets the error callback that will be called when the parser encounters an syntax error. The first argument is the exception and the second is the data which caused the error. .IP "\fBset_stream_cb ($cb)\fR" 4 .IX Item "set_stream_cb ($cb)" This method sets the stream tag callback. It is called when the tag from the server has been encountered. The first argument to the callback is the AnyEvent::XMPP::Node of the opening stream tag. .IP "\fBinit\fR" 4 .IX Item "init" This methods (re)initializes the parser. .IP "\fBcleanup\fR" 4 .IX Item "cleanup" This methods removes all handlers. Use it to avoid circular references. .IP "\fBnseq ($namespace, \f(CB$tagname\fB, \f(CB$cmptag\fB)\fR" 4 .IX Item "nseq ($namespace, $tagname, $cmptag)" This method checks whether the \f(CW$cmptag\fR matches the \f(CW$tagname\fR in the \f(CW$namespace\fR. .Sp \&\f(CW$cmptag\fR needs to come from the XML::Parser::Expat as it has some magic attached that stores the namespace. .IP "\fBfeed ($data)\fR" 4 .IX Item "feed ($data)" This method feeds a chunk of unparsed data to the parser. .SH "AUTHOR" .IX Header "AUTHOR" Robin Redeker, \f(CW\*(C`\*(C'\fR, \s-1JID:\s0 \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2007, 2008 Robin Redeker, all rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.