Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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.

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



Please provide me a javascript code to read the xml data's between the xml tag names code and guid.
Posted
Updated 10-Sep-12 17:29pm
v3
Comments
Sergey Alexandrovich Kryukov 10-Sep-12 15:47pm    
Help with what? This post is not a question. Did you notice that you post at Questions & Answer forum?
--SA
Mayjo Antony 10-Sep-12 23:32pm    
sir, Please provide me a javascript code to read the xml data's between the xml tag names code and guid from the above xml.
Sergey Alexandrovich Kryukov 11-Sep-12 13:15pm    
This is too boring work to do, and remember it's your work. Could you better explain where did you stuck? What's the issue? Why could not you do it?
--SA

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900