xml:Element e = xml`<p:e xmlns:p="http://example.com/"/>`;
// `name` will be `{http://example.com}e`.
string name = e.getName();

XML namespaces

The goal is to support namespaces without adding complexity if you don’t use them. The ns:x qualified name in XML is expanded into {url}x where url is the namespace name bound to ns. The XML namespace declarations are kept as attributes using the standard binding of xmlns.

xml:Element e = xml`<p:e xmlns:p="http://example.com/"/>`;
string name = e.getName();

name will be {http://example.com}e.

bal run xml_namespaces.bal