Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirection to a .xsl

Status
Not open for further replies.

dougalim

Programmer
Mar 1, 2007
23
US
I'm new to XML/XSLT but having great success transforming xml to display in a browser.

My question is, say I want to build a home page using my xsl file would it work with index.xsl?

I've tried redirecting from a html page with javascript using "window.location=file.xsl" but all that did was to display the xsl file in the browser.

What should I be doing?
 
I'm a little puzzled - I'm using Dreamweaver 8 where all I have to do is press F12 to open the current file in the default browser which works fine with my xsl files.

Dreamweaver generates a defaults xsl file and links my xml file with <!-- DWXMLSource="testmenu.xml" -->

But when I open the xsl file outside of Dreamweaver using Firefox I get the message

"This XML file does not appear to have any style information associated with it. The document tree is shown below." and then xsl file itself.

So now I'm more confused than I was before.
 
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="index.xsl"?>
<rootelement>

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

Webflo
 
Ok, that was easy - I've spent the last couple of hours looking for this in reference books and tutorials on the web but everything seems to skip this.

Thank you.
 
No problem... I lifted that straight out of the w3schools tutorial on the subject. I strongly suggest bookmarking their site, they have some fantastic tutorials and references:


[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

Webflo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top