homepage Welcome to WebmasterWorld Guest from 54.226.213.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
Whats wrong with this w3 schools example.
Simone100




msg:3178391
 7:59 am on Dec 5, 2006 (gmt 0)

Hello, I am trying to get this w3 schools example working for what I need. Either one of their 2 examples on their page. It works fine in my browser viewing their page but when I put it in one of my own I can't get it to work. Instead of their local path to an xml document, I even use a full address just to make sure everything is working like it should. Are they just calling one one section of an xml document? If so can you tell which section it is? Or can someone try this and tell me what I am doing wrong?

Since I can view theirs that is a good sign at least, it tells me I should be able to use it once I figure out where my error is. Thank you very much. The link to their example page.

[w3schools.com...]

 

phranque




msg:3178418
 9:00 am on Dec 5, 2006 (gmt 0)

just to be clear - did you change "note.xml" to "http://www.w3schools.com/e4x/note.xml"?

Simone100




msg:3178443
 9:26 am on Dec 5, 2006 (gmt 0)

No I had my own xml, but I just tried that too. Doesn't work. I am getting a blank page. I have it in a .asp page. Is it supposed to be something.asp? Thanks for the help.

phranque




msg:3178474
 10:26 am on Dec 5, 2006 (gmt 0)

assuming you started you file with the following tags:
<html>
<head>
<script type="text/javascript">

then it would be a typical .html file that happens to contain some javascript.

since i "don't know how to spell" asp, i'm not sure if naming it .asp will serve or browse it any differently than naming it .html but it's worth a try...

daveVk




msg:3178546
 12:05 pm on Dec 5, 2006 (gmt 0)

Make sure all content is coming from same domain as main page. Otherwise security will stop you. So if loading xml from mySite.com, move w3school example there to.

Simone100




msg:3179524
 2:46 am on Dec 6, 2006 (gmt 0)

Hi Dave! I really haven't forgotten about you, just taking a while for me to check out all the options.

I finally got their first example working sort of. Turns out their xml file had a bunch of junk in the top that wasn't supposed to be there. But their first example wont work in opera or mozilla. It just keeps loading, and loading and loading with nothing appearing on the page. Works fine in IE. On their second example that is supposed to be better,

var xmlDoc=new XML()
xmlDoc.load("note.xml")
document.write(xmlDoc.body)

.....they don't say how to use this so I couldn't get it working. I tried putting this between script tags, without script tags, in the head and in the body with no luck. Putting in the full address to note xml of course. If anyone ever tests these and figures it out because they want to know for themselves, please tell me what you did to get them working. Thanks a lot.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved