Native FormCalc Node Lists

Native FormCalc event execution supports node lists without enabling JavaScript or installing a script provider, including live child views on Data, Form and Template nodes and independent query collections

Live children and independent membership

node.nodes retains the actual owner, including an empty owner, and reflects later child insertions, removals and moves within the current execution context

resolveNodes(path), all, classAll and a list's clone() expose independent collection membership; editing that membership does not move or remove document nodes, and cloning a list does not clone its nodes

MemberBehavior
lengthCurrent number of members
classNameNodeList
item(index) or list[index]Member at a zero-based position, or null outside the list
namedItem(name)First member with the requested public name, or null when absent
append(node)Append a node to live children or independent membership
insert(node, before)Insert before an existing member
remove(node)Remove the child or the first matching independent member
clone()Create an independent membership copy

item requires a finite, nonnegative integer number; string, negative and fractional arguments return null

Moving nodes

var children = $data.main.right.nodes
var moved = Ref($data.main.left.a)
children.append(moved)
this.parent.marker.rawValue = moved.parent.name

The example moves the actual Data node and observes its new parent, without cloning the node

Live views remain node lists when copied to a variable or passed to a function; independent query results and clones retain ordinary FormCalc value-copy rules, so a normal variable assignment can copy member values instead of retaining node handles

foreach snapshots the collection membership before the first loop body executes; appending children during the loop does not extend that iteration

Data metadata and text

Data child views use the published Data model, including live metadata-backed nodes and public mixed-content text units, while excluding comments, processing instructions and hidden opaque descendants

A text unit has an empty public name, so namedItem("") selects the first unnamed text member; metadata and text parent reads follow their actual owner

index and all use the mapping-derived name, while classIndex and classAll use the current Data class over the same projected siblings

Typed removal preserves an addressable detached node for reinsertion during the same execution, including metadata, text and detached subtrees; held references do not revive nodes retired by model replacement or remerge

Attributes on a temporarily detached Form property or its property descendants remain writable before reinsertion, with the same ownership, value and resource checks as typed structural operations

Transactions and execution scope

Live edits use the existing typed Data, Form and Template operations, retaining model ownership, parent membership, cycle, namespace and resource checks; an invalid edit aborts the event and restores earlier edits in that transaction

Lists belong to their native execution context and expire with it; they are not cross-event containers

This API is available in the native Runtime event path; legacy standalone field evaluation and calculate-only flatten preparation are separate execution routes and do not acquire this context merely by using FormCalc syntax

Related APIs

FormCalc values and references, XFA live child collections and Interactive XFA runtime