Hi.
The following is the URL i refer to generate xml file from DB.
1) How can i purge data from the xml file everytime before i start generate?
2) How can i generate xml according to my requirement?
My function to generate XML
Current Outcome
<?xml version="1.0" encoding="utf-8" ?>
<NewDataSet>
<Table1>
<PID>10001</PID>
<parentCatID>20001</parentCatID>
<childCatID>0</childCatID>
<subchildCatID>0</subchildCatID>
<merchantID>70001</merchantID>
<priority>01</priority>
<status>Active</status>
<CODE>23326</CODE>
<name1>Product A</name1>
</Table1>
<Table1>
<PID>10002</PID>
<parentCatID>20001</parentCatID>
<childCatID>0</childCatID>
<subchildCatID>0</subchildCatID>
<merchantID>70001</merchantID>
<priority>05</priority>
<status>Active</status>
<CODE>97896</CODE>
<name1>Product B</name1>
</Table1>
</NewDataSet>
Expected Result
<?xml version="1.0" encoding="utf-8" ?>
<channel>
<title>Your store name</title>
<link>https://yourstore.com</link>
<description>A description of your store</description>
<item>
<g:id>10001</g:id>
<g:title>Product A</g:title>
</item>
<item>
<g:id>10002</g:id>
<g:title>Product B</g:title>
</item>
DataTable = product.return_product_table("google-feed", "", "", "", "", "")
Dim DS As New DataSet
DS.Tables.Add(DataTable)
Dim sw As StreamWriter = New StreamWriter(Server.MapPath("~/google-feed.xml"), True)
DS.WriteXml(sw)