472,119 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

Facing a Problem when I use the loadXML("<xml String>")

Hi everyone,

This is my first post to this forum, hope I would get a reply quickly :-)

Iam using loadXML(xmlString) and it is always returning "false". My code looks like this :

Expand|Select|Wrap|Line Numbers
  1. if (window.ActiveXObject)
  2.         {
  3.          var responseXml=new ActiveXObject("Microsoft.XMLDOM"); 
  4.         responseXml.async="false";
  5.         var wellFormedMarkup = "<g>"+string+"</g>";
  6.          alert(wellFormedMarkup);
  7.          //alert(responseXml.loadXML(wellFormedMarkup));
  8.             loaded = responseXml.loadXML(wellFormedMarkup);
  9.             alert(loaded);
  10.  
  11. .......
  12.  
  13. }
  14.  
  15.  
when I print the value for the *string*, it displays the response text.
So its not null or empty.
Where did I get deviated???
Thank You in advance.

Regards,
Suman
Jun 11 '08 #1
1 1902
acoder
16,027 Expert Mod 8TB
Welcome to Bytes!

See if this example works for you. Remember that other browsers have a different method of reading/loading XML files/strings.

PS. please remember to use code tags when posting code. Thanks!
Jun 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Danny Anderson | last post: by
1 post views Thread by Christian Schmidbauer | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.