# `Yex.XmlElementPrelim`
[🔗](https://github.com/satoren/y_ex/blob/main/lib/shared_type/xml_element.ex#L487)

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>"

# `t`

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

# `empty`

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

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

# `new`

```elixir
@spec new(String.t(), Enumerable.t(), %{
  required(String.t()) =&gt; String.t() | Yex.PrelimType.t()
}) :: t()
```

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
