# `Statifier.Document.If.Branch`
[🔗](https://github.com/riddler/statifier-ex/blob/v2.0.0/lib/statifier/document/if.ex#L33)

One partition of an `<if>` - the executable content between one
partitioning tag (`<if>`, `<elseif>`, or `<else>`) and the next, per
`Statifier.Document.If`'s moduledoc.

`cond` is `nil` for the `<else>` branch and for a branch with no `cond`
at all - spec 4.5.1: "`<else>` ... is equivalent to an `<elseif>` with a
'cond' that always evaluates to true." `location` is this branch's own
partitioning tag's span (the `<if>`, `<elseif>`, or `<else>` element
itself), not the `<if>`'s overall span - it is where
`Statifier.Validator.Checks.If` (Phase 3) reports a branch-ordering
error against the *offending* branch rather than the whole `<if>`.
`attribute_locations` carries `:cond`'s value span when the branch wrote
one, following every other node's contract
(`lib/statifier/document.ex:22-44`).

Unlike `Statifier.Document.Assign`, there is no name collision here
between an attribute value and the element's own span, so `location`
keeps its usual meaning and needs no `node_location` rename.

# `t`

```elixir
@type t() :: %Statifier.Document.If.Branch{
  attribute_locations: Statifier.Document.attribute_locations(),
  cond: String.t() | nil,
  content: [Statifier.Document.content_node()],
  location: Statifier.Parser.Location.t()
}
```

---

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