Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
xml.dom.pulldom.SAX2DOM Class Reference
Inheritance diagram for xml.dom.pulldom.SAX2DOM:
Inheritance graph
[legend]
Collaboration diagram for xml.dom.pulldom.SAX2DOM:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def startElementNS
def startElement
def processingInstruction
def ignorableWhitespace
def characters
def pop
def setDocumentLocator
def startPrefixMapping
def endPrefixMapping
def endElementNS
def endElement
def comment
def startDocument
def buildDocument
def endDocument
def clear

Public Attributes

 documentFactory
 firstEvent
 lastEvent
 elementStack
 push
 pop
 pending_events

Static Public Attributes

 document = None

Detailed Description

Definition at line 290 of file pulldom.py.


Member Function Documentation

def xml.dom.pulldom.PullDOM.buildDocument (   self,
  uri,
  tagname 
) [inherited]

Definition at line 165 of file pulldom.py.

00165 
00166     def buildDocument(self, uri, tagname):
00167         # Can't do that in startDocument, since we need the tagname
00168         # XXX: obtain DocumentType
00169         node = self.documentFactory.createDocument(uri, tagname, None)
00170         self.document = node
00171         self.lastEvent[1] = [(START_DOCUMENT, node), None]
00172         self.lastEvent = self.lastEvent[1]
00173         self.push(node)
00174         # Put everything we have seen so far into the document
00175         for e in self.pending_events:
00176             if e[0][0] == PROCESSING_INSTRUCTION:
00177                 _,target,data = e[0]
00178                 n = self.document.createProcessingInstruction(target, data)
00179                 e[0] = (PROCESSING_INSTRUCTION, n)
00180             elif e[0][0] == COMMENT:
00181                 n = self.document.createComment(e[0][1])
00182                 e[0] = (COMMENT, n)
00183             else:
00184                 raise AssertionError("Unknown pending event ",e[0][0])
00185             self.lastEvent[1] = e
00186             self.lastEvent = e
00187         self.pending_events = None
00188         return node.firstChild

Here is the caller graph for this function:

def xml.dom.pulldom.SAX2DOM.characters (   self,
  chars 
)

Reimplemented from xml.dom.pulldom.PullDOM.

Definition at line 316 of file pulldom.py.

00316 
00317     def characters(self, chars):
00318         PullDOM.characters(self, chars)
00319         node = self.lastEvent[0][1]
00320         parentNode = self.elementStack[-1]
00321         parentNode.appendChild(node)
00322 

def xml.dom.pulldom.PullDOM.clear (   self) [inherited]

Definition at line 193 of file pulldom.py.

00193 
00194     def clear(self):
00195         "clear(): Explicitly release parsing structures"
00196         self.document = None

def xml.dom.pulldom.PullDOM.comment (   self,
  s 
) [inherited]

Definition at line 132 of file pulldom.py.

00132 
00133     def comment(self, s):
00134         if self.document:
00135             node = self.document.createComment(s)
00136             self.lastEvent[1] = [(COMMENT, node), None]
00137             self.lastEvent = self.lastEvent[1]
00138         else:
00139             event = [(COMMENT, s), None]
00140             self.pending_events.append(event)

def xml.dom.pulldom.PullDOM.endDocument (   self) [inherited]

Definition at line 189 of file pulldom.py.

00189 
00190     def endDocument(self):
00191         self.lastEvent[1] = [(END_DOCUMENT, self.document), None]
00192         self.pop()

def xml.dom.pulldom.PullDOM.endElement (   self,
  name 
) [inherited]

Definition at line 128 of file pulldom.py.

00128 
00129     def endElement(self, name):
00130         self.lastEvent[1] = [(END_ELEMENT, self.pop()), None]
00131         self.lastEvent = self.lastEvent[1]

def xml.dom.pulldom.PullDOM.endElementNS (   self,
  name,
  tagName 
) [inherited]

Definition at line 109 of file pulldom.py.

00109 
00110     def endElementNS(self, name, tagName):
00111         self.lastEvent[1] = [(END_ELEMENT, self.pop()), None]
00112         self.lastEvent = self.lastEvent[1]

