Node

Represents a single node in the DOM tree.

Members

Enums

SpecialName
enum SpecialName

A set of names that identify special-purpose nodes

Functions

addText
void addText(string text, Location loc)

Adds a piece of text to the node's contents.

clone
Node clone()
Undocumented in source. Be warned that the author may not have intended to support it.
getAttribute
inout(Attribute) getAttribute(string name)

Returns a given named attribute.

hasAttribute
bool hasAttribute(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
hasNonWhitespaceContent
bool hasNonWhitespaceContent()

Determines if this node has any non-whitespace contents.

isProceduralTextNode
bool isProceduralTextNode()

Tests if the node consists only of text and interpolations, but doesn't contain child nodes.

isTextNode
bool isTextNode()

Tests if the node consists of only a single, static string.

opEquals
bool opEquals(Node other)
Undocumented in source. Be warned that the author may not have intended to support it.
setAttribute
void setAttribute(Attribute att)
Undocumented in source. Be warned that the author may not have intended to support it.
stripIfOnlyWhitespace
void stripIfOnlyWhitespace()

Removes all content if it conists of only white space.

stripLeadingWhitespace
void stripLeadingWhitespace()

Strips any leading whitespace from the contents.

stripTrailingWhitespace
void stripTrailingWhitespace()

Strips any trailign whitespace from the contents.

toString
string toString()

Outputs a simple string representation of the node.

Properties

class_
inout(Attribute) class_ [@property getter]

Returns "class" attribute - a white space separated list of style class identifiers.

id
inout(Attribute) id [@property getter]

Returns the "id" attribute.

Variables

attribs
NodeAttribs attribs;

Flags that control the parser and generator behavior.

attributes
Array!Attribute attributes;

A key-value set of attributes.

contents
Array!(NodeContent*) contents;

The main contents of the node.

loc
Location loc;

Start location of the node in the source file.

name
Array!char name;

Name of the node

translationKey
Array!char translationKey;

Original text used to look up the translation (only set if translated)

Meta