我想将子节点附加到父节点中。
这是 XML。如果我在 order_h 下的 order_no 等于 order_h 中的以下 order_no,我想将 order_d 附加到 order_h
<document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<order>
<order_h owner="GD" order_no="421424" profoma_po="421425">
<order_d owner="GD" item_no="100000014" line_no="1" order_no="421424" color_code="730" manufacturer="100783">
<Size_b assoc_id="69398" row_no="0" pct_ratio="PCT" total_pct="100" priority="0" ship_pack="BULK">
<size_d assoc_id="69398" ship_pack="BULK" ctn_sku="5602060" size_code="XS" alloc_qty="18" plan_pct_ratio="23.5" row_no="0" sort_value="5"/>
</Size_b>
</order_d>
</order_h>
<order_h owner="GD" order_no="421424" profoma_po="421425">
<order_d owner="GD" item_no="100000014" line_no="3" order_no="421424" color_code="002" manufacturer="100783">
</order_d>
</order_h>
<order_h owner="GD" order_no="421424" profoma_po="421425">
<order_d owner="GD" item_no="100000014" line_no="2" order_no="421424" color_code="257" manufacturer="100783">
</order_d>
</order_h>
</order>
<order>
<order_h owner="GD" order_no="421425" profoma_po="421426">
<order_d owner="GD" item_no="100000014" line_no="1" order_no="421425" color_code="730" manufacturer="100783">
</order_d>
</order_h>
<order_h owner="GD" order_no="421425" profoma_po="421426">
<order_d owner="GD" item_no="100000014" line_no="3" order_no="421425" color_code="002" manufacturer="100783">
</order_d>
</order_h>
<order_h owner="GD" order_no="421425" profoma_po="421426">
<order_d owner="GD" item_no="100000014" line_no="2" order_no="421425" color_code="257" manufacturer="100783">
</order_d>
</order_h>
</order>
<order>
<order_h owner="GD" order_no="421426" profoma_po="421427">
<order_d owner="GD" item_no="100000015" line_no="1" order_no="421426" color_code="000" manufacturer="100783">
</order_d>
</order_h>
<order_h owner="GD" order_no="421426" profoma_po="421427">
<order_d owner="GD" item_no="100000015" line_no="3" order_no="421426" color_code="002" manufacturer="100783">
</order_d>
</order_h>
<order_h owner="GD" order_no="421426" profoma_po="421427">
<order_d owner="GD" item_no="100000015" line_no="2" order_no="421426" color_code="450" manufacturer="100783">
</order_d>
</order_h>
</order>
<order>
<order_h owner="GD" order_no="421427" profoma_po="421428">
<order_d owner="GD" item_no="100000015" line_no="1" order_no="421427" color_code="000" manufacturer="100783">
</order_d>
</order_h>
<order_h owner="GD" order_no="421427" profoma_po="421428">
<order_d owner="GD" item_no="100000015" line_no="3" order_no="421427" color_code="002" manufacturer="100783">
</order_d>
</order_h>
<order_h owner="GD" order_no="421427" profoma_po="421428">
<order_d owner="GD" item_no="100000015" line_no="2" order_no="421427" color_code="450" manufacturer="100783">
</order_d>
</order_h>
</order>
</document>
我需要如下输出
<document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<order>
<order_h owner="GD" order_no="421424" profoma_po="421425">
<order_d owner="GD" item_no="100000014" line_no="1" order_no="421424" color_code="730" manufacturer="100783"/>
<order_d owner="GD" item_no="100000014" line_no="3" order_no="421424" color_code="002" manufacturer="100783"/>
<order_d owner="GD" item_no="100000014" line_no="2" order_no="421424" color_code="257" manufacturer="100783"/>
</order_h>
</order>
<order>
<order_h owner="GD" order_no="421425" profoma_po="421426">
<order_d owner="GD" item_no="100000014" line_no="1" order_no="421425" color_code="730" manufacturer="100783"/>
<order_d owner="GD" item_no="100000014" line_no="3" order_no="421425" color_code="002" manufacturer="100783"/>
<order_d owner="GD" item_no="100000014" line_no="2" order_no="421425" color_code="257" manufacturer="100783"/>
</order_h>
</order>
<order>
<order_h owner="GD" order_no="421426" profoma_po="421427">
<order_d owner="GD" item_no="100000015" line_no="1" order_no="421426" color_code="000" manufacturer="100783"/>
<order_d owner="GD" item_no="100000015" line_no="3" order_no="421426" color_code="002" manufacturer="100783"/>
<order_d owner="GD" item_no="100000015" line_no="2" order_no="421426" color_code="450" manufacturer="100783"/>
</order_h>
</order>
<order>
<order_h owner="GD" order_no="421427" profoma_po="421428">
<order_d owner="GD" item_no="100000015" line_no="1" order_no="421427" color_code="000" manufacturer="100783"/>
<order_d owner="GD" item_no="100000015" line_no="3" order_no="421427" color_code="002" manufacturer="100783"/>
<order_d owner="GD" item_no="100000015" line_no="2" order_no="421427" color_code="450" manufacturer="100783"/>
</order_h>
</order>
</document>
提前致谢