Skip to content

Add methods to xee-xpath that return xot items #131

@pachi

Description

@pachi

All query methods use an XPath string and a function to convert the resulting item to a Rust value. This is convenient for many cases but having a way to directly get the xot node so it can be used to build another XML document, clone a subtree or manipulate it get more cumbersome.

It would be very convenient for further manipulation, being able to use xpath queries that return xot nodes (a node, many nodes, optional nodes or optional vecs of nodes). Something akin to using |_, item| Ok(item.to_node()?) as convert function.

Maybe just having convenience declarations for those functions so they return atoms, nodes or functions could be also an option, so you could do:

q.option("/doc/item", NODE_FN)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions