Statifier.Parser.DOM.Text (Statifier v2.0.0)

Copy Markdown View Source

A run of character data between two markup constructs.

value is the standard XML entities expanded, CDATA sections unwrapped, and XML 1.0 2.11 line-break folding applied (ADR-0045): a literal pair and a literal lone in the raw run each become one , while a decoded from a character reference such as &#xD; survives as . location spans the raw source the run came from, which is why the two are separate fields: the raw span still contains the &amp; sequences, <![CDATA[ delimiters, any comment or processing instruction the run straddles, and the unfolded / bytes, none of which value does, so offsets inside value do not map onto the source one for one when any of them is present.

One node covers a whole run. A single run reaches the handler as several events whenever an entity reference or a CDATA section splits it, and those are coalesced back into one node - a text run is a property of the document, not of Saxy's event granularity.

Summary

Types

t()

@type t() :: %Statifier.Parser.DOM.Text{
  location: Statifier.Parser.Location.t(),
  value: binary()
}