This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Xml Dom not parsing Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "Xml Dom not parsing" Watch "Xml Dom not parsing" New topic
Author

Xml Dom not parsing

Lila Fowler
Ranch Hand

Joined: Jul 31, 2009
Posts: 84
Hi All,

Im trying to get a simple example that takes data from .xml and prints titles onto the screen. I'v tried lots of different examples from different places but i cannot get any to work.
Here is the xml code:



Here is the java script &html




I have tried lots of different examples(this one is w3schools) but non of them pass my xml even though my html pg opens.
Using two different browsers(chrome & IE) both dont work.

Any ideas as to what i'm doing wrong?

Thanks a ton

*posted this in web services by mistake as well, sorry.


Courage is not the absence of fear but rather the judgment that something is more important then fear. ~ Ambrose Redmond
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

You are downloading a Javascript file from somewhere -- from the same directory as that HTML came from, anyway. And then you try to access something from the local file system. Normally Javascript can't access the local file system; but perhaps that Javascript loadXMLDoc function expects a URL to get the XML document from?

If that's the case, then you haven't given it an XML. A file path is not a URL. And even if you gave it a file:// URL, chances are that the browser would not allow the Javascript to connect to it, because that would be a cross-site scripting security violation.
Lila Fowler
Ranch Hand

Joined: Jul 31, 2009
Posts: 84
Thanks, that explained why it wasn't working.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Xml Dom not parsing
 
Similar Threads
error : xmlhttp.responseXML.documentElement is null or not an object.
simple output statements inputted in the comment section yet it is printing out in the webpage
Help in iterating array from jsp
Count number of characters
Xml Dom not parsing