Finds the prefix associated with the specified namespace URI in the specified XML document context(s).
Parameters:
namespaceURI
The namespace URI by which the corresponding prefix is to be found.
contextElement
Specifies the element that determines the XML document context (i.e. position on the XML document's tree) against which the prefix is to be resolved.In particular, that is done as the following. With each element in the XML document, a certain number of namespace URI/prefix bindings may be associated. The function looks for the binding that contains the specified namespace URI. If such a binding is found the function returns the prefix defined in it.
contextElements
Specifies the enumeration of elements that determine different XML document contexts.The function starts from the first element and uses it to resolve the prefix (as described at
contextElement
parameter).If the element's context does not defines a binding for the given namespace URI, the function tries the next element from the enumeration and repeats so until the binding found or the last element reached.
Note: When neither contextElement
nor contextElements
parameter is specified, the generator context element will be used by default.
Returns:
The found prefix or an empty string, if no binding for the given namespace URI can be found.
See Also:
findNSByPrefix()