Logo Search packages:      
Sourcecode: suds version File versions  Download package

def suds::sax::element::Element::promotePrefixes (   self  ) 

Push prefix declarations up the tree as far as possible.  Prefix
mapping are pushed to its parent unless the parent has the
prefix mapped to another URI or the parent has the prefix.
This is propagated up the tree until the top is reached.
@return: self
@rtype: L{Element}

Definition at line 623 of file element.py.

00623                              :
        """
        Push prefix declarations up the tree as far as possible.  Prefix
        mapping are pushed to its parent unless the parent has the
        prefix mapped to another URI or the parent has the prefix.
        This is propagated up the tree until the top is reached.
        @return: self
        @rtype: L{Element}
        """
        for c in self.children:
            c.promotePrefixes()
        if self.parent is None:
            return
        for p,u in self.nsprefixes.items():
            if p in self.parent.nsprefixes:
                pu = self.parent.nsprefixes[p]
                if pu == u:
                    del self.nsprefixes[p]
                continue
            if p != self.parent.prefix:
                self.parent.nsprefixes[p] = u
                del self.nsprefixes[p]
        return self
    
    def refitPrefixes(self):


Generated by  Doxygen 1.6.0   Back to index