![]() |
displaying xml in a html page
Hello,
I am brand new to learning html. I am trying to display an simple xml file in a webpage for the first time. I used the following.. <Xml id=msg SRC="saleinfo.xml" ></xml> Nothing displays. The xml file is in the same directory, and I can view the xml page in a browser. The xml file has just one record in it. Thanks in advance for your help! |
Look at this ...
http://www.w3schools.com/xml/xml_dont.asp |
Hi Davey;
I re-created the xml and html files from the w3schools link you provided. I still get a blank screen... It is almost like IE is blocking the xml file from running?? Is there a setting in IE that I should be turning off? Again thanks for your post! |
1 Attachment(s)
There is a "try it yourself>" link, and the code did not work in w3Cshools webpage either?
see the attachment.. |
You are not using IE browser,
the xml data island is IE only. |
Sorry Davey,
I'm no closer to understanding why or how to display xml code within a html file... The IE browser is what I am using to open the html file...:confused: |
What version of IE are you using? There was a patch that disabled the XML island functionality on early (IE5-7) browsers for security reasons - maybe it's been disabled on your version? The W2Schools demo works for me in IE9.
But this is really not a good way to import XML, it is IE-specific and dependent on your client's browsers. Using PHP via the SimpleXML interface, or directly through the DOM, or even using JavaScript is a better answer. Dave |
I am using ie9, but thanks for pointing me to SimpleXML, I will look there.
I have a pretty simple situation, and was happy using ie9, and was hoping that it would have worked.. |
The browser pictured in the
attatchment is not IE, it looks like chrome to me. |
Davey;
I understand now, you are right! I opened up your link in Chrome by default, then clicked on the "try it yourself", and it did not work. But when I did it in ie9 it worked... Thanks for pointing that out. When I copied their html code, and xml data file into a sub-directory, I still could not get their example to work on my machine using ie9... I'll post that in their forums and see what they suggest. Thanks again for your input. |
Quote:
Added: Of course, the XML has to come from the same domain. Apparently there is an issue with Chrome displaying XML in an iframe. |
| All times are GMT +1. The time now is 10:25 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.