XmlNode

An XML node.

Constructors

this
this(string s)

Create and parse from input.

this
this(XmlNodeType type, string tag)

Create a new node.

Members

Aliases

opDollar
alias opDollar = length
Undocumented in source.

Functions

addAttribute
XmlNode addAttribute(string name, string value)

Set an attribute with the given value.

addChild
XmlNode addChild(XmlNode child)

Add a child node, making this node its parent.

findChild
XmlNode findChild(string tag)

Returns the first immediate child which is a tag and has the tag name tag.

findChildren
XmlNode[] findChildren(string tag)

Returns all immediate children which are a tag and have the tag name tag.

opApply
int opApply(int delegate(ref XmlNode) dg)

Iterates over immediate children.

opIndex
XmlNode opIndex(string tag)

Like findChild, but throws an exception if no such node is found.

opIndex
XmlNode opIndex(string tag, size_t index)

Like findChildren[index], but throws an exception if there are not enough such nodes.

opIndex
XmlNode opIndex(size_t index)

Returns the immediate child with the given index.

toPrettyString
string toPrettyString()

Return pretty-printed XML string (with indentation).

toString
string toString()

Return XML string.

writeTo
void writeTo(XmlWriter output)

Write to an XmlWriter.

Properties

dup
XmlNode dup [@property getter]

Creates a deep copy of this node.

length
size_t length [@property getter]

Returns the number of children nodes.

text
string text [@property getter]

Attempts to retrieve the text contents of this node. <br> tags are converted to newlines.

Variables

attributes
XmlAttributes attributes;

Tag attributes.

children
XmlNode[] children;

Children nodes.

endPos
ulong endPos;

Start and end offset within the input.

parent
XmlNode parent;

Parent node.

startPos
ulong startPos;

Start and end offset within the input.

tag
string tag;

The tag name, or the contents for text / comment / CDATA nodes.

type
XmlNodeType type;

Node type.

Meta