Problem with doctypes Jeff Rodriguez
From : Jeff Rodriguez <modxslt@xxxxxxxxxxxx>
To : users@xxxxxxxxxxxxxxxx
Subject : Problem with doctypes
Date : Fri, 15 Oct 2004 14:19:52 -0700
User-agent : Mozilla Thunderbird 0.8 (Windows/20040913)
[attachments]
Transforming with xsltproc yields just what I expect, a page full of HTML.
Transforming with modxslt-parse (or the apache module) yields an essentially
blank page.
If I pull out the doctype part in the xsl:output tag (in the xsl file):
<xsl:output method="xml" media-type="text/html"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" ;
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
Everything works fine however I can't specify a doctype and therefore get valid
XHTML :)
Please help,
Jeff
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="./syslog.xsl" charset="UTF-8"?>
<syslog search="search string"/>
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ;>
<xsl:output method="xml" media-type="text/html" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" ; doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" ;>
<head>
<title>Syslog Search</title>
<!-- Calendar -->
<link rel="stylesheet" type="text/css" href="css/calendar-system.css"/>
</head>
<body style="font-family: arial, 'lucida console', sans-serif">
<div style="font-size: x-large">Syslog Search</div>
<hr width="100%" size="1" />
<!-- {{{: Search -->
<form action="/" method="get">
<table>
<tr>
<td nowrap="nowrap">Start Time</td>
<td><div id="timeStartDiv" /></td>
</tr>
<tr>
<td nowrap="nowrap">End Time</td>
<td><div id="timeEndDiv" /></td>
</tr>
<tr>
<td nowrap="nowrap">Search</td>
<td><input type="text" name="search" id="search" value="{//@search}"/></td>
</tr>
<tr>
<td nowrap="nowrap" colspan="2" align="center">
<input type="hidden" name="timeStart" id="timeStart" value="{//@timeStart}"/>
<input type="hidden" name="timeEnd" id="timeEnd" value="{//@timeEnd}"/>
<input type="submit" name="Search" value="Search"/>
</td>
</tr>
</table>
</form>
<!-- {{{: Calendar Fields -->
<script type="text/javascript">
Calendar.setup({
inputField : "timeStart", // ID of the input field
flat : "timeStartDiv", // ID of the DIV the calendar will be put in
ifFormat : "%Y-%m-%d %H:%M", // the date format
showsTime : true,
timeFormat : "24",
showOthers : true});
Calendar.setup({
inputField : "timeEnd", // ID of the input field
flat : "timeEndDiv", // ID of the DIV the calendar will be put in
ifFormat : "%Y-%m-%d %H:%M", // the date format
showsTime : true,
timeFormat : "24",
showOthers : true});
</script>
<!-- }}} -->
<!-- }}} -->
<!-- {{{: Results -->
<!-- DEBUGGING
<xsl:if test=".//@query">
<br />
<div class="Head" style="clear: both;">Syslog :: Search Query</div>
<hr width="100%" size="1" />
<pre>
<xsl:value-of select="//@query"/>
</pre>
</xsl:if>
-->
<xsl:if test="not(//. = '')">
<br />
<div class="Head" style="clear: both;">Syslog :: Search Result</div>
<hr width="100%" size="1" />
<table class="Normal" cellspacing="0" cellpadding="0" border="0" style="">
<!-- {{{: List header -->
<tr class="ListHead">
<th class="LinedTableCell">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="javascript:;" class="SubHead">Id</a>
</td>
</tr>
</table>
</th>
<th style="background-color: #E7E7FF;"><img src="trans.gif" alt="" width="1" height="1" /></th>
<th class="LinedTableCell">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="javascript:;" class="SubHead">Date</a>
</td>
</tr>
</table>
</th>
<th style="background-color: #E7E7FF;"><img src="trans.gif" alt="" width="1" height="1" /></th>
<th class="LinedTableCell">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="javascript:;" class="SubHead">Priority</a>
</td>
</tr>
</table>
</th>
<th style="background-color: #E7E7FF;"><img src="trans.gif" alt="" width="1" height="1" /></th>
<th class="LinedTableCell">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="javascript:;" class="SubHead">Message</a>
</td>
</tr>
</table>
</th>
</tr>
<!-- }}} -->
<!-- {{{: List items -->
<xsl:for-each select="syslog/logs/log">
<xsl:choose>
<!-- {{{: Even row -->
<xsl:when test="position() mod 2 = 0">
<tr class="ListEven">
<td class="LinedTableCell">
<xsl:value-of select="@id"/>
</td>
<td style="background-color: #4A3C8C;"><img src="trans.gif" alt="" width="1" height="1" /></td>
<td class="LinedTableCell" nowrap="nowrap">
<xsl:value-of select="@date"/>
</td>
<td style="background-color: #4A3C8C;"><img src="trans.gif" alt="" width="1" height="1" /></td>
<td class="LinedTableCell">
<xsl:value-of select="@priority"/>
</td>
<td style="background-color: #4A3C8C;"><img src="trans.gif" alt="" width="1" height="1" /></td>
<td class="LinedTableCell">
<xsl:value-of select="."/>
</td>
</tr>
</xsl:when>
<!-- }}} -->
<!-- {{{: Odd row -->
<xsl:otherwise>
<tr class="ListOdd">
<td class="LinedTableCell">
<xsl:value-of select="@id"/>
</td>
<td style="background-color: #4A3C8C;"><img src="trans.gif" alt="" width="1" height="1" /></td>
<td class="LinedTableCell" nowrap="nowrap">
<xsl:value-of select="@date"/>
</td>
<td style="background-color: #4A3C8C;"><img src="trans.gif" alt="" width="1" height="1" /></td>
<td class="LinedTableCell">
<xsl:value-of select="@priority"/>
</td>
<td style="background-color: #4A3C8C;"><img src="trans.gif" alt="" width="1" height="1" /></td>
<td class="LinedTableCell">
<xsl:value-of select="."/>
</td>
</tr>
</xsl:otherwise>
<!-- }}} -->
</xsl:choose>
</xsl:for-each>
<!-- }}} -->
</table>
</xsl:if>
<!-- }}} -->
</body>
</html>
</xsl:template>
</xsl:stylesheet>