Problem with Doctype, XSL, and other things.

admin

Administrator
Staff member
The link to the page I'm having trouble with is this: <!-- m --><a class="postlink" href="http://mrinitialman.furtopia.org/Library/Beryl_City/fighter/Characters/fighters-exp.xml">http://mrinitialman.furtopia.org/Librar ... rs-exp.xml</a><!-- m -->

Here's the main XSLT sheet:

<?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>
<xsl:value-of select="cast/info/novel" />: Dramatis Person?br />
<xsl:if test="cast/info/dramatis/@personae='split'">
(<xsl:value-of select="cast/char-type/@role" />)
</xsl:if>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<xsl:for-each select="cast/styles/sheet[@style-type='css']">
<link type="text/css" rel="stylesheet"><xsl:attribute name="href"><xsl:value-of select="@path" /></xsl:attribute></link>
</xsl:for-each>
</head>
<body>
<h1>
<xsl:if test="cast/info/novel/@series!='N/A'">
<div id="series"><xsl:value-of select="cast/info/novel/@series" />:</div>
</xsl:if>
<xsl:value-of select="cast/info/novel" />
</h1>
<h2>Dramatis Person?lt;/h2>
<xsl:if test="cast/info/dramatis/@personae='split'">
<h3 style="border:0;margin-top:0;"><xsl:value-of select="cast/char-type/@role" /></h3>
<h4>In order of appearance</h4>
</xsl:if>
<div id="rating">RATED<br />
<img>
<xsl:attribute name="src"><xsl:value-of select="cast/info/rating/@graphic" /></xsl:attribute>
<xsl:attribute name="alt">
<xsl:choose>
<xsl:when test="cast/info/rating/@level='NR'">
<xsl:text>Not Rated</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Web </xsl:text><xsl:value-of select="cast/info/rating/@level" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</img>
</div>
<xsl:for-each select="/cast/char-type">
<xsl:if test="cast/info/dramatis/@personae!='split'">
<h3><xsl:value-of select="@role" />:</h3>
<h4>In order of appearance</h4>
</xsl:if>
<dl>
<xsl:for-each select="character">
<dt><xsl:value-of select="name" />
<xsl:if test="/cast/notes/@needed='yes'">
<sup><xsl:value-of select="name/@note" /></sup>
</xsl:if>
</dt>
<dd>
<table>
<xsl:for-each select="facts/fact[@type='stat']">
<tr>
<th><xsl:value-of select="@stat" />:</th>
<td><xsl:value-of select="." />
<xsl:if test="/cast/notes/@needed='yes'">
<sup><xsl:value-of select="@note" /></sup>
</xsl:if>
</td>
</tr>
</xsl:for-each>
</table>
<xsl:for-each select="facts/fact[@type!='stat']">
<p class="factoids">
<strong><xsl:value-of select="@value" />:</strong>
<xsl:value-of select="." />
<xsl:if test="/cast/notes/@needed='yes'">
<sup><xsl:value-of select="@note" /></sup>
</xsl:if>
</p>
</xsl:for-each>
<div class="appear">
<strong>First Appearance:</strong> Chapter <xsl:value-of select="appears/@chapter" />
<xsl:if test="/cast/notes/@needed='yes'">
<sup><xsl:value-of select="appears/@note" /></sup>
</xsl:if>
</div>
<xsl:value-of select="desc" />
<xsl:if test="/cast/notes/@needed='yes'">
<sup><xsl:value-of select="desc/@note" /></sup>
</xsl:if>
<xsl:if test="/cast/styles/@xsl-includes='yes'">
<xsl:apply-imports />
</xsl:if>
<xsl:if test="/cast/info/copyrights/@owner='various'">
<em><xsl:value-of select="name" /> ?<xsl:value-of select="copyright/@name" />
<xsl:if test="/cast/notes/@needed='yes'">
<sup><xsl:value-of select="copyright/@note" /></sup>
</xsl:if>
</em>
</xsl:if>
</dd>
</xsl:for-each>
</dl>
</xsl:for-each>
<xsl:if test="/cast/info/copyrights/@owner!='various'">
<div id="copyrights">All characters ?<xsl:value-of select="/cast/info/copyrights/@owner" /></div>
</xsl:if>
<xsl:if test="/cast/notes/@needed='yes'">
<div id="notes">
<h3>Notes</h3>
<xsl:for-each select="/cast/notes/set">
<xsl:choose>
<xsl:when test="@char-role='N/A'">
<h4>Other Notes</h4>
<ul>
<xsl:for-each select="note">
<li><strong><xsl:value-of select="@number" />: </strong><xsl:value-of select="." /></li>
</xsl:for-each>
</ul>
</xsl:when>
<xsl:otherwise>
<h4><xsl:value-of select="@char-role" /></h4>
<ul>
<xsl:for-each select="note">
<li><strong><xsl:value-of select="@number" />: </strong><xsl:value-of select="." /></li>
</xsl:for-each>
</ul>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</div>
</xsl:if>
<ul id="nav">
<xsl:for-each select="/cast/link">
<li id="nav"><a><xsl:attribute name="href"><xsl:value-of select="@url" /></xsl:attribute><xsl:value-of select="@title" /></a></li>
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
<xsl:import><xsl:attribute name="href"><xsl:value-of select="/cast/styles/sheet[@style-type='xsl']/@path" /></xsl:attribute></xsl:import>
</xsl:stylesheet>

Here;s the auxiliary XSL sheet in question:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/cast/char-type/character">
<for-each select="fights">
<table id="tournament">
<caption><xsl:value-of select="@tournament" /> Tournament Results</caption>
<thead>
<tr>
<th>Round</th>
<th>Opponent</th>
<th>Result</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="fight">
<tr>
<td><xsl:value-of select="@round" /></td>
<td><xsl:value-of select="@opponent" /></td>
<td><xsl:value-of select="@result" /></td>
</tr>
</xsl:for-each>
</tbody>
<tfoot>
<tr>
<td colspan="3">Final Result: <xsl:value-of select="@results" /></td>
</tr>
</tfoot>
</table>
</for-each>
</xsl:template>
</xsl:stylesheet>

When I try to load it, I get this error:
Error during XSLT transformation: XSLT transformation failed.

As for the doctype, when I try to validate the XML page (<!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http%3A%2F%2Fmrinitialman.furtopia.org%2FLibrary%2FBeryl_City%2Ffighter%2FCharacters%2Ffig">http://validator.w3.org/check?uri=http% ... ters%2Ffig</a><!-- m --> hters-exp.xml&charset=%28detect+automatically%29&doctype=Inline), the validator says it isn't valid, but can't figure out an error. What have I done wrong?
 
Back
Top