MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / resolvePrefix

Method resolvePrefix

suds/sax/element.py:505–526  ·  view source on GitHub ↗

Resolve the specified prefix to a namespace. The I{nsprefixes} is searched. If not found, it walks up the tree until either resolved or the top of the tree is reached. Searching up the tree provides for inherited mappings. @param prefix: A namespace prefix

(self, prefix, default=Namespace.default)

Source from the content-addressed store, hash-verified

503 return detached
504
505 def resolvePrefix(self, prefix, default=Namespace.default):
506 """
507 Resolve the specified prefix to a namespace. The I{nsprefixes} is
508 searched. If not found, it walks up the tree until either resolved or
509 the top of the tree is reached. Searching up the tree provides for
510 inherited mappings.
511 @param prefix: A namespace prefix to resolve.
512 @type prefix: basestring
513 @param default: An optional value to be returned when the prefix
514 cannot be resolved.
515 @type default: (I{prefix},I{URI})
516 @return: The namespace that is mapped to I{prefix} in this context.
517 @rtype: (I{prefix},I{URI})
518 """
519 n = self
520 while n is not None:
521 if prefix in n.nsprefixes:
522 return (prefix, n.nsprefixes[prefix])
523 if prefix in self.specialprefixes:
524 return (prefix, self.specialprefixes[prefix])
525 n = n.parent
526 return default
527
528 def addPrefix(self, p, u):
529 """

Callers 12

namespaceMethod · 0.95
getAttributeMethod · 0.95
getChildMethod · 0.95
getChildrenMethod · 0.95
refitPrefixesMethod · 0.95
add_prefixMethod · 0.45
genprefixMethod · 0.45
childAtPathMethod · 0.45
nsdeclarationsMethod · 0.45
__childrenAtPathMethod · 0.45
refitValueMethod · 0.45
qualifyFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected