Skip to content

Reading up to a corresponding closing tag? #36

Open
@vabr-g

Description

@vabr-g

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions