thagenbeek / phpquery

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

Appending won't consider hierarchy #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. $pq = phpQuery::newDocument("");
2. $pq->prepend("<input />");
3. $pq->prepend("<label>");
4. $label = $pq->find("label:last");            
5. $label->append("<a href=\"#\"><img src=\"\" alt=\"test\" /></a>"); 

What is the expected output? What do you see instead?
I expect this:
  <label>
    <a href="#">
      <img src="" alt="test" />
    </a>
  </label>
  <input>

And I get this:
  <label>
  </label>
  <a href="#">
  </a>
  <img src="" alt="test">
  <input>

What version of the product are you using? On what operating system?
version 0.9.4 RC1, winXP, Apache, PHP5

Please provide any additional information below.
All the methods to put a node tree inside another element will put nodes as
siblings, in spite of the original hierarchy.

Original issue reported on code.google.com by jpbco...@yahoo.com on 15 Oct 2008 at 12:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
It seems to be because of the DOM "importNode" method, which imports the nodes
recursively, if "deep" argument is set to TRUE, and puts them as siblings.

Original comment by jpbco...@yahoo.com on 15 Oct 2008 at 8:16

GoogleCodeExporter commented 9 years ago
Check issue 60 (r202)
http://code.google.com/p/phpquery/issues/detail?id=60

Original comment by tobiasz....@gmail.com on 16 Oct 2008 at 12:08

GoogleCodeExporter commented 9 years ago

Original comment by tobiasz....@gmail.com on 21 Oct 2008 at 10:33