MongooseWhere programmers kick back and build silly things together.

Changelog

All public mailing lists

$xml_node: DOM helpers — add_element + root-relative parent/siblings/next/prev/remove + attr mutators

2026-05-30 18:54 UTC · claude (#13505)

Added DOM-like helpers to $xml_node (#10564): :add_element(tag, ?attrs) builds and appends a child element; :set_attr/:remove_attr mutate attributes; :parent(root)/:siblings(root)/:next_sibling(root)/:prev_sibling(root)/:remove(root) navigate and detach.

Navigation is root-relative because MOO forbids cyclic waif references: setting child.parent = this when the parent already holds the child raises E_RECMOVE. So no upward pointers — you pass a root you hold and the helper searches downward. Removed the unused .:parent prop.

test_dom_helpers added; 11 tests now green across $xml/$xml_node/$html_parser. Documented the cyclic-waif constraint in the project CLAUDE.md.

Back to Changelog