dart-xml icon indicating copy to clipboard operation
dart-xml copied to clipboard

This is a great package, but needs XPath!

Open RandalSchwartz opened this issue 3 years ago • 2 comments

The other XPath pub packages don't provide as much diligence in parsing the XML, but this package is missing XPath, which would make it far more useful for parsing and traversing trees. Any chance that's in the works? I'm not willing to do all the work, but I could help you out if you needed.

RandalSchwartz avatar Apr 05 '21 01:04 RandalSchwartz

I am not familiar with XPath. Personally I think it is more convenient to use plain Dart (including your preferred IDE, debugging tools, ...) to traverse and query XML. That said, it should be easy to make one of the existing XPath implementations work on the DOM of this package?

renggli avatar Apr 05 '21 10:04 renggli

I think maybe I could come up with a petitparser XPath description, although there is some trickiness around namespaces and the built-in expressions. I would also need help designing it so that the semantics of execution using the XML package's interface got wired up properly. The XPath specification has a fairly decent BNF.

RandalSchwartz avatar Apr 09 '21 21:04 RandalSchwartz

There will be some basic support for a subset of XPath with the upcoming version 7.0.0.

Documentation: https://github.com/renggli/dart-xml#xpath Demo: https://petitparser.github.io/examples/xml/xml.html

Marking this as closed, please report missing features and bugs as new issues.

renggli avatar Feb 26 '23 11:02 renggli

Excellent, thank you! Yeah, I've been following the progress.

RandalSchwartz avatar Feb 26 '23 18:02 RandalSchwartz