Yex.XmlElementPrelim (y_ex v0.13.0)

Copy Markdown View Source

A preliminary xml element. It can be used to early initialize the contents of a XmlElement.

Examples

iex> doc = Yex.Doc.new()
iex> xml = Yex.Doc.get_xml_fragment(doc, "xml")
iex> Yex.XmlFragment.insert(xml, 0,  Yex.XmlElementPrelim.empty("div"))
iex> Yex.XmlFragment.to_string(xml)
"<div></div>"

Summary

Functions

Creates a preliminary xml element with the given tag and no children or attributes.

Creates a preliminary xml element with the given tag, children and attributes.

Types

t()

@type t() :: %Yex.XmlElementPrelim{
  attributes: %{required(binary()) => Yex.input_type()},
  children: [t() | Yex.XmlTextPrelim.t()],
  tag: String.t()
}

Functions

empty(tag)

@spec empty(String.t()) :: t()

Creates a preliminary xml element with the given tag and no children or attributes.

new(tag, children, attributes \\ %{})

@spec new(String.t(), Enumerable.t(), %{
  required(String.t()) => String.t() | Yex.PrelimType.t()
}) :: t()

Creates a preliminary xml element with the given tag, children and attributes.