Message149488
Potentially both: The xml.dom.pulldom documentation is not really there.
Maybe the PullDOM builds a partial tree, not caring about nested nodes. In contrast to SAX2DOM, which seems to fill the DOM tree completely.
I tried to figure out, what the programmer intended to do: Obviously SAX2DOM extends the behaviour of PullDOM.
The documentation (online V3.2, retrieved today) does state: "PullDOM allows building only selected portions of a Document Object Model representation"
Does that mean, one would derive a customized class from PullDOM, implement methods like SAX2DOM, but control the construction with conditions?
For example:
class MyDOM(PullDOM):
def startElement(self, name, attrs):
PullDOM.startElement(self, name, attrs)
if name[:3]=="my_":
curNode = self.elementStack[-1]
parentNode = self.elementStack[-2]
parentNode.appendChild(curNode)
When someone says "YEAH, MATE, ABSOLUTELY, YOU GOT IT!", I might be able fill some of the documentation gaps. |
|
Date |
User |
Action |
Args |
2011-12-15 02:00:34 | AchimGaedke | set | recipients:
+ AchimGaedke, eric.araujo |
2011-12-15 02:00:33 | AchimGaedke | set | messageid: <1323914433.87.0.598176905606.issue13551@psf.upfronthosting.co.za> |
2011-12-15 02:00:33 | AchimGaedke | link | issue13551 messages |
2011-12-15 02:00:32 | AchimGaedke | create | |
|