thagenbeek / phpquery

Automatically exported from code.google.com/p/phpquery
0 stars 0 forks source link

->remove($selector) doesn't respect $selector #57

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

echo
phpQuery::newDocument('<div>Chicken</div><span>Horse</span>')->remove('div')->do
cument->saveXML();

What is the expected output?

Horse

What do you see instead?

(nothing)

What version of the product are you using? On what operating system?
latest beta, firefox 3.03, macosx

Please provide any additional information below.

an easy workaround right now is to put the selector before the remove:
phpQuery::newDocument('<div>Chicken</div><span>Horse</span>')->find('div')->remo
ve()->document->saveXML();

Original issue reported on code.google.com by RyanDorw...@gmail.com on 6 Oct 2008 at 8:43

GoogleCodeExporter commented 9 years ago
Selector support was added in r201, but your example wont work. Thats because 
you
have an empty stack and selector filters actually selected elements.

Original comment by tobiasz....@gmail.com on 7 Oct 2008 at 10:18