An <assign> executable-content element: spec 5.4's deep-path datamodel
write.
Two spans that are not the same thing
This struct carries two fields that are easy to confuse and must not be:
locationis the SCXMLlocationattribute's own value - the raw, uncompiled path expression ("foo.bar.baz","items[0]") an<assign>writes to. It is required (spec 5.4.2, "the value of the 'location' attribute MUST specify a valid location"), so it is@enforce_keys'd; resolving it against the datamodel happens at runtime (Statifier.Machine.Content.Assign), never here -lib/statifier/document.ex's moduledoc forbidsPredicatoranywhere underlib/statifier/document/.node_locationis this<assign>element's ownStatifier.Parser.Locationspan in the source document - what every other Document node callslocation. It is renamed here specifically so a reader (or a pattern match) can never mistake the path string for the element's span, or vice versa; it is also@enforce_keys'd, since every node has one.
expr is the value source read from the expr attribute - raw,
uncompiled predicator source, nilable. text is
Statifier.Parser.DOM.text/1's verbatim, untrimmed concatenation of
<assign>'s direct text children (verbatim except for the parser's XML
1.0 2.11 line-break fold - ADR-0045), mirroring Statifier.Document.Data.text
and Statifier.Document.Content.text); expr and text are both
representable on this struct at once, on purpose, so
Statifier.Validator.Checks.Assign can report the pair rather than
lowering refusing to build one (the same division of labour
Statifier.Document.Content's moduledoc states).
Summary
Types
@type t() :: %Statifier.Document.Assign{ attribute_locations: Statifier.Document.attribute_locations(), expr: String.t() | nil, location: String.t(), node_location: Statifier.Parser.Location.t(), text: String.t() | nil }