Navigate native data with small, readable expressions

dom::chain(values) wraps retained CEM values in an immutable collection. Navigate, filter and reorder it with Rust-style methods and |item| expression callbacks. Missing results become empty chains; no unwrap() is needed.

XML, JSON, YAML and CSV enter through CEM-ML import. These methods operate on the resulting CEM tree. They reuse nodes and preserve their original parents. Sorting buffers handles and keys under the environment's resource limits; it never rearranges the source tree.

Selection and transformation return chains. Explicit questions such as any() and count() return scalars. Use next(), zero-based nth(n), rev() and rfind() for Rust-style selection. Invalid types, callback failures and denied access remain errors.

Unlike Rust's Iterator::find(), this collection's find() returns a chain containing zero or one member. Existing .children and dom:children() continue to include every child-node kind.

See also

Chain API reference · Cell template overrides · XPath and CEM-QL node use cases · String functions