ddn.data.xml.dom.element
DOM element node.
class XmlElement
Types 1
classXmlElement : XmlParentNode
A DOM element.
Fields
XmlQName nameElement name (QName).private XmlAttribute[] _attributesprivate XmlNamespaceContext _namespacesMethods
XmlElement[] getElementsByTagName(string tagname) @safeReturns all descendant elements with the given tag name.int opApply(scope int delegate(size_t, XmlElement) @safe dg) @safeAllows iterating over child elements using `foreach`.XmlNamespace[] namespaceDeclarations() const @safeReturns namespace declarations that were declared directly on this element.void declareNamespace(string prefix, string uri) @safeDeclares (or re-declares) a namespace prefix on this element.string lookupNamespaceUri(string prefix) const @safe nothrowLooks up a namespace URI for `prefix` in this element's scope.inout(XmlAttribute)[] attributes() @property inout @safeReturns the element's attributes in insertion order.@property auto byAttribute() const @safeReturns a range for iterating over the element's attributes.void addAttribute(string qname, string value, XmlLocation location = XmlLocation.init) @safeAdds an attribute.void setAttribute(string qname, string value, XmlLocation location = XmlLocation.init) @safeSets an attribute value, adding the attribute if it does not exist.inout(XmlAttribute) getAttributeNodeNS(string namespaceUri, string localName) inout @safeLooks up an attribute node by namespace URI and local name.void removeAttributeNS(string namespaceUri, string localName) @safeRemoves an attribute by namespace URI and local name.void opIndexAssign(string value, string attrName) @safeAllows setting an attribute value using index syntax.bool opBinaryRight(string op : "in")(string attrName) const @safeAllows checking if an attribute exists using the `in` operator.string getAttributeNS(string namespaceUri, string local) const @safe nothrowLooks up an attribute by expanded name.bool hasAttributeNS(string namespaceUri, string local) const @safe nothrowReturns `true` if the element has an attribute with the given expanded name.Constructors
this(XmlQName name, XmlLocation location = XmlLocation.init)Constructs an element from a validated `XmlQName`.this(string qname, XmlLocation location = XmlLocation.init)Constructs an element by parsing and validating a QName.