Ensure that stanza plugins work as expected if the XML is appended.

This commit is contained in:
Lance Stout 2011-12-28 09:53:22 -05:00
parent e8545dd2bc
commit 1a61bdb302

View file

@ -345,7 +345,8 @@ class ElementBase(object):
"""
if attrib not in self.plugins:
plugin_class = self.plugin_attrib_map[attrib]
plugin = plugin_class(parent=self)
existing_xml = self.xml.find(plugin_class.tag_name())
plugin = plugin_class(parent=self, xml=existing_xml)
self.plugins[attrib] = plugin
if plugin_class in self.plugin_iterables:
self.iterables.append(plugin)