Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: saving xml in javascript

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

On Mar 2, 5:16 pm, "RickH" <passp...@windcrestsoftware.com> wrote:
> On Mar 1, 12:07 am, unbewusst.s...@google.com.invalid (Une B=E9vue)
> wrote:
>
>
>
>
>
> > > > Currently when I execute this is makes no change whatsoever to the =
xml
> > > > file. What I expected was to open the xml doc manually and see 4 ch=
ild
> > > > nodes of the root instead of 3 as shown above in the xml listing. A=
ny
> > > > thoughts or ideas on what I'm doing wrong?
>
> > It is not possible, by JavaScript policy, to save a document in the
> > client side.
>
> > You might ask for that using a server side script writen in php for
> > example...
> > --
> > Une B=E9vue
>
> > 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.- Hide quoted text -
>
> - Show quoted text -


Also, for IE I would also suggest you instantiate the DOM in this
manner: as the class name you are using in the example will give you a
very old version 3 of the DOM, now that the DOM is installed side-by-
side on windows new releases, there is no longer a single clsid for
the DOM.  The function below will return the most recent version that
the machine has installed.  Also in your type of app make sure the
async property is set to false.



function getXMLDom() {
	// Please use the highest version of XML that is currently installed
on your machine
	var locXML
	try {
		locXML =3D new ActiveXObject("Msxml2.FreeThreadedDOMDocument.6.0")
	}
	catch(e) {
		try {
			 locXML =3D new ActiveXObject("Msxml2.FreeThreadedDOMDocument.5.0")
		}
		catch(e) {
			try {
				 locXML =3D new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0")
			}
			catch(e) {
				try {
					 locXML =3D new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0")
				}
				catch(e) {
					try {
						locXML =3D new ActiveXObject("MSXML2.DOMDocument.6.0")
					}
					catch(e) {
						try {
							 locXML =3D new ActiveXObject("MSXML2.DOMDocument.5.0")
						}
						catch(e) {
							try {
								 locXML =3D new ActiveXObject("MSXML2.DOMDocument.4.0")
							}
							catch(e) {
								try {
									 locXML =3D new ActiveXObject("MSXML2.DOMDocument.3.0")
								}
								catch(e) {
								}
							}
						}
					}
				}
			}
		}
	}
	locXML.async =3D false
   locXML.validateOnParse =3D true;
   locXML.resolveExternals =3D true;
	locXML.setProperty("SelectionLanguage", "XPath");
	if (typeof(locXML) =3D=3D 'undefined') {
		alert('Error: you must have the XML DOM installed')
		return null
	} else {
		return locXML
	}
}





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