Here is my code that works fine. I am wondering if there is a better
way to do this. In my xslt transformation it seems I
HAVE to reference an XML file even though I am just processing a
stylesheet. So as you can see in my code I reference a valid
xml file named continents.xml- even though the xsl styleheet does not
NEED it! Is there different syntax for doing this so I
don't need the reference to continents.xml? ???
=============== ========
default.php:
=============== ========
$xh = xslt_create();
if($browsertype == "WML")
{
Header("Content-Type:text/vnd.wap.wml");
$result = xslt_process($x h, $currentpath . "continents.xml ",
$currentpath . "default_wml.xs l");
}
else if($browsertype == "HTML")
{
$result = xslt_process($x h, $currentpath . "continents.xml ",
$currentpath . "default_html.x sl", NULL, array(),
$params);
}
if ($result)
{
print $result;
}
else
{
print "xslt error occured";
}
xslt_free($xh);
=============== =========
search_html.xsl file:
=============== =========
<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:include href="inc_html. xsl"/>
<xsl:output method="html"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<xsl:call-template name="header"/>
</head>
<body>
<xsl:call-template name="topbody"/>
<xsl:call-template name="contentta ble"/>
<xsl:call-template name="footer"/>
</body>
</html>
</xsl:template>
<xsl:template name="content">
<table width="90%" cellpadding="0" cellspacing="0" border="0"
class="content" >
<tr>
<td>
BLAHHHHHHHHHHHH HHHHH
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
way to do this. In my xslt transformation it seems I
HAVE to reference an XML file even though I am just processing a
stylesheet. So as you can see in my code I reference a valid
xml file named continents.xml- even though the xsl styleheet does not
NEED it! Is there different syntax for doing this so I
don't need the reference to continents.xml? ???
=============== ========
default.php:
=============== ========
$xh = xslt_create();
if($browsertype == "WML")
{
Header("Content-Type:text/vnd.wap.wml");
$result = xslt_process($x h, $currentpath . "continents.xml ",
$currentpath . "default_wml.xs l");
}
else if($browsertype == "HTML")
{
$result = xslt_process($x h, $currentpath . "continents.xml ",
$currentpath . "default_html.x sl", NULL, array(),
$params);
}
if ($result)
{
print $result;
}
else
{
print "xslt error occured";
}
xslt_free($xh);
=============== =========
search_html.xsl file:
=============== =========
<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:include href="inc_html. xsl"/>
<xsl:output method="html"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<xsl:call-template name="header"/>
</head>
<body>
<xsl:call-template name="topbody"/>
<xsl:call-template name="contentta ble"/>
<xsl:call-template name="footer"/>
</body>
</html>
</xsl:template>
<xsl:template name="content">
<table width="90%" cellpadding="0" cellspacing="0" border="0"
class="content" >
<tr>
<td>
BLAHHHHHHHHHHHH HHHHH
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
Comment