请帮助使用javascript读取xml中的多个子级数据 [英] Please help to read multiple level subchild data in xml using javascript

查看:100
本文介绍了请帮助使用javascript读取xml中的多个子级数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我阅读以下xml文件数据.我主要想读取guid&之间的数据.代码标签.因此,请帮助我使用javascript读取这些数据.

这是我的xml数据.

Anyone please help me to read the below xml file data. i mainly want to read the data between the guid & code tag. so, please help me to read these data using javascript.

this is my xml data.

<response>
   <code>103</code>
   <message>
      <guid>Tabledata</guid>
   </message>
</response>




请向我提供一个JavaScript代码,以读取xml标记名称代码和guid之间的xml数据.




Please provide me a javascript code to read the xml data''s between the xml tag names code and guid.

推荐答案

使用这样一个简单的XML文件,您可以使用JavaScript window.DOMParserMicrosoft.XMLDOM(实际上,两者都是为了与浏览器兼容).请参阅:
http://www.w3schools.com/xml/xml_parser.asp [ http://dev.abiss.gr/sarissa/ [
With such a simple XML file, you can use JavaScript window.DOMParser or Microsoft.XMLDOM (actually, both of them, for browser compatibility). Please see:
http://www.w3schools.com/xml/xml_parser.asp[^].

Actually, the major problem is to bring the many XML APIs available in nearly all parsers except IE, to IE, to round up the compatible browser set with API like DOMParser, XMLSerializer, XSLTProcessor. This can be done with Sarissa ECMAScript library:
http://dev.abiss.gr/sarissa/[^].

Good luck,
—SA


这篇关于请帮助使用javascript读取xml中的多个子级数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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