私は持っています:
<nodes>
<node>
<name>node1</name>
<other>stuff1</other>
<node>
<name>node11</name>
<other>stuff11</other>
</node>
<node>
<name>node12</name>
<other>stuff12</other>
</node>
</node>
<node>
<name>node2</name>
<other>stuff2</other>
</node>
<node>
<name>node3</name>
<other>stuff3</other>
</node>
</nodes>
私は次のようなフラットな構造になりたいです:
<nodes>
<node>
<name>node1</name>
<other>stuff1</other>
</node>
<node>
<name>node11</name>
<other>stuff11</other>
</node>
<node>
<name>node12</name>
<other>stuff21</other>
</node>
<node>
<name>node2</name>
<other>stuff2</other>
</node>
<node>
<name>node3</name>
<other>stuff3</other>
</node>
</nodes>
これは単純な例ですが、ネストされた「ノード」要素ではなく、各ノードのすべての要素をコピーしたいと思います。タグを保持するためにcopy-ofを試しましたが、ネストも保持されます。私もコピーを試しましたが、それはすべての子供を除外します。
何か案は?