Skip to content

UPSTREAM PR #16804: feat(std-rfc/xml xaccess): experimental rewrite of std/xml xaccess#121

Open
loci-dev wants to merge 9 commits into
mainfrom
loci/pr-16804-std-rfc-xml
Open

UPSTREAM PR #16804: feat(std-rfc/xml xaccess): experimental rewrite of std/xml xaccess#121
loci-dev wants to merge 9 commits into
mainfrom
loci/pr-16804-std-rfc-xml

Conversation

@loci-dev

Copy link
Copy Markdown

Note

Source pull request: nushell/nushell#16804

I wrote this a while back and just forgot to make a PR.

AFAIK reducing multiple closures into a single one is (at least in nushell) a novel approach. This is why it's "experimental".

  • adds descendant // support using ** syntax
  • uses ...rest param rather than a single list
    • params can be cell-path, closure, or a list
    • lists are flattened into the rest param, making the api backwards compatible with the existing implementation
    • closures are for filtering, kind of like having a where command in a pipeline
  • Rather than reducing data by repeatedly applying closures, it reduces multiple closures into a single closure, and runs the data through it. This makes multiple operations into a single pipeline without collecting between operations.

Usage example:

http get 'https://www.nushell.sh/rss.xml'
| xml xaccess **.item.title.*

cc: @weirdan I remember you working with xml, so I would like your take on this.

Release notes summary - What our users need to know

TODO

Tasks after submitting

N/A

Bahex added 9 commits March 15, 2026 21:49
- adds descendant `//` support using `**` syntax
- uses ...rest param rather than a single list
  - params can be cell-path, closure, or a list
  - lists are flattened into the rest param, making the api backwards
    compatible with the existing implementation
- Rather than reducing data by repeatedly applying closures, it reduces
  multiple closures into a single closure, and runs the data through it.
  This makes multiple operations into a single pipeline without collecting
  between operations
@loci-dev loci-dev force-pushed the main branch 2 times, most recently from d6c3b3e to aa2e4e6 Compare March 18, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants