Skip to content

v0.4.1

Latest

Choose a tag to compare

@mathieu17g mathieu17g released this 05 Jul 09:53
ace4398

New convenience API for element-only child iteration (#78, #80):

  • eachelement(node) — lazy iterator over the child elements of a Node or LazyNode, skipping the whitespace Text nodes that v0.4 preserves on pretty-printed documents (and every other non-element node).
  • elements(node) — the collected Vector counterpart.
for el in eachelement(node)
    # el is an Element node
end

The LazyNode method streams via eachchildnode, so no intermediate child vector is materialized. The migration guide now teaches this as the idiomatic element-only loop — the manual nodetype filter remains the form that also runs on 0.3.x.

Non-breaking addition: any environment with XML = "0.4" compat picks it up on update.

Full changelog: CHANGELOG.md