def xml.dom.pulldom.PullDOM.endPrefixMapping (   self,
  prefix 
) [inherited]

Definition at line 49 of file pulldom.py.

00049 
00050     def endPrefixMapping(self, prefix):
00051         self._current_context = self._ns_contexts.pop()

def xml.dom.pulldom.SAX2DOM.ignorableWhitespace (   self,
  chars 
)

Reimplemented from xml.dom.pulldom.PullDOM.

Definition at line 310 of file pulldom.py.

00310 
00311     def ignorableWhitespace(self, chars):
00312         PullDOM.ignorableWhitespace(self, chars)
00313         node = self.lastEvent[0][1]
00314         parentNode = self.elementStack[-1]
00315         parentNode.appendChild(node)

def xml.dom.pulldom.PullDOM.pop (   self) [inherited]

Definition at line 34 of file pulldom.py.

00034 
00035     def pop(self):
00036         result = self.elementStack[-1]
00037         del self.elementStack[-1]
00038         return result

def xml.dom.pulldom.SAX2DOM.processingInstruction (   self,
  target,
  data 
)

Reimplemented from xml.dom.pulldom.PullDOM.

Definition at line 304 of file pulldom.py.

00304 
00305     def processingInstruction(self, target, data):
00306         PullDOM.processingInstruction(self, target, data)
00307         node = self.lastEvent[0][1]
00308         parentNode = self.elementStack[-1]
00309         parentNode.appendChild(node)

def xml.dom.pulldom.PullDOM.setDocumentLocator (   self,
  locator 
) [inherited]

Definition at line 39 of file pulldom.py.

00039 
00040     def setDocumentLocator(self, locator):
00041         self._locator = locator

def xml.dom.pulldom.PullDOM.startDocument (   self) [inherited]

Definition at line 160 of file pulldom.py.

00160 
00161     def startDocument(self):
00162         if self.documentFactory is None:
00163             import xml.dom.minidom
00164             self.documentFactory = xml.dom.minidom.Document.implementation

def xml.dom.pulldom.SAX2DOM.startElement (   self,
  name,
  attrs 
)

Reimplemented from xml.dom.pulldom.PullDOM.

Definition at line 298 of file pulldom.py.

00298 
00299     def startElement(self, name, attrs):
00300         PullDOM.startElement(self, name, attrs)
00301         curNode = self.elementStack[-1]
00302         parentNode = self.elementStack[-2]
00303         parentNode.appendChild(curNode)

def xml.dom.pulldom.SAX2DOM.startElementNS (   self,
  name,
  tagName,
  attrs 
)

Reimplemented from xml.dom.pulldom.PullDOM.

Definition at line 292 of file pulldom.py.

00292 
00293     def startElementNS(self, name, tagName , attrs):
00294         PullDOM.startElementNS(self, name, tagName, attrs)
00295         curNode = self.elementStack[-1]
00296         parentNode = self.elementStack[-2]
00297         parentNode.appendChild(curNode)

def xml.dom.pulldom.PullDOM.startPrefixMapping (   self,
  prefix,
  uri 
) [inherited]

Definition at line 42 of file pulldom.py.

00042 
00043     def startPrefixMapping(self, prefix, uri):
00044         if not hasattr(self, '_xmlns_attrs'):
00045             self._xmlns_attrs = []
00046         self._xmlns_attrs.append((prefix or 'xmlns', uri))
00047         self._ns_contexts.append(self._current_context.copy())
00048         self._current_context[uri] = prefix or None


Member Data Documentation

xml.dom.pulldom.PullDOM.document = None [static, inherited]

Definition at line 16 of file pulldom.py.

Definition at line 20 of file pulldom.py.

Definition at line 23 of file pulldom.py.

Definition at line 21 of file pulldom.py.

Definition at line 22 of file pulldom.py.

Definition at line 32 of file pulldom.py.

Definition at line 26 of file pulldom.py.

Definition at line 24 of file pulldom.py.


The documentation for this class was generated from the following file: