tags:

views:

182

answers:

2
A: 

IXMLDOMDocument2 interface has a save method. Check this.

Pavan
I guess, sai uses PHP. So IXMLDOMDocument2 will probably not work.
Boldewyn
i am using php ...this will not work in php ...anybody can help
sai
Check this URL: http://articles.techrepublic.com.com/5100-10878_11-6141415.html
Pavan
hi pavan,i have added my code ...all i need is at runtime i need to get the dynamic name to the file instead of playlist.xml ....i am novice in xml apart from few tags i dont know much about xml...your help is appreciated...Thank you
sai
A: 

To save with a dynamic name, you can do something like this in PHP:

//Set dynamic name - used microtime in this example but you could change this
//to another dynamic naming scheme
$dynamicPlaylistName = microtime();

//Save XML with dynamic name
$dom->save($dynamicPlaylistName.'.xml');

The code above sets dynamicPlaylistName to whatever you put after the equals sign on that line, and then saves the xml with the value of dynamicPlaylistName as its file name with '.xml' appended to it.

If you also want the XML file to be formatted with indents and nesting, see my answer to this question. Note that you would likely only need to add the following two lines somewhere prior to saving the XML to get formatting in your case:

$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
Witman