Package xmpp :: Module simplexml :: Class NodeBuilder
[show private | hide private]
[frames | no frames]

Class NodeBuilder


Builds a Node class minidom from data parsed to it. This class used for two purposes:
  1. Creation an XML Node from a textual representation. F.e. reading a config file. See an XML2Node method.
  2. Handling an incoming XML stream. This is done by mangling the __dispatch_depth parameter and redefining the dispatch method.
You do not need to use this class directly if you do not designing your own XML handler.
Method Summary
  __init__(self, data, initial_node)
Takes two optional parameters: "data" and "initial_node".
  DEBUG(self, level, text, comment)
Gets all NodeBuilder walking events.
  destroy(self)
Method used to allow class instance to be garbage-collected.
  dispatch(self, stanza)
Gets called when the NodeBuilder reaches some level of depth on it's way up with the built node as argument.
  endtag(self, tag)
XML Parser callback.
  getDom(self)
Returns just built Node.
  handle_data(self, data)
XML Parser callback.
  handle_namespace_start(self, prefix, uri)
XML Parser callback.
  starttag(self, tag, attrs)
XML Parser callback.
  stream_footer_received(self)
Method called when stream just closed.
  stream_header_received(self, ns, tag, attrs)
Method called when stream just opened.

Method Details

__init__(self, data=None, initial_node=None)
(Constructor)

Takes two optional parameters: "data" and "initial_node". By default class initialised with empty Node class instance. Though, if "initial_node" is provided it used as "starting point". You can think about it as of "node upgrade". "data" (if provided) feeded to parser immidiatedly after instance init.

DEBUG(self, level, text, comment=None)

Gets all NodeBuilder walking events. Can be used for debugging if redefined.

destroy(self)

Method used to allow class instance to be garbage-collected.

dispatch(self, stanza)

Gets called when the NodeBuilder reaches some level of depth on it's way up with the built node as argument. Can be redefined to convert incoming XML stanzas to program events.

endtag(self, tag)

XML Parser callback. Used internally

getDom(self)

Returns just built Node.

handle_data(self, data)

XML Parser callback. Used internally

handle_namespace_start(self, prefix, uri)

XML Parser callback. Used internally

starttag(self, tag, attrs)

XML Parser callback. Used internally

stream_footer_received(self)

Method called when stream just closed.

stream_header_received(self, ns, tag, attrs)

Method called when stream just opened.

Generated by Epydoc 2.1 on Wed May 4 07:28:30 2005 http://epydoc.sf.net