GravityPDF / querypath

A fork of QueryPath: a PHP library for HTML(5)/XML querying (CSS 4 or XPath) and processing (like jQuery) with PHP8.3 support
Other
21 stars 2 forks source link

not working: ->find() method with direct child selector #1

Closed jakejackson1 closed 1 year ago

jakejackson1 commented 1 year ago

From querypath created by gordielachance: technosophos/querypath#205

On an item node like this one,

<item>
    <artist>
        <name>Niagara</name>
    </artist>
    <name>Pendant que les champs brûlent</name>
</item>

$node->find('> name');

gets those nodes

<name>Niagara</name>

<name>Pendant que les champs brûlent</name>

while it should only get this one

<name>Pendant que les champs brûlent</name>

Is that a bug ?

I could use

$node->children('name');

But I want to be able to select NOT only direct descendants.

How could I do ? Thanks.

jakejackson1 commented 1 year ago

Has this been fixed / improved since then?