sax :: Context :: declare_prefix
# Declare a Namespace prefix for this context.
#
# Parameters:
#
# * `prefix`: prefix to declare.
# * `uri`: associated Namespace URI.
#
# SEE: `NamespaceSupport.declare_prefix`
fun declare_prefix(prefix: String, uri: String) do
assert legal_state: decls_ok else
sys.stderr.write("Can't declare any more prefixes in this context.\n")
end
# Lazy processing...
if not decl_seen then
copy_tables
end
if "" == prefix then
if "" == uri then
default_ns = null
else
default_ns = uri
end
else if "" == uri then
prefix_table.keys.remove(prefix)
else
prefix_table[prefix] = uri
end
declarations.push(prefix)
end
lib/sax/helpers/namespace_support.nit:462,2--492,4