I am using html and dom x=xmlDoc.getElementsByTagName('person'); for(i=0;i<x.length;i++) { x.item(i).setAttribute("color","red"); } //Output all attribute values for (i=0;i<x.length;i++) { document.write(x[i].getAttribute('category')); document.write("<br />"); } Hi tha changes that i am making using dom take place only ine memory untill the next reload..but not in my xml file I am doing this for a customer's machine and i am unable to install a server side language to do a submit , how can i sabe the contents of xmldoc directly to a file locally ?? Many thanks
If the file was loaded locally then you can use: xmlDoc.save(xmlDoc.url) otherwise replace xmlDoc.url with the local path. Obviously you won't be able to do this from a web page unless security restrictions are more lower than is normal. If you are using IE and the file is small then consider using IE XML storage mechanism: http://msdn2.microsoft.com/en-us/library/ms531067(VS.85).aspx -- Joe Fawcett (MVP - XML) http://joe.fawcett.name "Ivan" wrote in message news:cf360efa-524f-43d9-9b4b-775dc40a50bf@s12g2000prg.googlegroups.com... >I am using html and dom > > x=xmlDoc.getElementsByTagName('person'); > > for(i=0;i<x.length;i++) > { > x.item(i).setAttribute("color","red"); > } > > //Output all attribute values > for (i=0;i<x.length;i++) > { > document.write(x[i].getAttribute('category')); > document.write("<br />"); > } > > > Hi tha changes that i am making using dom take place only ine memory > untill the next reload..but not in my xml file > > I am doing this for a customer's machine and i am unable to install a > server side language to do a submit , how can i sabe the contents of > xmldoc directly to a file locally ?? > > Many thanks >
Ivan wrote: > I am doing this for a customer's machine and i am unable to install a > server side language to do a submit , how can i sabe the contents of > xmldoc directly to a file locally ?? Inside of IE you can't use the save method, however you could write a HTML application (HTA), that way using the save method is possible. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/