Link to XML from URL

Show off new creations, get help, or just chat about all aspects of web development and design.

Link to XML from URL

Postby unclep4ul on Tue Sep 04, 2007 7:19 pm

Ok, I need to use an external xml file as the datasource for a table in my website. Have spent the whole day on google and found nothing to guide me.

I am using Expression Web, and can easily use local XML files, but cannot use this method for external files.

Can anyone direct me on this? I am also willing to acquire dreamweaver if it is easier with that.

Thanks muchly!

EDIT: Managed to get this working, had to change from HTML 4.01 Transitional to HTML 3.2 Final. Not sure what affect this is going to have in other places though! :shock:
Image
User avatar
unclep4ul
Regular
Regular
 
Joined: Sat Jun 10, 2006 9:18 am
Location: UK

Postby Jest@ on Wed Sep 05, 2007 11:46 pm

Hm. I really wouldn't advise retrogressing that far in your doctype; I'd aim for something more generally accepted and well-supported like HTML 4 or preferably XHTML transitional. Strict if you can, of course, but that's a debate for another time.

Anyway. I've never tried to do exactly what you're asking, but afaik there's no 'silver bullet' to what you want to do. For a start, loading xml from an external source can contravene some browsers security policies (the same-origin policy), which is why you've probably had a hard time with it so far. Depending on what you want the XML for,you might be able to do it with iframes *shudder* (do you just wanna display it? it'll need to be styled in some way beforehand. Do you need to access it in JS for some reason? You can do that via the iframe, but it's messy).

The easiest way I can think of is using javascript for an AJAX call (which, famously, sorta avoids established security protocol) - but I'm a JS developer, so while I think that's easy, the beginner probably shouldn't jump into that without some preparation and learning.

Another very good solution would be using server-side scripting to do the legwork for you...but again, one doesn't just become proficient in PHP, readjust the rest of your site where appropriate, and have a fully working server-side config in a day.

There is an IE-only 'technology' I know of that can do this, I think...google around for 'xml data islands'. I think I saw something in the mozilla dev-centre about a way of replicating/mimicking this in firefox, but I dunno if it's suitable.

I think the real question is..why do you need to do this in the first place?
Highlight to read:
It was earth all along
User avatar
Jest@
Veteran
Veteran
 
Joined: Mon Nov 22, 2004 1:50 am
Location: London UK

Replay: your xml Files

Postby Saroja on Thu Sep 06, 2007 11:56 am

hi friend
my friend want to make a new site but he occur same problem in the beginning then he tell me he visit to web design site where he got no. of articles for his issue, then he make his website successfully. my friend i am also give you the same suggestion to visit to this site.
Saroja
Dumpling
Dumpling
 
Joined: Thu Sep 06, 2007 11:43 am

Postby unclep4ul on Thu Sep 06, 2007 1:23 pm

Saroja, if you could provide a link to the website that would be fab!

Jest@, I am using it to link to a league table at http://www.footballwebpages.co.uk.

It is currently working in iframes. Which as you have said is not ideal for customising the style in which it is displayed. I was hoping I could load it as a datasource, but the iframes method was the method posted on the Expression Web website.

Fortunately it is not imperative that I get this done, am just creating a practice site to learn CSS and other new web development tools (last site i made was made up of frames!!!). Think I need to do some more reading!

Thanks for the input guys!
Image
User avatar
unclep4ul
Regular
Regular
 
Joined: Sat Jun 10, 2006 9:18 am
Location: UK

Return to Web Design & Development

Who is online

Users browsing this forum: No registered users