mfr.xml

This XML API was in part inspired from XOM.

abstract class Node;

Base class for all nodes of the XML document model.

class Document;

Document object at root of the XML document model.

Example:

auto doc = new Document;
doc.read("<hello>world</hello>");

Element root;

The document's root element.

Node[] nodes;

List of nodes at the root of the document.

void read(string input);

Read the document from the given XML input.

Params:
string input XML input to read the document from.

Throws: at any well-formness error. The document will contain the tree that was built up to the error point.

Note: read will replace any existing content in the document.

class Element: mfr.xml.Node;

Element node for the XML document model.

Document document;

Document this element belongs to.

string name;

Name of this element.

immutable(char)[][immutable(char)[]] attr;

Attributes of this element.

Node[] nodes;

Content of this elements.

this(Document document, string name);

Create a new Element with the given name.

Params:
Document document the document this elements fits in.
string name the name of this element.
class PI: mfr.xml.Node;

Processing instruction node for the XML document model.

string target;

Target processor of this PI.

string content;

Content of this PI.

this(string target, string content);

Create a new PI for the given target and content.

Params:
string target name of the target processor
string content content of this processor instruction
class Comment: mfr.xml.Node;

Comment node for the XML document model.

string content;

Content of this comment.

this(string content);

Create a new Comment with the given content.

Params:
string content textual content of this comment.
class Text: mfr.xml.Node;

Represents a run of text. CDATA sections are not treated differently than normal text. Text objects may be adjacent to other Text objects.

string content;

Content of this text node.

this(string content);

Create a new Text with the given content.

Params:
string content textual content of this text node.