sax :: NamespaceSupport :: prefixes_of
This method returns prefixes mapped to a specific Namespace
URI. The xml
prefix will be included. If you want only one
prefix that's mapped to the Namespace URI, and you don't care
which one you get, use the prefix
method instead.
Note: the empty (default) prefix is never included
in this enumeration; to check for the presence of a default
Namespace, use the uri
method with an argument of ""
.
Parameters:
uri
: The Namespace URI.SEE: prefix
SEE: declared_prefixes
SEE: uri
# Return all prefixes currently declared for an URI.
#
# This method returns prefixes mapped to a specific Namespace
# URI. The `xml` prefix will be included. If you want only one
# prefix that's mapped to the Namespace URI, and you don't care
# which one you get, use the `prefix` method instead.
#
# Note: the empty (default) prefix is *never* included
# in this enumeration; to check for the presence of a default
# Namespace, use the `uri` method with an argument of `""`.
#
# Parameters:
#
# * `uri`: The Namespace URI.
#
# SEE: `prefix`
#
# SEE: `declared_prefixes`
#
# SEE: `uri`
fun prefixes_of(uri: String): Collection[String] do
var prefixes = new Array[String]
var all_prefixes = self.prefixes
for prefix in all_prefixes do
if uri == self.uri(prefix) then
prefixes.push(prefix)
end
end
return prefixes
end
lib/sax/helpers/namespace_support.nit:340,2--370,4