Class: XmlElement

badge-maker/lib/xml~XmlElement(attrs)

Representation of an XML element

Constructor

new XmlElement(attrs)

Xml Element Constructor

Parameters:
Name Type Description
attrs object

Refer to individual attrs

Properties
Name Type Attributes Default Description
name string

Name of the XML tag

content Array.<(string|module:badge-maker/lib/xml-element~XmlElement)> <optional>
[]

Array of objects to render inside the tag. content may contain a mix of string and XmlElement objects. If content is [] or ommitted the element will be rendered as a self-closing element.

attrs object <optional>
{}

Object representing the tag's attributes as name/value pairs

Source:

Methods

render() → {string}

Render the XML element to a string, applying appropriate escaping

Source:
Returns:

String representation of the XML element

Type
string