如何使用HTML从网页上的XML文件中读取数据。
问题描述:
Hi Team,
我正在制作简单的应用程序。我有XML文件,其中有一些数据保存在系统驱动器中。我在HTML页面上有按钮控件。
我想要当我点击按钮它应该在标签HTML页面上显示XML文件中的所有数据。 br />
as
名称 - XYZ
地址 - 珀斯。
请告诉我
Hi Team ,
I am making simple application . I have XML file having some data saved in system drive .I have button control on HTML page.
I want that When I click on button It should display all data from XML file on labels HTML page.
as
Name - XYZ
Address - Perth.
Please tell me
答
对不起,AFAIK您无法直接从HTML读取XML。
但是,您可以使用javascript来执行此操作。这将全部在客户端完成,因此没有服务器跳闸。这意味着它仍然是瞬时的(虽然取决于XML文件的大小)。
请参阅这个 [ ^ ]使用js读取XML。
[请接受/上调]为您鼓励他人的答案或解决方案]
Sorry, AFAIK you can not read XML right from HTML.
However, you can use javascript to do it. This will all be done on the client side, so no server trips. Which means it will still be instantaneous (although depends on the size of the XML file).
Please see this[^] for using js to read XML.
[Please accept/up-vote answers or solutions that work for you to encourage others]