Jump to content
Sign in to follow this  
dabear

Feil i xmlstylesheet?

Recommended Posts

Hey, har prøvd å lært meg xslt, men jeg sliter litt. Her er xml.xml:

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="computerstyle.xsl"?>
<computers>
<computer>

 <manufactorer>Intel</manufactorer>
 <hardrive >seagate</hardrive>
 <hdspace suffix="GB">160</hdspace>

</computer>


<computer>

 <manufactorer>Intel</manufactorer>
 <hardrive >seagate</hardrive>
 <hdspace suffix="GB">160</hdspace>

</computer>





</computers>


 

og computerstyle.xsl :

<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://w3.org/1999/XSL/Transform">

<xsl:template match="/">

<html>
<body>

<h2>Data Informasjon</h2>

<table>

<tr>

<td>Produsent</td>
<td>Hardisk</td>
<td>Hardisk plass</td>

</tr>



<xsl:for-each select="computers/computer">
<tr>
<td><xsl:value-of select="manufactorer" /></td>
<td><xsl:value-of select="hardrive"     /></td>
<td><xsl:value-of select="hdspace"      /></td>
</tr>
</xsl:for-each>

</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

 

Når jeg nå åpner xml.xml skal det infoen vises som et html dokument, men eneste output jeg får ( i IE ) er :


Data Informasjon
Produsent Hardisk Hardisk plass 
  

Hva har jeg gjort feil?

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...