Jak wstawić xml na stronę / serwer

0

jak wstawić te pliki, aby działały poprawnie na serwerze,
mam plik .xml i .xsl , i teraz chciałbym aby strona była online, jak to zrobić z xml?

0

Dodaj po deklaracji xml, taką linijkę:

<?xml-stylesheet type="text/xsl" href="nazwaplikuarkusza.xsl"?>

Wtedy przeglądarka przekształci xmla i zwróci wynik transformacji.

0

Bez nazwy.jpg
powiesz mi czy te błedy to są błedy ? czy nie? bo ich nie bardzo rozumiem

0

Nie wiem jak pomóc bo:

  1. Nie znam xml którego wystawiasz
  2. Nie znam xslt który wystawiasz
  3. Nie wiem jaki jest wynik transformacji.

Domyślam się, ze xml i xslt nie są zapisane w utf8. Instrukcja xml nie zawiera atrybuty charset

0

tutaj mam xslt i jest utf-8

<?xml version = "1.0" encoding = "UTF-8"?>
<xsl:stylesheet version = "1.0" 
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">   

   <xsl:template match = "/"> 
		
      <html> 
	  <head>
	  <title>Places in Poland</title>
	  <style>
	  body {background-color: #99e6ff;}
	  h2 { font-family: Century Gothic; font-style: italic; line-height: 2.2; text-align: center;}
	  td, th { font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 20px;      border: 1px solid black;}
	  p{text-indent: 50px; font-size: 18px;}
	  p.click_img { font-size: 15px; text-align: left; text-decoration: underline; }
	  table{
	  outline-style: dotted;
	  border-spacing: 4mm;
	  margin-top: 20px;
	  margin-bottom: 10px;
      margin-right: 150px;
      margin-left: 250px;
	  }
		  </style>
	  </head>
         <body> 
            <h2>Places in Poland</h2> 
			
			<p> Here we've got a table with a different places located all around the Poland.This is a simple example of a few places
			where you can go.  <br/>
				The small places were painted with green, and the bigger places with red</p>
			<p class="click_img">click on the image to see it in full screen</p>
			
            <table border = "0" > 
               <tr bgcolor = "#9acd32"> 
                  <th>Place</th> 
                  <th>Name</th> 
                  <th>population</th> 
                  <th>area</th> 
				  <th>MAMSL</th> 
                  <th>img</th> 
               </tr> 
				
               
               <xsl:for-each select="/places/place"> 
				 <tr> 
                    <td> 
                        <xsl:value-of select = "@category"/> 
                    </td> 
					
				<xsl:choose>
					<xsl:when test="name/@type='small'">
						<td bgcolor="#99ff99">
						<xsl:value-of select = "name"/>
						</td>
					</xsl:when>
					<xsl:when test="name/@type='big'">
						<td bgcolor="#ff9999">
						<xsl:value-of select = "name"/>
						</td>
					</xsl:when>
					<xsl:otherwise>
						<td><xsl:value-of select="name"/></td>
					</xsl:otherwise>
				</xsl:choose>
                    
                    <td><xsl:value-of select = "population"/></td> 
                    <td><xsl:value-of select = "area"/></td> 
                    <td><xsl:value-of select = "MAMSL"/></td> 
					<td>
					<a target="_blank">
					<xsl:attribute name="href" ><xsl:value-of select="img/@url" /></xsl:attribute>
					<img width="60" alt="no image">
					<xsl:attribute name="src" ><xsl:value-of select="img/@url" /></xsl:attribute>
					</img>
					</a>
					</td> 
					
                  </tr> 
               </xsl:for-each> 
					
            </table> 
			<footer style="text-align: right; font-style: oblique;">by </footer>
         </body> 
      </html> 
   </xsl:template>  
</xsl:stylesheet>

1 użytkowników online, w tym zalogowanych: 0, gości: 1