Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Wed, 26 Mar 2008 16:34:07 -0700 (PDT),    group: microsoft.public.xml        back       


Using dom save to an xml file   
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
date: Wed, 26 Mar 2008 16:34:07 -0700 (PDT)   author:   Ivan

Re: Using dom save to an xml file   
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
>
date: Thu, 27 Mar 2008 08:56:01 -0000   author:   Joe Fawcett am

Re: Using dom save to an xml file   
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/
date: Thu, 27 Mar 2008 13:25:59 +0100   author:   Martin Honnen

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us