DOMEntity.name

Gives the name of this DOMEntity.

Note that this is the direct name in the XML for this entity and does not contain any of the names of any of the parent entities that this entity has.

Supported EntityTypes:
elementStart
elementEnd
elementEmpty
pi
struct DOMEntity(R)
@property
name
()

Examples

import std.range.primitives : empty;

auto xml = "<root>\n" ~
           "    <empty/>\n" ~
           "    <?pi?>\n" ~
           "</root>";

auto dom = parseDOM(xml);
assert(dom.type == EntityType.elementStart);
assert(dom.name.empty);

auto root = dom.children[0];
assert(root.type == EntityType.elementStart);
assert(root.name == "root");

assert(root.children[0].type == EntityType.elementEmpty);
assert(root.children[0].name == "empty");

assert(root.children[1].type == EntityType.pi);
assert(root.children[1].name == "pi");

See Also

Meta