By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,053 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,053 IT Pros & Developers. It's quick & easy.

Sablotron xslt question. Is there a better way to code this?

P: n/a
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($xh, $currentpath . "continents.xml",
$currentpath . "default_wml.xsl");
}
else if($browsertype == "HTML")
{
$result = xslt_process($xh, $currentpath . "continents.xml",
$currentpath . "default_html.xsl", 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:stylesheet 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="contenttable"/>
<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>
BLAHHHHHHHHHHHHHHHHH

</td>
</tr>

</table>
</xsl:template>
</xsl:stylesheet>
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
anybody have any ideas?
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.