vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Class Node

Represents a single node in the DOM tree.

class Node ;

Constructors

NameDescription
this (loc, name, attributes, contents, attribs, translation_key) Constructs a new node.

Fields

NameTypeDescription
attribs NodeAttribsFlags that control the parser and generator behavior.
attributes Attribute[]A key-value set of attributes.
contents NodeContent[]The main contents of the node.
loc LocationStart location of the node in the source file.
name stringName of the node
translationKey stringOriginal text used to look up the translation (only set if translated)

Properties

NameTypeDescription
class_[get] inout(Attribute)Returns "class" attribute - a white space separated list of style class identifiers.
id[get] inout(Attribute)Returns the "id" attribute.

Methods

NameDescription
addText (text, loc) Adds a piece of text to the node's contents.
clone ()
getAttribute (name) Returns a given named attribute.
hasAttribute (name)
hasNonWhitespaceContent () Determines if this node has any non-whitespace contents.
isProceduralTextNode () Tests if the node consists only of text and interpolations, but doesn't contain child nodes.
isTextNode () Tests if the node consists of only a single, static string.
opEquals (other)
opEquals (other_) Compares all properties of two nodes for equality.
setAttribute (att)
stripIfOnlyWhitespace () Removes all content if it conists of only white space.
stripLeadingWhitespace () Strips any leading whitespace from the contents.
stripTrailingWhitespace () Strips any trailign whitespace from the contents.
toString () Outputs a simple string representation of the node.

Enums

NameDescription
SpecialName A set of names that identify special-purpose nodes
Authors
Copyright
License