.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 3" .TH AnyEvent::XMPP::Parser 3 2023-07-25 "perl v5.38.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 XMPP XML parser helper class, which helps me to cope with the XMPP XML. .PP See also AnyEvent::XMPP::Writer for a discussion of the issues with XML in XMPP. .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 'XML 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. .ie n .IP "\fBnseq ($namespace, \fR\fB$tagname\fR\fB, \fR\fB$cmptag\fR\fB)\fR" 4 .el .IP "\fBnseq ($namespace, \fR\f(CB$tagname\fR\fB, \fR\f(CB$cmptag\fR\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, JID: \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.