Net::XMPP (3)
Leading comments
Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) Standard preamble: ========================================================================
NAME
Net::XMPP - XMPP Perl LibrarySYNOPSIS
Net::XMPP provides a Perl user with access to the Extensible Messaging and Presence Protocol (For more information about
DESCRIPTION
Net::XMPP is a convenient tool to use for any perl script that would like to utilize theThere is are example scripts in the example directory that provide you with examples of very simple
EXAMPLES
use Net::XMPP; my $client = Net::XMPP::Client->new();
METHODS
The Net::XMPP module does not define any methods that you will call directly in your code. Instead you will instantiate objects that call functions from this module to do work. The three main objects that you will work with are the Message, Presence, andThere are a few functions that are the same across all of the objects:
Retrieval functions
- GetXML
-
Returns the XMLstring that represents the data contained in the object.
$xml = $obj->GetXML();
- GetChild
-
Returns an array of Net::XMPP::Stanza objects
that represent all of the stanzas in the object
that are namespaced. If you specify a namespace
then only stanza objects with that XMLNSare returned.
@xObj = $obj->GetChild(); @xObj = $obj->GetChild("my:namespace");
- GetTag
- Return the root tag name of the packet.
- GetTree
- Return the XML::Stream::Node object that contains the data. See XML::Stream::Node for methods you can call on this object.
Creation functions
- NewChild
-
NewChild(namespace) NewChild(namespace,tag)
Creates a new Net::XMPP::Stanza object with the specified namespace and root tag of whatever the namespace says its root tag should be. Optionally you may specify another root tag if the default is not desired, or the namespace requres you to set one.
$xObj = $obj->NewChild("my:namespace"); $xObj = $obj->NewChild("my:namespace","foo");
ie. <foo xmlns='my:namespace'...></foo>
- InsertRawXML
-
InsertRawXML(string)
puts the specified string raw into the
XMLpacket that you call this on.$message->InsertRawXML("<foo></foo>") <message...>...<foo></foo></message> $x = $message->NewChild(..); $x->InsertRawXML("test"); $query = $iq->GetChild(..); $query->InsertRawXML("test");
- ClearRawXML
-
ClearRawXML()
Removes the raw
XMLfrom the packet.
Removal functions
- RemoveChild
-
RemoveChild() RemoveChild(namespace)
Removes all of the namespaces child elements from the object. If a namespace is provided, then only the children with that namespace are removed.
Test functions
- DefinedChild
-
DefinedChild() DefinedChild(namespace)
Returns 1 if there are any known namespaced stanzas in the packet, 0 otherwise. Optionally you can specify a namespace and determine if there are any stanzas with that namespace.
$test = $obj->DefinedChild(); $test = $obj->DefinedChild("my:namespace");
PACKAGES
For more information on each of these packages, please see the man page for each one.Net::XMPP::Client
This package contains the code needed to communicate with anNet::XMPP::Protocol
A collection of high-level functions that Client uses to make their lives easier. These methods are inherited by the Client.Net::XMPP::JID
TheNet::XMPP::Message
Everything needed to create and read a <message/> received from the server.Net::XMPP::Presence
Everything needed to create and read a <presence/> received from the server.Net::XMPP::IQ
Net::XMPP::Stanza
This module represents a namespaced stanza that is used to extend a <message/>, <presence/>, and <iq/>.The man page for Net::XMPP::Stanza contains a listing of all supported namespaces, and the methods that are supported by the objects that represent those namespaces.
Net::XMPP::Namespaces
AUTHOR
Originally authored by Ryan Eatmon.Previously maintained by Eric Hacker.
Currently maintained by Darian Anthony Patrick.
BUGS
See unpatched issues at <rt.cpan.org/Dist/Display.html?Queue=Net-XMPP>.There is at least one issue with XML::Stream providing different node structures depending on how the node is created. Net::XMPP should now be able to handle this, but who knows what else lurks.