Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > New Question on Simple XML DOM Problem in AJAX Implementation

Reply
Thread Tools

New Question on Simple XML DOM Problem in AJAX Implementation

 
 
dondraper
Guest
Posts: n/a
 
      01-26-2006
I have an application that uses a popular but simple set of JavaScript
routines that implement an AJAX call used to populate a drop-down. It
works for thousands of user but I have one customer where it does not
work. It was working but quit over the weekend. I suspect their XML DOM
was either changed, removed or disabled somehow. My assumptions are
that the XMLHTTPRequest object used by the browser to make the http
request is different from the object that is used to parse the XML once
it is returned to the client (XML DOM?).

My question is how can they reinstall the XML DOM and are my
assumptions correct. They are on IE 5.5 and 6.0 under XP SP2. Here is
why I suspect the XML DOM...

After debugging, we verified the XMLHTTP object is working and getting
back our simple XML (verified by displaying the XML from the
http.responseText in an alert window).

var xmlDocument = http.responseXML; <--- pretty sure this works

However, when we parse the incoming XML, the nodelist in their browser
returns 0 elements.

var nodelist = xmlDocument.getElementsByTagName('user'); <---
nodelist is empty??
alert(nodelist.length) <--- this is returning 0 and our list box is
empty after completion.

Any idea why the XMLHTTPRequest can make the http call and get back the
XML but the as we parse it fails. We are sure the <user> tags are in
the XML and this is verified even this client when we displayed the XML
as text using responseText to view it.

Does this line....

var xmlDocument = http.responseXML;

....create an XML DOM object and if yes, it is using a different object
that the XMLHTTPRequest object. Is there anyway my customer can
reinstall something to get this functionality working again? How to
check version? Any advise would be appreciated.

TIA

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      01-27-2006


dondraper wrote:


> After debugging, we verified the XMLHTTP object is working and getting
> back our simple XML (verified by displaying the XML from the
> http.responseText in an alert window).
>
> var xmlDocument = http.responseXML; <--- pretty sure this works
>
> However, when we parse the incoming XML, the nodelist in their browser
> returns 0 elements.
>
> var nodelist = xmlDocument.getElementsByTagName('user'); <---
> nodelist is empty??


Check
xmlDocument.parseError.reason
xmlDocument.parseError.errorCode
and other properties of the parseError object documented here
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/fdc6ff87-3cfb-4aa0-8bb6-d8c1acf9684e.asp>
to find out whether there might be simply a parse error.

Also check
http.status
http.statusText
http.getAllResponseHeaders()
to find out details about the particular response so that we can check
what might go wrong?
Has the response been sent with Content-Type text/xml or application/xml?

And then show us the XML sent, does it use any namespaces for instance?



--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
dondraper
Guest
Posts: n/a
 
      01-27-2006
Martin,

Great advice. We are sending it as text/xml. No special namespaces and
they are getting the XML in perfect form like everyone else.

We added xmlDocument.parseError.reason and other error attributes to a
test page and checked them right when the xmlDocument was created and
on the very next line where we create the nodelist object. We also
checked that the http.status was 200 and outputted the raw XML so we
could see (using responseText()) that it was all there. We finally
tested this code by sending back compromised XML and it the error
checking displayed the problem in great detail.

Unfortunately, when the customer calls the page, no errors are detected
and nodelist.length still comes back as 0. Not sure what has happened
to their machines but it appears the code is not going to give us a
clue.

Since we are desparate here, we are asking them to:
- reinstall IE 6.0 SP1
- next, reinstall the XMLDOM Core Services

If that does not help, we are writing alternate pages that will encode
our simple data into an delimited string and then parse it out using
raw JavaScript. This will get this one customer back up and running and
then if once proven, we will probably use this for all others. It will
still be doing an AJAX call but not need the XML DOM to parse.

Will post any new information here if we find it. Thanks so much for
your assistance as it would have surely caught any problems when the
xmlDocument object was created.

-Don

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
getNextSibling() never ends? DOM XML nodes (org.w3c.dom) Alan Java 6 10-13-2008 05:48 PM
Replacing _xmlplus.dom.minidom with xml.dom.minidom aine_canby@yahoo.com Python 3 08-03-2007 03:50 PM
AJAX IDE and AJAX TOOL--The Release of JoyiStar AJAX WebShop 3 Beta minnie Java 1 12-13-2006 06:29 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Convert a XML DOM Object to a HTML DOM Object manjunath.d@gmail.com XML 0 09-20-2005 08:16 AM



Advertisments