• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Javascript API for parsing xml

 
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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):
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you open the XML document directly in the browser window, (Type the url in) does it open?

Eric
 
Sol Mayer-Orn
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !
 
We can walk to school together. And we can both read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic