XML newby - am I missing something?

D

Darren

I am attempting to write a website using Dreamweaver 8, I have a main
page that contains some xml fields - a list of events. I converted my
formated index.html page to index.xsl and attached the xml file that
contains the data.
When I 'preview in browser', DW creates a temp .html file in IE7 that
displeys the page with data perfectly.

The trouble is, when I publish the .xsl (with all of the associated
files, css, xml etc) and navigate to the index.xsl, all i get is the
code behind the xsl page - my understanding of the DW tutorials/help
files is that if you want to use xml data on a page you need to create
your page as a .xsl with a binding to the xml *instead* of using
a .html - am i missing simething?

Darren
 
J

Joe Kesselman

I don't know what "publish" means in your framework... but generally,
what you want the server to deliver to the user is the XML file, with a
hint that tells the user's program where to look for the corresponding
XSLT file. This hint is usually the xml-stylesheet processing instruction,
<?xml-stylesheet type="text/xml" href="uri-reference-of-my-stylesheet"?>
as documented at http://www.w3.org/TR/xml-stylesheet/

The main exception is when you're doing the "literal result element as
stylesheet" approach, which is rarely used.
 
D

Darren

yes thats it, I did not have a reference to the .xsl in the .xml.

one more question, if im using xml on my home page and therefore have
an index.xsl and an index.xml - will the browser find the index.xml by
default in the absence of an index.html?


regards,

Darren
 
J

Joe Kesselman

Darren said:
one more question, if im using xml on my home page and therefore have
an index.xsl and an index.xml - will the browser find the index.xml by
default in the absence of an index.html?

Depends entirely on how the server was set up, since the defaulting for
the index file (and/or any translation of the request) is handled on
that end of the wire, not in the browser.
 
D

Darren

yes, thats fixed it, I didnt have a refference to the xsl in the xml!!

the xsl is going to be the home page of my site (index.xsl &
index.xml) do I have to redirect an index.html to the xml so that the
browser will pick it up, or will the browser find the index.xml in the
absence of an index.html?

- surely a redirect is not good for search engines, thats why im
suspecting that my theory is wrong!

is it possible to embed xml within a htlm doc - this way I can have an
index.html as normal but with dynamic data?


Darren
 
J

Joseph Kesselman

Darren said:
is it possible to embed xml within a htlm doc - this way I can have an
index.html as normal but with dynamic data?

Possible alternative: Do server-side XSLT to generate HTML, and deliver
that.
 
D

Darren

yes thats it, I did not have a reference to the .xsl in the .xml.

one more question, if im using xml on my home page and therefore have
an index.xsl and an index.xml - will the browser find the index.xml by
default in the absence of an index.html?

regards,

Darren

sorry, replied twice as the first one didnt turn up for a couple of
hours!

darren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top