Yes, it could be that the xml+xsl result is a blank page.
What you can do, to quick test your xsl style sheet, is to declare the xsl in the xml file, and to open the xml file in your browser, like this (example files taken from www.quixml.org, one of my projects):
1.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML>
<?xml-stylesheet href="1.xsl" type="text/xsl"?>
<ROOT>
<GENERAL>
<title>Quixml::Quick Xml and Xsl for PHP</title>
<lng>en</lng>
<nav>
<link>
<name>* home</name>
<path>/</path>
<target>_top</target>
</link>
<link>
<name>* Usage manual</name>
<path>/manual/</path>
<target>_top</target>
</link>
<link>
<name>* Class Documentation</name>
<path>/doc/</path>
<target>_top</target>
</link>
<link>
<name>* Licence</name>
<path>/LICENCE</path>
<target>_top</target>
</link>
<link>
<name>* Read Me</name>
<path>/README</path>
<target>_top</target>
</link>
</nav>
</GENERAL>
<DATAS/>
</ROOT>
and in 1.xsl:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--open
08.11.2007, ts, Init
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:output method="html" encoding="UTF-8" indent="yes"
doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"
standalone="yes" omit-xml-declaration="yes"
/>
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="/ROOT/GENERAL/title"/></title>
<xsl:call-template name="SCRIPTS"/>
<xsl:call-template name="LINKS"/>
<link rel="stylesheet" href="/doc/media/stylesheet.css" />
<link rel="stylesheet" href="/doc/media/banner.css" />
<link rel="stylesheet" href="/css/base.css" type="text/css"/>
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<xsl:apply-templates select="ROOT"/>
</body>
</html>
</xsl:template>
<xsl:template match="ROOT">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="GENERAL"/>
<xsl:variable name="GENERAL" select="GENERAL"/>
<!-- FROM INCLUDE org.quixml.utils (html)-->
<!-- org.quixml.utils
5.12.2007 init. Contains the lowercase/uppercase translation templates
-->
<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
<xsl:template name="navItem">
<li>
<a href="{path}" target="_top"><xsl:value-of select="name"/></a>
</li>
</xsl:template>
<!-- END INCLUDE org.quixml.utils-->
<!-- com.quixml.index
028.11.2007, ts, init
-->
<xsl:template name="SCRIPTS"/>
<xsl:template name="LINKS"/>
<xsl:template match="DATAS">
<!-- FROM INCLUDE org.quixml.header (html)-->
<!--org.quixml.header
18/01/2008, Thierry Schork, creation
-->
<div id="divNav">
<ul>
<xsl:for-each select="/ROOT/GENERAL/nav/link">
<xsl:call-template name="navItem"/>
</xsl:for-each>
</ul>
</div>
<div style="position:fixed; top:15px; right:10px;">
<form method="get" action="http://www.google.com/custom" target="_top">
<table border="0" bgcolor="#cccccc">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">
<br/>
<input type="hidden" name="domains" value="www.quixml.org"></input>
<label for="sbi" style="display: none">Enter your search terms</label>
<input type="text" name="q" size="15" maxlength="255" value=""
id="sbi"></input>
<label for="sbb" style="display: none">Submit search form</label>
<input type="submit" name="sa" value="Google Search" id="sbb"></input>
</td></tr>
<tr>
<td nowrap="nowrap">
<table>
<tr>
<td>
<input type="radio" name="sitesearch" value="" checked="checked" id="ss0"></input>
<label for="ss0" title="Search the Web"><font size="-1"
color="black">Web</font></label></td>
<td>
<input type="radio" name="sitesearch" value="www.quixml.org"
id="ss1"></input>
<label for="ss1" title="Search www.quixml.org"><font size="-1"
color="black">www.quixml.org</font></label></td>
</tr>
</table>
<input type="hidden" name="client" value="pub-9456079055461741"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="7738231454"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="cof"
value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
</div>
<br style="clear:both"/>
<!-- SiteSearch Google -->
<!-- END INCLUDE org.quixml.header-->
<div style="font-size:.8em">
<h2>Looking for the Ruby quixml API?</h2>
<p>
Then you will find it on <a href="http://quixml.rubyforge.org/">quixml.rubyforge.org</a>
</p>
</div>
<h1>Quixml: A PHP class to ease the XML + XSL development</h1>
<p>
Welcome to Quixml.org.<br/>
Quixml is a PHP class that I developped upon personal curiosity to exploit a perfect separation between logic
and presentation layers.<br/>
XML and XSL have been designed to answer that question, and after having struggled for a long time with numerous templateing framework for PHP,
I decided to code this library because nothing I found either worked or simply did what I was looking for.
</p>
<h2>Changelog</h2>
<div class="date">20/01/2008</div>
<p>
The manual has been rewrote, and I hope it's a bit more cleare now.<br/>
</p>
<h2>Goal</h2>
<p>
The goal of this class is to provide a simple way to output XML, and to associate an SL stylesheet.<br/>
The class detect itself if the XML should be transformed to HTML (or any other output type, this is configurable) and let you concentrate on the
data retrieval rather than the inner structure of your XML file.
</p>
<h2>Requirements</h2>
<p>
This class have a few requirements, and your PHP installation needs to honnor them before you can use it.<br/><br/>
Imperative requirement:
</p>
<ol>
<li>You must have PHP 5.0 at least. This library is not compatible with PHP 4.<br/>Too many chanegs have occured in the XML and XSL extensions between the 2 versions.</li>
<li>You must ahve the XMLWriter extension active. This class is built around it. This requirement is meant to be dropped in the future.</li>
</ol>
<p>
In addition, the XSL generation process allows you to "include" separate files in 1.
This process can be time consuming on large stylesheets.<br/>
To lighten up the generation process, a caching mechanism have been implemented, which use PDO and Sqlite to store the merged stylsheets.
If you want/plan to use this caching mechanism, then you will need
</p>
<ol>
<li>PDO as the database framework</li>
<li>PDO:Sqlite as the PDO driver</li>
</ol>
<p>
<a href="http://www.sqlite.org">Sqlite</a> is a lightweight database stored in a file.
</p>
<h2>Download</h2>
<p>
18/01/2008: <a href="/quixml.zip">Latest version (development)</a>
</p>
<h2>From here...</h2>
<p>
You can visit the <a href="/manual/" target="_top">manual</a> (sorry for the mess, but I'm working on it) or go directly to the <a href="/doc/" target="_top">class reference</a>.<br/>
Future annoucements will be made here.
</p>
</xsl:template>
<!--close
08.11.2007, ts, Init
-->
</xsl:stylesheet>
Then, drop the xml file on ie or firefox, and if there are errors in it, they will tell it to you.
And you can see the xsl transform result instantly too.
Bookmarks