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

def suds::sax::element::Element::findPrefix (   self,
  uri,
  default = None 
)

Find the first prefix that has been mapped to a namespace URI.
The local mapping is searched, then it walks up the tree until
it reaches the top or finds a match.
@param uri: A namespace URI.
@type uri: basestring
@param default: A default prefix when not found.
@type default: basestring
@return: A mapped prefix.
@rtype: basestring

Definition at line 573 of file element.py.

00573                                            :
        """
        Find the first prefix that has been mapped to a namespace URI.
        The local mapping is searched, then it walks up the tree until
        it reaches the top or finds a match.
        @param uri: A namespace URI.
        @type uri: basestring
        @param default: A default prefix when not found.
        @type default: basestring
        @return: A mapped prefix.
        @rtype: basestring
        """
        for item in self.nsprefixes.items():
            if item[1] == uri:
                prefix = item[0]
                return prefix
        for item in self.specialprefixes.items():
            if item[1] == uri:
                prefix = item[0]
                return prefix      
        if self.parent is not None:
            return self.parent.findPrefix(uri, default)
        else:
            return default

    def findPrefixes(self, uri, match='eq'):


Generated by  Doxygen 1.6.0   Back to index