{
    "content": [
        {
            "type": "text",
            "text": "# Net::XMPP (perldoc)\n\n## NAME\n\nNet::XMPP - XMPP Perl Library\n\n## SYNOPSIS\n\nNet::XMPP provides a Perl user with access to the Extensible Messaging and Presence Protocol\n(XMPP).\nFor more information about XMPP visit:\n<http://www.xmpp.org>\n\n## DESCRIPTION\n\nNet::XMPP is a convenient tool to use for any perl script that would like to utilize the XMPP\nInstant Messaging protocol. While not a client in and of itself, it provides all of the\nnecessary back-end functions to make a CGI client or command-line perl client feasible and easy\nto use. Net::XMPP is a wrapper around the rest of the official Net::XMPP::xxxxxx packages.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **EXAMPLES**\n- **METHODS** (4 subsections)\n- **PACKAGES** (8 subsections)\n- **AUTHOR**\n- **BUGS**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::XMPP",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::XMPP - XMPP Perl Library",
        "synopsis": "Net::XMPP provides a Perl user with access to the Extensible Messaging and Presence Protocol\n(XMPP).\nFor more information about XMPP visit:\n<http://www.xmpp.org>",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "use Net::XMPP;",
            "my $client = Net::XMPP::Client->new();"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 7,
                "subsections": [
                    {
                        "name": "Retrieval functions",
                        "lines": 20
                    },
                    {
                        "name": "Creation functions",
                        "lines": 32
                    },
                    {
                        "name": "Removal functions",
                        "lines": 7
                    },
                    {
                        "name": "Test functions",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "PACKAGES",
                "lines": 2,
                "subsections": [
                    {
                        "name": "Net::XMPP::Client",
                        "lines": 4
                    },
                    {
                        "name": "Net::XMPP::Protocol",
                        "lines": 3
                    },
                    {
                        "name": "Net::XMPP::JID",
                        "lines": 3
                    },
                    {
                        "name": "Net::XMPP::Message",
                        "lines": 2
                    },
                    {
                        "name": "Net::XMPP::Presence",
                        "lines": 2
                    },
                    {
                        "name": "Net::XMPP::IQ",
                        "lines": 3
                    },
                    {
                        "name": "Net::XMPP::Stanza",
                        "lines": 6
                    },
                    {
                        "name": "Net::XMPP::Namespaces",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::XMPP - XMPP Perl Library\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "Net::XMPP provides a Perl user with access to the Extensible Messaging and Presence Protocol\n(XMPP).\n\nFor more information about XMPP visit:\n\n<http://www.xmpp.org>\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Net::XMPP is a convenient tool to use for any perl script that would like to utilize the XMPP\nInstant Messaging protocol. While not a client in and of itself, it provides all of the\nnecessary back-end functions to make a CGI client or command-line perl client feasible and easy\nto use. Net::XMPP is a wrapper around the rest of the official Net::XMPP::xxxxxx packages.\n\nThere is are example scripts in the example directory that provide you with examples of very\nsimple XMPP programs.\n\nNOTE: The parser that XML::Stream::Parser provides, as are most Perl parsers, is synchronous. If\nyou are in the middle of parsing a packet and call a user defined callback, the Parser is\nblocked until your callback finishes. This means you cannot be operating on a packet, send out\nanother packet and wait for a response to that packet. It will never get to you. Threading might\nsolve this, but as of this writing threading in Perl is not quite up to par yet. This issue will\nbe revisted in the future.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "use Net::XMPP;\nmy $client = Net::XMPP::Client->new();\n",
                "subsections": []
            },
            "METHODS": {
                "content": "The Net::XMPP module does not define any methods that you will call directly in your code.\nInstead you will instantiate objects that call functions from this module to do work. The three\nmain objects that you will work with are the Message, Presence, and IQ modules. Each one\ncorresponds to the Jabber equivalent and allows you get and set all parts of those packets.\n\nThere are a few functions that are the same across all of the objects:\n",
                "subsections": [
                    {
                        "name": "Retrieval functions",
                        "content": "GetXML\nReturns the XML string that represents the data contained in the object.\n\n$xml  = $obj->GetXML();\n\nGetChild\nReturns an array of Net::XMPP::Stanza objects that represent all of the stanzas in the\nobject that are namespaced. If you specify a namespace then only stanza objects with that\nXMLNS are returned.\n\n@xObj = $obj->GetChild();\n@xObj = $obj->GetChild(\"my:namespace\");\n\nGetTag\nReturn the root tag name of the packet.\n\nGetTree\nReturn the XML::Stream::Node object that contains the data. See XML::Stream::Node for\nmethods you can call on this object.\n"
                    },
                    {
                        "name": "Creation functions",
                        "content": "NewChild\nNewChild(namespace)\nNewChild(namespace,tag)\n\nCreates a new Net::XMPP::Stanza object with the specified namespace and root tag of whatever\nthe namespace says its root tag should be. Optionally you may specify another root tag if\nthe default is not desired, or the namespace requres you to set one.\n\n$xObj = $obj->NewChild(\"my:namespace\");\n$xObj = $obj->NewChild(\"my:namespace\",\"foo\");\n\nie. <foo xmlns='my:namespace'...></foo>\n\nInsertRawXML\nInsertRawXML(string)\n\nputs the specified string raw into the XML packet that you call this on.\n\n$message->InsertRawXML(\"<foo></foo>\")\n<message...>...<foo></foo></message>\n\n$x = $message->NewChild(..);\n$x->InsertRawXML(\"test\");\n\n$query = $iq->GetChild(..);\n$query->InsertRawXML(\"test\");\n\nClearRawXML\nClearRawXML()\n\nRemoves the raw XML from the packet.\n"
                    },
                    {
                        "name": "Removal functions",
                        "content": "RemoveChild\nRemoveChild()\nRemoveChild(namespace)\n\nRemoves all of the namespaces child elements from the object. If a namespace is provided,\nthen only the children with that namespace are removed.\n"
                    },
                    {
                        "name": "Test functions",
                        "content": "DefinedChild\nDefinedChild()\nDefinedChild(namespace)\n\nReturns 1 if there are any known namespaced stanzas in the packet, 0 otherwise. Optionally\nyou can specify a namespace and determine if there are any stanzas with that namespace.\n\n$test = $obj->DefinedChild();\n$test = $obj->DefinedChild(\"my:namespace\");\n"
                    }
                ]
            },
            "PACKAGES": {
                "content": "For more information on each of these packages, please see the man page for each one.\n",
                "subsections": [
                    {
                        "name": "Net::XMPP::Client",
                        "content": "This package contains the code needed to communicate with an XMPP server: login, wait for\nmessages, send messages, and logout. It uses XML::Stream to read the stream from the server and\nbased on what kind of tag it encounters it calls a function to handle the tag.\n"
                    },
                    {
                        "name": "Net::XMPP::Protocol",
                        "content": "A collection of high-level functions that Client uses to make their lives easier. These methods\nare inherited by the Client.\n"
                    },
                    {
                        "name": "Net::XMPP::JID",
                        "content": "The XMPP IDs consist of three parts: user id, server, and resource. This module gives you access\nto those components without having to parse the string yourself.\n"
                    },
                    {
                        "name": "Net::XMPP::Message",
                        "content": "Everything needed to create and read a <message/> received from the server.\n"
                    },
                    {
                        "name": "Net::XMPP::Presence",
                        "content": "Everything needed to create and read a <presence/> received from the server.\n"
                    },
                    {
                        "name": "Net::XMPP::IQ",
                        "content": "IQ is a wrapper around a number of modules that provide support for the various Info/Query\nnamespaces that XMPP recognizes.\n"
                    },
                    {
                        "name": "Net::XMPP::Stanza",
                        "content": "This module represents a namespaced stanza that is used to extend a <message/>, <presence/>, and\n<iq/>.\n\nThe man page for Net::XMPP::Stanza contains a listing of all supported namespaces, and the\nmethods that are supported by the objects that represent those namespaces.\n"
                    },
                    {
                        "name": "Net::XMPP::Namespaces",
                        "content": "XMPP allows for any stanza to be extended by any bit of XML. This module contains all of the\ninternals for defining the XMPP based extensions defined by the IETF. The documentation for this\nmodule explains more about how to add your own custom namespace and have it be supported.\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Originally authored by Ryan Eatmon.\n\nPreviously maintained by Eric Hacker.\n\nCurrently maintained by Darian Anthony Patrick.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "See unpatched issues at <https://rt.cpan.org/Dist/Display.html?Queue=Net-XMPP>.\n\nThere is at least one issue with XML::Stream providing different node structures depending on\nhow the node is created. Net::XMPP should now be able to handle this, but who knows what else\nlurks.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "This module is free software, you can redistribute it and/or modify it under the LGPL 2.1.\n",
                "subsections": []
            }
        }
    }
}