If more than one prefix is currently mapped to the same
URI, this method will make an arbitrary selection; if you
want all of the prefixes, use the prefixes_of
method instead.
Note: this will never return the empty (default) prefix;
to check for a default prefix, use the uri
method with an argument of ""
.
Parameters:
uri
: Namespace URI.Returns:
One of the prefixes currently mapped to the URI supplied,
or null
if none is mapped or if the URI is assigned to
the default Namespace.
SEE: prefixes_of
SEE: uri
# Return one of the prefixes mapped to a Namespace URI.
#
# If more than one prefix is currently mapped to the same
# URI, this method will make an arbitrary selection; if you
# want all of the prefixes, use the `prefixes_of` method instead.
#
# Note: this will never return the empty (default) prefix;
# to check for a default prefix, use the `uri`
# method with an argument of `""`.
#
# Parameters:
#
# * `uri`: Namespace URI.
#
# Returns:
#
# One of the prefixes currently mapped to the URI supplied,
# or `null` if none is mapped or if the URI is assigned to
# the default Namespace.
#
# SEE: `prefixes_of`
#
# SEE: `uri`
fun prefix(uri: String): nullable String do
return current_context.prefix(uri)
end
lib/sax/helpers/namespace_support.nit:313,2--338,4