{
    "mode": "perldoc",
    "parameter": "Net::Jabber::XDB",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Net%3A%3AJabber%3A%3AXDB/json",
    "generated": "2026-10-05T05:24:49Z",
    "synopsis": "Net::Jabber::XDB is a companion to the Net::Jabber module. It\nprovides the user a simple interface to set and retrieve all\nparts of a Jabber XDB.",
    "sections": {
        "NAME": {
            "content": "Net::Jabber::XDB - Jabber XDB Library\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "Net::Jabber::XDB is a companion to the Net::Jabber module. It\nprovides the user a simple interface to set and retrieve all\nparts of a Jabber XDB.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Net::Jabber::XDB differs from the other Net::Jabber::* modules in that\nthe XMLNS of the data is split out into more submodules under\nXDB.  For specifics on each module please view the documentation\nfor each Net::Jabber::Data::* module.  To see the list of available\nnamspaces and modules see Net::Jabber::Data.\n\nTo initialize the XDB with a Jabber <xdb/> you must pass it the\nXML::Parser Tree array.  For example:\n\nmy $xdb = new Net::Jabber::XDB(@tree);\n\nThere has been a change from the old way of handling the callbacks.\nYou no longer have to do the above, a Net::Jabber::XDB object is passed\nto the callback function for the xdb:\n\nuse Net::Jabber qw(Component);\n\nsub xdb {\nmy ($XDB) = @;\n.\n.\n.\n}\n\nYou now have access to all of the retrieval functions available.\n\nTo create a new xdb to send to the server:\n\nuse Net::Jabber;\n\n$XDB = new Net::Jabber::XDB();\n$XDBType = $XDB->NewData( type );\n$XDBType->SetXXXXX(\"yyyyy\");\n\nNow you can call the creation functions for the XDB, and for the <data/>\non the new Data object itself.  See below for the <xdb/> functions, and\nin each data module for those functions.\n\nFor more information about the array format being passed to the CallBack\nplease read the Net::Jabber::Client documentation.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "Retrieval functions",
                    "content": "GetTo()      - returns either a string with the Jabber Identifier,\nGetTo(\"jid\")   or a Net::Jabber::JID object for the person who is\ngoing to receive the <xdb/>.  To get the JID\nobject set the string to \"jid\", otherwise leave\nblank for the text string.\n\n$to    = $XDB->GetTo();\n$toJID = $XDB->GetTo(\"jid\");\n\nGetFrom()      -  returns either a string with the Jabber Identifier,\nGetFrom(\"jid\")    or a Net::Jabber::JID object for the person who\nsent the <xdb/>.  To get the JID object set\nthe string to \"jid\", otherwise leave blank for the\ntext string.\n\n$from    = $XDB->GetFrom();\n$fromJID = $XDB->GetFrom(\"jid\");\n\nGetType() - returns a string with the type <xdb/> this is.\n\n$type = $XDB->GetType();\n\nGetID() - returns an integer with the id of the <xdb/>.\n\n$id = $XDB->GetID();\n\nGetAction() - returns a string with the action <xdb/> this is.\n\n$action = $XDB->GetAction();\n\nGetMatch() - returns a string with the match <xdb/> this is.\n\n$match = $XDB->GetMatch();\n\nGetError() - returns a string with the text description of the error.\n\n$error = $XDB->GetError();\n\nGetErrorCode() - returns a string with the code of error.\n\n$errorCode = $XDB->GetErrorCode();\n\nGetData() - returns a Net::Jabber::Data object that contains the data\nin the <data/> of the <xdb/>.\n\n$dataTag = $XDB->GetData();\n\nGetDataXMLNS() - returns a string with the namespace of the data\nfor this <xdb/>, if one exists.\n\n$xmlns = $XDB->GetDataXMLNS();\n"
                },
                {
                    "name": "Creation functions",
                    "content": "SetXDB(to=>string|JID,    - set multiple fields in the <xdb/> at one\nfrom=>string|JID,     time.  This is a cumulative and over\nid=>string,           writing action.  If you set the \"to\"\ntype=>string,         attribute twice, the second setting is\naction=>string,       what is used.  If you set the status, and\nmatch=>string)        then set the priority then both will be in\nerrorcode=>string,    the <xdb/> tag.  For valid settings read the\nerror=>string)        specific Set functions below.\n\n$XDB->SetXDB(type=>\"get\",\nto=>\"bob\\@jabber.org\",\ndata=>\"info\");\n\n$XDB->SetXDB(to=>\"bob\\@jabber.org\",\nerrorcode=>403,\nerror=>\"Permission Denied\");\n\nSetTo(string) - sets the to attribute.  You can either pass a string\nSetTo(JID)      or a JID object.  They must be a valid Jabber\nIdentifiers or the server will return an error message.\n(ie.  jabber:bob@jabber.org, etc...)\n\n$XDB->SetTo(\"bob\\@jabber.org\");\n\nSetFrom(string) - sets the from attribute.  You can either pass a string\nSetFrom(JID)      or a JID object.  They must be a valid Jabber\nIdentifiers or the server will return an error message.\n(ie.  jabber:bob@jabber.org, etc...)\n\n$XDB->SetFrom(\"me\\@jabber.org\");\n\nSetType(string) - sets the type attribute.  Valid settings are:\n\nget      request information\nset      set information\nresult   results of a get\nerror    there was an error\n\n$XDB->SetType(\"set\");\n\nSetAction(string) - sets the error code of the <xdb/>.\n\n$XDB->SetAction(\"foo\");\n\nSetMatch(string) - sets the error code of the <xdb/>.\n\n$XDB->SetMatch(\"foo\");\n\nSetErrorCode(string) - sets the error code of the <xdb/>.\n\n$XDB->SetErrorCode(403);\n\nSetError(string) - sets the error string of the <xdb/>.\n\n$XDB->SetError(\"Permission Denied\");\n\nNewData(string) - creates a new Net::Jabber::Data object with the\nnamespace in the string.  In order for this function\nto work with a custom namespace, you must define and\nregister that namespace with the XDB module.  For more\ninformation please read the documentation for\nNet::Jabber::Data.\n\n$dataObj = $XDB->NewData(\"jabber:xdb:auth\");\n$dataObj = $XDB->NewData(\"jabber:xdb:roster\");\n\nReply(hash) - creates a new XDB object and populates the to/from\nfields.  If you specify a hash the same as with SetXDB\nthen those values will override the Reply values.\n\n$xdbReply = $XDB->Reply();\n$xdbReply = $XDB->Reply(type=>\"result\");\n"
                },
                {
                    "name": "Test functions",
                    "content": "DefinedTo() - returns 1 if the to attribute is defined in the <xdb/>,\n0 otherwise.\n\n$test = $XDB->DefinedTo();\n\nDefinedFrom() - returns 1 if the from attribute is defined in the <xdb/>,\n0 otherwise.\n\n$test = $XDB->DefinedFrom();\n\nDefinedID() - returns 1 if the id attribute is defined in the <xdb/>,\n0 otherwise.\n\n$test = $XDB->DefinedID();\n\nDefinedType() - returns 1 if the type attribute is defined in the <xdb/>,\n0 otherwise.\n\n$test = $XDB->DefinedType();\n\nDefinedAction() - returns 1 if the action attribute is defined in the <xdb/>,\n0 otherwise.\n\n$test = $XDB->DefinedAction();\n\nDefinedMatch() - returns 1 if the match attribute is defined in the <xdb/>,\n0 otherwise.\n\n$test = $XDB->DefinedMatch();\n\nDefinedError() - returns 1 if <error/> is defined in the <xdb/>,\n0 otherwise.\n\n$test = $XDB->DefinedError();\n\nDefinedErrorCode() - returns 1 if the code attribute is defined in\n<error/>, 0 otherwise.\n\n$test = $XDB->DefinedErrorCode();\n"
                }
            ]
        },
        "AUTHOR": {
            "content": "By Ryan Eatmon in May of 2001 for http://jabber.org..\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "This module is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        }
    },
    "summary": "Net::Jabber::XDB - Jabber XDB Library",
    "flags": [],
    "examples": [],
    "see_also": []
}