xml.dom.pulldom.parse()

xml.dom.pulldom.parse(stream_or_string, parser=None, bufsize=None) Return a DOMEventStream from the given input. stream_or_string may be either a file name, or a file-like object. parser, if given, must be an XMLReader object. This function will change the document handler of the parser and activate namespace support; other parser configuration (like setting an entity resolver) must have been done in advance.

xml.dom.pulldom.DOMEventStream.reset()

reset()

xml.dom.pulldom.DOMEventStream.getEvent()

getEvent() Return a tuple containing event and the current node as xml.dom.minidom.Document if event equals START_DOCUMENT, xml.dom.minidom.Element if event equals START_ELEMENT or END_ELEMENT or xml.dom.minidom.Text if event equals CHARACTERS. The current node does not contain informations about its children, unless expandNode() is called.

xml.dom.pulldom.DOMEventStream.expandNode()

expandNode(node) Expands all children of node into node. Example: from xml.dom import pulldom xml = '<html><title>Foo</title> <p>Some text <div>and more</div></p> </html>' doc = pulldom.parseString(xml) for event, node in doc: if event == pulldom.START_ELEMENT and node.tagName == 'p': # Following statement only prints '<p/>' print(node.toxml()) doc.expandNode(node) # Following statement prints node wit

xml.dom.pulldom.DOMEventStream

class xml.dom.pulldom.DOMEventStream(stream, parser, bufsize) getEvent() Return a tuple containing event and the current node as xml.dom.minidom.Document if event equals START_DOCUMENT, xml.dom.minidom.Element if event equals START_ELEMENT or END_ELEMENT or xml.dom.minidom.Text if event equals CHARACTERS. The current node does not contain informations about its children, unless expandNode() is called. expandNode(node) Expands all children of node into node. Example: from xml.dom imp

xml.dom.pulldom.default_bufsize

xml.dom.pulldom.default_bufsize Default value for the bufsize parameter to parse(). The value of this variable can be changed before calling parse() and the new value will take effect.

xml.dom.ProcessingInstruction.target

ProcessingInstruction.target The content of the processing instruction up to the first whitespace character. This is a read-only attribute.

xml.dom.ProcessingInstruction.data

ProcessingInstruction.data The content of the processing instruction following the first whitespace character.

xml.dom.NotSupportedErr

exception xml.dom.NotSupportedErr Raised when the implementation does not support the requested type of object or operation.

xml.dom.NotFoundErr

exception xml.dom.NotFoundErr Exception when a node does not exist in the referenced context. For example, NamedNodeMap.removeNamedItem() will raise this if the node passed in does not exist in the map.