homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author AchimGaedke
Recipients AchimGaedke, eric.araujo
Date 2011年12月15日.02:00:32
SpamBayes Score 2.5745762e-06
Marked as misclassified No
Message-id <1323914433.87.0.598176905606.issue13551@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011年12月15日 02:00:34AchimGaedkesetrecipients: + AchimGaedke, eric.araujo
2011年12月15日 02:00:33AchimGaedkesetmessageid: <1323914433.87.0.598176905606.issue13551@psf.upfronthosting.co.za>
2011年12月15日 02:00:33AchimGaedkelinkissue13551 messages
2011年12月15日 02:00:32AchimGaedkecreate

AltStyle によって変換されたページ (->オリジナル) /