469,647 Members | 1,724 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

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 1845
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 gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.