AnyEven...:Parser(3)
πΈ NAME πΈ
AnyEvent::XMPP::Parser β parser for XML streams (helper for AnyEvent::XMPP). Hii bestie, this page is from User Contributed Perl Documentation, and the header names it AnyEven...:Parser(3) β yes, that abbreviation is giving cryptic group-chat nickname energy, but we move π
.
β¨ SYNOPSIS β¨
use AnyEvent::XMPP::Parser;
...
π¦ DESCRIPTION π¦
This is a XMPP XML parser helper class, and its whole job is helping me cope with the XMPP XML. No cap, that's the assignment.
See also AnyEvent::XMPP::Writer for a discussion of the issues with XML in XMPP. Cross-reference icon behavior π.
π METHODS π
π new
This creates a new AnyEvent::XMPP::Parser and calls init. Constructor main character energy, periodt.
π set_stanza_cb ($cb)
Sets the 'XML stanza' callback.
$cb must be a code reference. The first argument to the callback will be this AnyEvent::XMPP::Parser instance, and the second will be the stanza's root AnyEvent::XMPP::Node as first argument.
If the second argument is undefined, the end of the stream has been found. So if it's undef, that's your stream-finishing moment, bestie π.
π set_error_cb ($cb)
This sets the error callback that will be called when the parser encounters a syntax error. The first argument is the exception, and the second is the data which caused the error. Error-handling slay, but make it careful β¨.
π¦ set_stream_cb ($cb)
This method sets the stream tag callback. It is called when the <stream> tag from the server has been encountered. The first argument to the callback is the AnyEvent::XMPP::Node of the opening stream tag. Stream-tag moment π«Ά.
πΈ init
This method (re)initializes the parser. Reset button behavior, fresh-start vibe π.
π§ cleanup
This method removes all handlers. Use it to avoid circular references. Cleanup era, literally iconic π.
π₯ nseq ($namespace, $tagname, $cmptag)
This method checks whether the $cmptag matches the $tagname in the $namespace.
$cmptag needs to come from the XML::Parser::Expat as it has some magic attached that stores the namespace. Not me explaining Expat magic in the group chat, but here we are β¨.
π feed ($data)
This method feeds a chunk of unparsed data to the parser. Feed it, bestie β it's hungry for XML chunks π.
π AUTHOR π
Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>". Author credits, preserved and celebrated π.
π COPYRIGHT & LICENSE π
Copyright 2007, 2008 Robin Redeker, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Cute sign-off time: this page comes from perl v5.42.2, dated 2026-02-15 β footer facts tucked in with a little sparkle πβ¨.
π¦ where this page comes from
- alpine 3.24: perl-anyevent-xmpp-doc 0.55-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms