Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: saving xml in javascript

From: "RickH" <passport@-----------------.--->
To: NULL
Date: 3/4/2007 2:10:00 PM

On Mar 3, 11:30 pm, unbewusst.s...@google.com.invalid (Une B=E9vue)
wrote:
> RickH <passp...@windcrestsoftware.com> wrote:
>
> > > It is not possible, by JavaScript policy, to save a document in the
> > > client side.
>
> > This is only true if your web page is being served by a web server.
> > If the web page is a local file on a hard drive that you have rights
> > to, then the save method works.  I use it all the time to write
> > browser-based applications that dont require a web server to exist on
> > the users machine.  They just click a local html file fill out the
> > form and save away.
>
> right !
>
> are you able to do that saving of a file with JavaSCript , which code ?
>
> i do have an application for that :
>
> the user select an area on the browser window and the javascript save
> that part locally, usefull, for example when u read an article online
> and want to avoid saving pub.
> --
> Une B=E9vue


Actually, I'm wrong, you're correct about pure javascript.  I've been
using the Micosoft ActiveX XMLDOM not the java XMLDOM, but my code is
still javascript.  Here is the object I use:

locXML =3D new ActiveXObject("Msxml2.FreeThreadedDOMDocument.5.0")
//locXML =3D new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0")
//locXML =3D new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0")
//locXML =3D new ActiveXObject("MSXML2.DOMDocument.5.0")
//locXML =3D new ActiveXObject("MSXML2.DOMDocument.4.0")
//locXML =3D new ActiveXObject("MSXML2.DOMDocument.3.0")

if (typeof(locXML) =3D=3D 'undefined') {
	alert('Error: you must have the XML DOM installed')
} else {
	locXML.async =3D false
	locXML.validateOnParse =3D true;
	locXML.resolveExternals =3D true;
	locXML.setProperty("SelectionLanguage", "XPath");
}
locXML.load(my file name)
locXML.save(my file name)



Sorry about the confusion, you do need activeX.




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent