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 for namespaces, but no added complexity if you don’t use them. Qualified name ns:x in XML is expanded into `{url}x where url is the namespace name bound to ns. XML namespace declarations are kept as attributes using standard binding of xmlns to http://www.w3.org/2000/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