Build up prefix history for nested elements

        The following keys are used in :py:attr:`self.env.ref_context`:

            dn:prefixes
                Stores the prefix history. With each nested element, we add the
                prefix to a list of prefixes. When we exit that object's nesting
                level, :py:meth:`after_content` is triggered and the prefix is
                removed from the end of the list.

            dn:prefix
                Current prefix. This should reflect the last element in the
                prefix history

def before_content(self):
        """Build up prefix history for nested elements

        The following keys are used in :py:attr:`self.env.ref_context`:

            dn:prefixes
                Stores the prefix history. With each nested element, we add the
                prefix to a list of prefixes. When we exit that object's nesting
                level, :py:meth:`after_content` is triggered and the prefix is
                removed from the end of the list.

            dn:prefix
                Current prefix. This should reflect the last element in the
                prefix history
        """
        super(DotNetObjectNested, self).before_content()
        if self.names:
            (_, prefix) = self.names.pop()
            try:
                self.env.ref_context['dn:prefixes'].append(prefix)
            except (AttributeError, KeyError):
                self.env.ref_context['dn:prefixes'] = [prefix]
            finally:
                self.env.ref_context['dn:prefix'] = prefix