Write an XML file

Nov 17, 2006 at 6:30pm

Write an XML file

Dear all, I would like to write a function that, given an array of tag-names and an array of values, just writes an XML file on the disk.

How can I do that?

Regards,
Bruno

————————————————-
- http://www.brunozamborlin.com -
————————————————-

#28757
Nov 17, 2006 at 7:10pm

With Javascript and

http://xmljs.sourceforge.net/

Also I think jasch has some xml objects

http://www.jasch.ch/

Cheers

-A

#88590
Nov 17, 2006 at 7:51pm

Quote: Andrew Pask wrote on Fri, 17 November 2006 20:10
—————————————————-
> With Javascript and http://xmljs.sourceforge.net/

Thank you very much.
Hovewer, I already tried to use this library for saving an XML file on hardisk, using the “xmlIOSaveData” function. My code was:

function prova (val){
var xml = “”
+ “< ?xml version="1.0"?>“
+ “
+ “
+ “
+ “value”
+ “

+ “

+ “
“;
//save the xml to the client’s hard drive until Jan 1, 2003
var expDate = new Date(“January 1, 2003″);
xmlIOSaveData(“savedXML”, xml, expDate);

}

but I had this error:

• error: js: BXMLEditor: Javascript ReferenceError: document is not defined, line 255
• error: js: error calling function prova

In the line 255, the code was:

document.cookie = dataName + “=” + escape(dataValue) + ” ;expires=” + expireDateGMT;

That could means, I think, that Max cannot store cookies…

> Also I think jasch has some xml objects
>
> http://www.jasch.ch/
>

I downloaded it, which object in particular should help me?

Best regards,
Bruno

————————————————-
- http://www.brunozamborlin.com -
————————————————-

#88591
Nov 18, 2006 at 2:01am

If you already have the file in the format you like then just write it to disk using the File Object. This is what you would do after creating a file using methods from the js XML libs.

Check out maxobjects.com for more xml externals. Tim Place has some stuff in taptools as well.

-A

#88592

You must be logged in to reply to this topic.