Just a quick note to add you can also use framework.system.filesystem
since Google
Desktop has implemented this object for you.

function XMLtoFile()
{
   var fso, f;
   ForWriting = 2;
   fso = framework.system.filesystem;
   f = fso.OpenTextFile("c:\\file.txt", ForWriting, true)
   f.Write("xml data");
   f.Close();
}

Also, check out this fabulous gadget for examples filesystem code
usage scenarios and lots of crazy XML manipulation:

http://desktop.google.com/plugins/i/youtubequickview.html?hl=en


On Mar 17, 8:16 pm, "Benjamin [API Guru]" <[email protected]>
wrote:
> 1) You can use DOMDocument to load the xml string and work with the
> xml structure. There is some example code in the open source calendar
> gadget but basically:
>   var doc = new DOMDocument();
>   doc.loadXML(YOUR_XML_STRING);
>
> 2) To access the filesystem you can use framework.filesystem which
> implements the ActiveX FileSystemObject, 
> Checkhttp://msdn.microsoft.com/en-us/library/hww8txat(VS.85).aspxto get a
> list of all available methods, attributes and objects as well as some
> usage examples for it.
>
> Best regards,
> Benjamin
>
> On Mar 17, 9:07 pm, Meir Rotstein <[email protected]> wrote:
>
> > Hi,
>
> > Two more questions:
>
> > 1. how the xml string can be converted to a dom object? does the DOMParser
> > object can be used here?
> > 2. Any idea of how to write a file into the filesystem?
>
> > Thanks!
>
> > On Fri, Mar 13, 2009 at 6:18 PM, getulio.pereira
> > <[email protected]>wrote:
>
> > > Try to use this:
>
> > >              var xml = gadget.storage.openText("my_file.xml");
>
> > > where my_file.xml is in gadget package.
>
> > > This method will return the contents of the file as a string.
>
> > > For more information, see:
> > >http://code.google.com/intl/pt-BR/apis/desktop/docs/gadget_apiref.htm...
>
> > > Meir Rotstein wrote:
> > > > Hi,
>
> > > > Is there's any official way to read local files with javascript based
> > > > on the google desktop frwk?
>
> > > > Thanks,
> > > > Meir.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Desktop Developer Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to