Click to See Complete Forum and Search --> : make my index.xml appear as index.html??


aidanmack
07-04-2009, 08:19 AM
Hi guys,
Ive just been learning how to display/style xml data using this adobe tutorial...
http://www.adobe.com/devnet/dreamweaver/articles/display_xml_data.html

I have it all working and have adapted it to start displaying my portfolio.

Thing is though i didnt realise it styled the xml. I though it would be attaching the xml to my html page.

So in order to view my "index" page you now have to go to

http://www.aidanmack.co.uk/html/index.xml
not..
http://www.aidanmack.co.uk/html/


What could i do to correct this?

Also is the tutorial i did still the best way of displaying xml? creating a XSL sheet and attaching it to the xml?


Thanks for any help

Aidan

Dave Lane
07-04-2009, 10:16 AM
If you're using Apache httpd as your web server, have you tried using an .htaccess file in your base web directory?


DirectoryIndex /html/index.xml


or


RedirectPermanent /html/index.html /html/index.xml


Alternatively, if you have mod_rewrite enabled:


RewriteEngine On
RewriteRule ^html/ndex.html(.*) html/index.xml


If you're using a hosting provider which has some sort of administration panel, there may also be an option for changing the home page somewhere...

Worst case: you could create an index.html with a meta-tag to redirect to the correct page. It's sort of hack-ish but may be better than nothing...


<html>
<head>
<META HTTP-EQUIV="Refresh"
CONTENT="0; URL=index.xml">
</head>
</html>


I don't see anything wrong with the Adobe tutorial, though I'm really a novice when it comes to XSLT. :o

Hope that helps!

aidanmack
07-04-2009, 12:04 PM
Thanks Dave,
I dont think Its an apache server though.

If you dont mind me asking if you were to display xml data and style it. What would you do?


Thanks for your help

Dave Lane
07-04-2009, 12:33 PM
I don't know... The Adobe tutorial looks perfectly sound to me. Most of the stuff I've done with XML on the web has been parsing data using ExtJS and displaying it within a regular HTML page using an ExtJS grid component. Aside from that I've used an implementation of xflow (which I wouldn't recommend).

I really think you're on the right path unless you're looking at making some sort of huge web service project. I think your solution is great, and could probably be extended to manage dynamic content if the site ever grows beyond a few dozen pages.

But again, take all of this with a grain of salt. :) I'm no expert.

aidanmack
07-04-2009, 05:42 PM
Thanks for the heads up Dave,
Think i might do a little research into this ExtJS you speak of!

I really like the way the adobe tut shows how to display xml. I would be even happier if it was a HTML page though!

Thanks for your time.