Yex.XmlElementPrelim (y_ex v0.7.3)

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

Types

t()

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

Functions

empty(tag)

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