Package libxml2dom :: Module xmpp
[show private | hide private]
[frames | no frames]

Module libxml2dom.xmpp

XMPP support using libxml2dom to capture stanzas as documents. The XMPP
specification employs an "open" or unfinished document as the basis for
communications between client and server - this presents problems for
DOM-oriented libraries.

Various Internet standards specifications exist for XMPP.
See: http://www.xmpp.org/rfcs/rfc3920.html
See: http://www.xmpp.org/rfcs/rfc3921.html

Copyright (C) 2007 Paul Boddie <paul@boddie.org.uk>

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option) any
later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
details.

You should have received a copy of the GNU Lesser General Public License along
with this program.  If not, see <http://www.gnu.org/licenses/>.

--------

The process of connecting, authenticating, and so on is quite convoluted:

s = libxml2dom.xmpp.Session(("localhost", 5222))
d = s.connect("host")
auth = s.createAuth()                        # provides access to the stanza
auth.mechanism = "PLAIN"                     # choose a supported mechanism
auth.setCredentials(jid, username, password) # for PLAIN authentication only
d = s.send(auth)                             # hopefully a success response
d = s.connect("host")                        # have to reconnect!
iq = s.createIq()                            # make an 'iq' stanza
iq.makeBind()                                # set up a binding operation
d = s.send(iq)                               # hopefully a success response
iq = s.createIq()                            # make an 'iq' stanza
iq.makeSession()                             # set up a session
d = s.send(iq)                               # hopefully a success response

See tests/xmpp_test.py for more details.

Classes
Session An XMPP session.
XEP0022EventElement An XEP-0022 event element.
XMPPAuthElement An XMPP auth element.
XMPPBindElement An XMPP bind element.
XMPPClientElement An XMPP client element.
XMPPDocument An XMPP document fragment.
XMPPElement  
XMPPImplementation Contains an XMPP-specific implementation.
XMPPIqElement An XMPP 'iq' element used in instant messaging and registration.
XMPPMessageElement An XMPP message element.
XMPPNode Convenience modifications to nodes specific to libxml2dom.svg.
XMPPPresenceElement An XMPP presence element.
XMPPRegisterElement A registration element.
XMPPStreamElement  

Exceptions
SessionTerminated  

Function Summary
  createXMPPStanza(namespaceURI, localName)
  parse(stream_or_string, html, htmlencoding, unfinished, impl)
  parseFile(filename, html, htmlencoding, unfinished, impl)
  parseString(s, html, htmlencoding, unfinished, impl)
  parseURI(uri, html, htmlencoding, unfinished, impl)

Generated by Epydoc 2.1 on Tue Sep 18 23:37:02 2007 http://epydoc.sf.net