I have two XML trees and would like to add one tree as a leaf to the other one.
Apparently:
$tree2->addChild('leaf', $tree1);
doesn't work, as it copies only the first root node.
Ok, so then I thought I would traverse the whole first tree, adding every element one by one to the second one.
But consider XML like this:
<root>
aaa
<bbb/>
ccc
</root>
How do I access "ccc"? tree1->children()
returns just "bbb"... .
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…