Namespaces topic

XML namespaces are fun! Right? ðŸĪŠ Fortunately you can mostly ignore them.

A case where you need to specify them is when appending an element to a parent that belongs to a different namespace; typically, to create a div inside a SVG foreignObject element:

d4
    .create("svg")
    .append("foreignObject".u22)
    .attrSet("width", 300.toString().u22)
    .attrSet("height", 100.toString().u22)
    .append("xhtml:div".u22)
    .textSet("Hello, HTML!".u22);

Properties

namespaces → Map<String, String> Namespaces
The map of registered namespace prefixes. The initial value is:
final
namespaces → Map<String, String> Namespaces
The map of registered namespace prefixes. The initial value is:
final
namespaces → Map<String, String> Namespaces
The map of registered namespace prefixes. The initial value is:
final

Functions

namespace(String name) → Union2<Map<String, String>, String> Namespaces
Qualifies the specified name, which may or may not have a namespace prefix.
namespace(String name) → Union2<Map<String, String>, String> Namespaces
Qualifies the specified name, which may or may not have a namespace prefix.
namespace(String name) → Union2<Map<String, String>, String> Namespaces
Qualifies the specified name, which may or may not have a namespace prefix.