DomNode

A dom node.

Constructors

this
this(DomNode parent)

Creates a new dom node.

Members

Functions

addAttribute
void addAttribute(DomAttribute attribute)

Adds an attribute to the node.

addAttribute
void addAttribute(string name, string value)

Adds an attribute to the node.

addChild
void addChild(DomNode child)

Adds a child to the dom node.

clearAttributes
void clearAttributes()

Clears the attributes of the node.

getAttribute
DomAttribute getAttribute(string name)

Gets an attribute from the node.

getAttributeNames
string[] getAttributeNames()

Gets all attribute names.

getAttributes
DomAttribute[] getAttributes()

Gets all attributes.

getByAttribute
DomNode[] getByAttribute(string name, string value, bool searchChildren)

Gets all nodes by an attribute.

getByAttributeName
DomNode[] getByAttributeName(string name, bool searchChildren)

Gets all nodes by an attribute name.

getByTagName
DomNode[] getByTagName(string tagName, bool searchChildren)

Gets all nodes by a tag name.

getElementById
DomNode getElementById(string id)

Gets a dom node by an attribute named "id" matching the given value.

hasAttribute
bool hasAttribute(string name)

Checks whether an attribute is present within the node or not.

hasAttribute
bool hasAttribute(string name, string value)

Checks whether an attribute is present within the node or not.

hasAttributeContains
bool hasAttributeContains(string name, string value)

Checks whether an attribute is present within the node or not and contains the value as a word.

hasAttributeEndsWith
bool hasAttributeEndsWith(string name, string value)

Checks whether an attribute is present within the node or not and ends with the value given.

hasAttributeStartsWith
bool hasAttributeStartsWith(string name, string value)

Checks whether an attribute is present within the node or not and starts with the value given.

hasAttributeSubstring
bool hasAttributeSubstring(string name, string value)

Checks whether an attribute is present within the node or not and contains a substring with the value given.

opCmp
int opCmp(Object o)

Operator overload.

opEquals
bool opEquals(Object o)

Operator overload.

querySelector
DomNode querySelector(string selector)

Queries the first dom node based on a css3 selector.

querySelectorAll
DomNode[] querySelectorAll(string selector)

Queries all dom nodes based on a css3 selector.

removeAttribute
void removeAttribute(string name)

Removes an attribute from the node.

toOuterString
string toOuterString()

Converts the node to a properly formatted dom outer node-string.

toString
string toString(size_t index)

Converts the node to a properly formatted dom node-string.

toString
string toString()

Converts the node to a properly formatted dom node-string.

Properties

children
DomNode[] children [@property getter]

Gets the children of the node.

isTextNode
bool isTextNode [@property getter]

Gets a boolean determining whether the node is a text node or not.

isTextNode
bool isTextNode [@property setter]

Sets a boolean determining whether the node is a text node or not.

name
string name [@property getter]

Gets the name of the node.

name
string name [@property setter]

Sets the name of the node.

parent
DomNode parent [@property getter]

Gets the parent of the node.

parserSettings
DomParserSettings parserSettings [@property getter]

Gets the settings used to parse the dom node.

parserSettings
DomParserSettings parserSettings [@property setter]

Sets the settings used to parse the dom node.

rawText
string rawText [@property setter]

Sets the raw text of the node.

text
string text [@property getter]

Gets the text of the node.

text
string text [@property setter]

Sets the text of the node. If the text contains valid dom, then it'll be parsed. To just set the text without parsing use rawText.

Meta