aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Javascript API for parsing xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript API for parsing xml" Watch "Javascript API for parsing xml" New topic
Author

Javascript API for parsing xml

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Hi,

I'm new to the javascript XML(DOM) API.
I'm trying to:
- Read some xml data (from the server, synchronously).
- Parse it (using javascript DOM API).

Unfortunately, javascript keept telling me that it found an empty xml document (no child nodes)...
Could anyone guess what's wrong ?
BTW I can tell the request *does* arrive to my server (I'm logging it).

Thanks a lot.


My server-side xml (generated through jsp).
Notes:
- I can tell this *is* being called:
- I've tried it with and without the '<? xml ... ?> directive.


My javascript (meant for Firefox 5):
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
When you open the XML document directly in the browser window, (Type the url in) does it open?

Eric
Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Thanks very much for this tip, it did the trick

Actually, the XML was showing fine on IE 6, but your reply made me re-check it for firefox... indeed, it turns out there were some unneccessary spaces before my '<?xml version='1.0'?> tag...
I removed those spaces, and it works fine.

thank you very much !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript API for parsing xml
 
Similar Threads
nextSibling property not working!
saving XML files
Adding many options to a select box - strange IE6 behavior
session management problem with iframes
Page section does not update after call of a4j:support in IE 9