关于使用JavaScript编写XML [英] About Writing XML using JavaScript

查看:81
本文介绍了关于使用JavaScript编写XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

本文摘自:使用JavaScript编写XML [

Hello,

From this article: Writing XML using JavaScript[^]

The program is good and simple for use. However, it only display xml data on screen.

Can I modify this program to write xml data into a file or email them to someone? Could you help me to do so?


Thanks,
Paulus
[removed email]

推荐答案

您需要知道的是如何使用javascript创建文本文件.


试试这个链接

http://www.c-point.com/JavaScript/articles/file_access_with_JavaScript.htm [ ^ ]


what you need to know is how to create a text file with javascript.


try this link

http://www.c-point.com/JavaScript/articles/file_access_with_JavaScript.htm[^]


function WriteFile()
{

var fh = fopen("c:\\MyFile.txt", 3); // Open the file for writing

if(fh!=-1) // If the file has been successfully opened
{
    var str = "Some text goes here...";
    fwrite(fh, str); // Write the string to a file
    fclose(fh); // Close the file
}

}

WriteFile();




您可以将Output XMLWriter传递给WriteFile函数.

祝您好运.




and you can pass the Output XMLWriter to the WriteFile function.

good luck.


最好将您的问题发布到文章本身,而不是在此处发布.作者比其他人更了解自己的代码.

因此,请在此处使用JavaScript编写XML-评论部分 [
It might be best to post your question on the article itself rather than posting it here. The author knows his code better than anyone else.

So ask your question here Writing XML using JavaScript - Comments section[^]


这篇关于关于使用JavaScript编写XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