如何在Web浏览器中显示xml文件内容 [英] how to show the xml file content in web browser
本文介绍了如何在Web浏览器中显示xml文件内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我能够将xml文件保存到我的应用服务器中.我已经使用xml.Save("C:\\ XMLFile \\" + fileName);
保存了文件
现在在保存时,我想显示xml文件.
我不知道如何在浏览器中显示内容.
请帮帮我.
在此先感谢
Hi All,
I am able to save the xml file into my app server. I have save file using xml.Save("C:\\XMLFile\\" + fileName);
Now at the time of saving i want to show the xml file.
I dont know how to show the content in the browser.
Please help me.
Thanks in advance
推荐答案
我相信以下链接将为您带来很多帮助
http://msdn.microsoft.com/en-us/library/ekw4dh3f (v = vs.80).aspx [
I believe the following Link will help you a lot
http://msdn.microsoft.com/en-us/library/ekw4dh3f(v=vs.80).aspx[^]
您可以使用Javascript显示xml文件
在ShowFile按钮上,单击调用以下Javascript函数
You can show your xml file using Javascript
on ShowFile button click call following Javascript function
<script language="Javascript">
function OpenFile()
{
window.showModalDialog(''subDoc.html'',''dialogWidth:300px; dialogHeight:200px; center:yes'');
return false;
)
}
</script>
最简单的步骤是:
- 将XML文本放入
pre
标记内;- 用
<
和>
替换尖括号;- 用
&
替换&
;- 利润!
The simplest steps are:
- Put you XML text inside
pre
tag;- Replace angular brackets with
<
and>
;- Replace
&
with&
;- PROFIT!
这篇关于如何在Web浏览器中显示xml文件内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文