Transform One XML to Multiple XML Files
Posted: Sat Jun 30, 2018 6:21 am
I am in need of a way to transform one xml file with multiple nodes that have the same name and convert each of the those nodes into individual xml files for each node.
Here is a sample of the xml. I have been trying to use the built in XSLT tool but am not familiar enough with how it works.
<order>
<product_details>
<items>
<orders_products_id>37</orders_products_id>
<products_name>20180629075817</products_name>
<products_title>Printed SEG</products_title>
<products_sku>EZF</products_sku>
<products_price>316.66666666667</products_price>
<products_quantity>1</products_quantity>
<template_type>Upload Center</template_type>
<features_details>
<option title="I">I</option>
<option title="defining" />
<option title="Width (Inch)">80</option>
<option title="Height (Inch)">95</option>
<option title="Fabric">BaseTex (general use)</option>
<option title="Finishing">Gasket Edge</option>
<option title="Gasket">12mm x 2.5mm</option>
</features_details>
<print_ready_files>
<file>18_50_130x95.pdf</file>
</print_ready_files>
<productsize><b>80</b> Width x <b>95</b> Height <span class="text-danger"> (Inch)</span></productsize>
<csv_file_name />
<products_weight>22.800000</products_weight>
<inventory_storage_days />
<shipping_company />
<tracking_number />
<li_number>1571460</li_number>
</items>
</product_details>
</order>
Here is a sample of the xml. I have been trying to use the built in XSLT tool but am not familiar enough with how it works.
<order>
<product_details>
<items>
<orders_products_id>37</orders_products_id>
<products_name>20180629075817</products_name>
<products_title>Printed SEG</products_title>
<products_sku>EZF</products_sku>
<products_price>316.66666666667</products_price>
<products_quantity>1</products_quantity>
<template_type>Upload Center</template_type>
<features_details>
<option title="I">I</option>
<option title="defining" />
<option title="Width (Inch)">80</option>
<option title="Height (Inch)">95</option>
<option title="Fabric">BaseTex (general use)</option>
<option title="Finishing">Gasket Edge</option>
<option title="Gasket">12mm x 2.5mm</option>
</features_details>
<print_ready_files>
<file>18_50_130x95.pdf</file>
</print_ready_files>
<productsize><b>80</b> Width x <b>95</b> Height <span class="text-danger"> (Inch)</span></productsize>
<csv_file_name />
<products_weight>22.800000</products_weight>
<inventory_storage_days />
<shipping_company />
<tracking_number />
<li_number>1571460</li_number>
</items>
</product_details>
</order>