my first post here. I'm a first year student and my first encounter with xml and xsl. I've been following many tutorials and haven't been able to figure out why the browser always says "This XML file does not appear to have any style information associated with it. The document tree is shown below." The problem is that this message is displayed for my xsl file. I think that browser doesn't recognize my xsl file as xsl and instead thinks of it as xml. Didn't find answer why that happens in google, so I'm asking here. Here's my xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<html>
<head>
<meta charset="utf-8" />
<title>Spis</title>
</head>
<body>
<div class="navbar">
<div class="subnav">
<button class="subnavbtn"><a href="info.html">O mnie</a><i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
<a href="info.html#tekst">Wstęp</a>
<a href="info.html#galeria">Galeria</a>
</div>
</div>
<div class="subnav">
<button class="subnavbtn"><a href="tabele.html">Więcej</a><i class="fa fa-caret-down"></i></button>
</div>
<div class="subnav">
<button class="subnavbtn"><a href="spis.xsl">Spis</a><i class="fa fa-caret-down"></i></button>
</div>
</div>
<xsl:for-each select="swiat">
<h1>Typ świata: <xsl:value-of select="/swiat/typ"/></h1>
<table>
<xsl:for-each select="/swiat/pasywne/mob">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="drops"/></td>
<td><xsl:value-of select="opis"/></td>
<td><xsl:value-of select="wyglad"/></td>
</tr>
</xsl:for-each>
</table>
<p>-----------------------------------</p>
</xsl:for-each>
<xsl:apply-templates select="overworld"/>
<xsl:apply-templates select="nether"/>
<xsl:apply-templates select="end"/>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
and here's xml:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="spis.xsl" ?>
<listaMobow title="Elementy">
<swiat type="overworld">
<typ>overworld</typ>
<wyglad><img url("xml/overworld.jpg")></wyglad>
<pasywne>
<mob>
<name>świnia</name>
<drop>szynka</drop>
<opis>Można założyć na sią siodło i na niej jeździć.</opis>
<wyglad><image url="xml/swinia.jpg"/></wyglad>
</mob>
<mob>
<name>krowa</name>
<drop>wołowina, skóra</drop>
<opis>Po kliknięciu na nią trzymając wiadro w dłoni, otrzymuje się wiadro mleka.</opis>
<wyglad><image url="xml/krowa.jpg"/></wyglad>
</mob>
<mob>
<name>owca</name>
<drop>jagniecina, welna</drop>
<opis>Można ogolić i otrzymać wełnę za pomocą nożyc, po jakimś czasie jej wełna odrasta.</opis>
<wyglad><image url="xml/owca.jpg"/></wyglad>
</mob>
<mob>
<name>kurczak</name>
<drop>filet, pióro</drop>
<opis>Znosi jajka, które mają małą szansę na wyklucie kurczątka, po rzuceniu nimi o ziemię.</opis>
<wyglad><image url="xml/kurczak.png"></wyglad>
</mob>
</pasywne>
<neutralne>
<mob>
<name>enderman</name>
<drop>perła</drop>
<opis>Duże czarne humanoitalne stwory. Atakują po spojrzeniu się im w twarz.</opis>
<wyglad><image url="xml/enderman.png"/></wyglad>
</mob>
<mob>
<name>golem</name>
<drop>sztabka żelaza</drop>
<opis>Często broni wioski osadników. Atakuje gracza po zaatakowaniu ich lub golema.</opis>
<wyglad><image url="xml/golem.jpg"/></wyglad>
</mob>
<mob>
<name>niedźwiedź polarny</name>
<drop>ryba</drop>
<opis>Pojawia się w zimnych biomach, broni młodych niedźwiadków.</opis>
<wyglad><image url="xml/niedzwiedz.jpg"/></wyglad>
</mob>
</neutralne>
<agresywne>
<mob>
<name>creeper</name>
<drop>proch</drop>
<opis>Po zbliżeniu się do gracza na wystarczającą odległość, wybucha.</opis>
<wyglad><image url="xml/creeper.jpg"/></wyglad>
</mob>
<mob>
<name>zombie</name>
<drop>zgniłe mięso</drop>
<opis>Atakuje gracza, po zblizeniu się na wystarczającą odległość.</opis>
<wyglad><image url="xml/zombie.jpg"/></wyglad>
</mob>
<mob>
<name>szkielet</name>
<drop>kość, strzała, łuk</drop>
<opis>Strzela do gracza za pomocą łuku.</opis>
<wyglad><image url="xml/szkielet.png"/></wyglad>
</mob>
</agresywne>
</swiat>
<swiat type="nether">
<typ>nether</typ>
<wyglad><img url("xml/nether.jpg")></wyglad>
<neutralne>
<mob>
<name>zombie pigman</name>
<drop>złoty miecz, zgniłe mięso</drop>
<opis>Po zaatakowaniu go, na gracza rzucają się wszystkie osobniki znajdujące się w pobliżu.</opis>
<wyglad><image url="xml/pigman.png"/></wyglad>
</mob>
<mob>
<name>enderman</name>
<drop>perła</drop>
<opis>Duże czarne humanoitalne stwory. Atakują po spojrzeniu się im w twarz.</opis>
<wyglad><image url="xml/enderman.png"/></wyglad>
</mob>
</neutralne>
<agresywne>
<mob>
<name>szkielet</name>
<drop>kość, strzała, łuk</drop>
<opis>Strzela do gracza za pomocą łuku.</opis>
<wyglad><image url="xml/szkielet.png"/></wyglad>
</mob>
<mob>
<name>witherowy szkielet</name>
<drop>kość, węgiel, kamienny miecz</drop>
<opis>Po zaatakowaniu nakłada efekt withera, które zzabiera pół serduszka zdrowia co sekundę.</opis>
<wyglad><image url="xml/wither.jpg"/></wyglad>
</mob>
<mob>
<name>blaze</name>
<drop>pałka blazea</drop>
<opis>Lata i strzela do gracza ognistymi pociskami.</opis>
<wyglad><image url="xml/blaze.jpg"/></wyglad>
</mob>
</agresywne>
</swiat>
<swiat type="end">
<typ>end</typ>
<wyglad><imgage url="xml/end.jpg"/></wyglad>
<neutralne>
<mob>
<name>enderman</name>
<drop>perła</drop>
<opis>Strzela do gracza za pomocą łuku.</opis>
<wyglad><image url="xml/enderman.png"/></wyglad>
</mob>
</neutralne>
<agresywne>
<mob>
<name>smok endu</name>
<drop>exp</drop>
<opis>Końcowy boss gry. Lata i pluje trującymi pociskami.</opis>
<wyglad><image url="xml/end_dragon.jpg"/></wyglad>
</mob>
<mob>
<name>shulker</name>
<drop>pancerz shulkera</drop>
<opis>Po trafieniu przez latające pociski shulkera, gracz lewituje przez jakiś czas w powietrzu.</opis>
<wyglad><image url="xml/shulker.jpg"/></wyglad>
</mob>
</agresywne>
</swiat>
</listaMobow>
I'm from Poland if you wonder which language is that. Whether my usage of xsl and xml is right, doesn't matter for me at the moment, since I haven't been able to even see the result of what I was doing there. I might ask for that later on tho'.
Answering kjhughes problem there was concerning the person asking using xslt version 2.0 instead of 1.0, which is definitely not a problem here, since I was using version 1.0 from the beginning. Also that person was using file located on the server, I'm only using local files. I didn't find any different solutions there and none were related to my problem. The only similarity here and there i see is that we both get the same error from browser, but cause for that is definitely different.