Skip to content

Reading up to a corresponding closing tag? #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vabr-g opened this issue Apr 10, 2025 · 0 comments
Open

Reading up to a corresponding closing tag? #36

vabr-g opened this issue Apr 10, 2025 · 0 comments

Comments

@vabr-g
Copy link

vabr-g commented Apr 10, 2025

As we start migrating projects in our code base from other XML parsers to xml-rs, we hit a repeating use-case based on processing a sub-tree in the XML structure:

  1. Read a StartElement.
  2. Continue calling EventReader.next and processing the results...
  3. ...until an EndElement corresponding to the start one from step 1. is found.

There is EventReader.skip which performs steps 1. and 3., but not 2.

Would people on this project be interested in getting a variant of next (called next_in_subtree or similar) which would stop providing results once it reaches the corresponding end tag? I'm happy to contribute the code, but wanted to check ahead if that would be welcome.

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

No branches or pull requests

1 participant