XmlBuilder
A fluent builder for constructing XML nodes programmatically.
Provides factory methods for creating XML nodes and an ElementBuilder class for building elements with a fluent API.
Example:
val elem = XmlBuilder.element("root")
.attr("id", "1")
.attr("class", "main")
.child(XmlBuilder.element("child").text("content").build)
.build
Attributes
- Source
- XmlBuilder.scala
- Graph
-
- Supertypes
- Self type
-
XmlBuilder.type
Members list
Type members
Classlikes
A fluent builder for constructing XML elements.
A fluent builder for constructing XML elements.
Accumulates attributes and children, allowing them to be added in any order via method chaining.
Value parameters
- attributes
-
Accumulated attributes
- children
-
Accumulated children
- name
-
The element name
Attributes
- Source
- XmlBuilder.scala
- Supertypes
Value members
Concrete methods
Creates a CData node with the given content.
Creates a CData node with the given content.
Value parameters
- value
-
The CDATA content
Attributes
- Returns
-
A CData node
- Source
- XmlBuilder.scala
Creates a Comment node with the given content.
Creates a Comment node with the given content.
Value parameters
- value
-
The comment content
Attributes
- Returns
-
A Comment node
- Source
- XmlBuilder.scala
Creates an ElementBuilder for constructing an element with the given local name.
Creates an ElementBuilder for constructing an element with the given local name.
Value parameters
- name
-
The local name of the element
Attributes
- Returns
-
An ElementBuilder for fluent construction
- Source
- XmlBuilder.scala
Creates an ElementBuilder for constructing an element with the given XmlName.
Creates an ElementBuilder for constructing an element with the given XmlName.
Value parameters
- name
-
The XmlName (possibly with namespace) of the element
Attributes
- Returns
-
An ElementBuilder for fluent construction
- Source
- XmlBuilder.scala
Creates a ProcessingInstruction node with the given target and data.
Creates a ProcessingInstruction node with the given target and data.
Value parameters
- data
-
The processing instruction data
- target
-
The processing instruction target
Attributes
- Returns
-
A ProcessingInstruction node
- Source
- XmlBuilder.scala
Creates a Text node with the given content.
Creates a Text node with the given content.
Value parameters
- value
-
The text content
Attributes
- Returns
-
A Text node
- Source
- XmlBuilder.scala