Add the ability to chain reader methods on `Element` class
It would be really cool if you could use the search/reader methods on the base Element class that comes from the reader.
$reader = XmlReader::fromString(...);
$element = $reader->element('food.2')->sole();
$element->element('name')->sole();
$element->value('name')->sole();
$element->xpathElement('//name')->sole();
$element->xpathValue('//name')->sole();
I've started implementing this as a proof-of-concept.
Are there currently any plans to update and merge the branch with this feature?
In my use case this is essential to efficiently handle large files (15-50k lines). Part of the difficulty I am having is that I don't see a way to chain queries. For example, I would like to get elements based on tags and attributes, then I would like to reuse that result for multiple different queries to get specific content within that tag.
Am I just missing how this is supposed to work? I couldn't see a way to chain query results in the Query model.