Welcome to WebmasterWorld Guest from 54.159.239.251

Forum Moderators: httpwebwitch

Message Too Old, No Replies

Is correct XHTML to mobile format?

     
4:07 pm on Feb 11, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Oct 25, 2006
posts: 1023
votes: 0


We all know:
XSL is a good choice for converting your XHTML data into WML technology based mobile or any other types of mobile content.


transform XHTML format into WML like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html>
<head>
<title>Mobile website</title>
<link rel="stylesheet" href="mobilexml.css" type="text/css"/>
</head>
<body>
<h1>Current Articles</h1>
<p><a href=""></a>1</p>
<p><a href=""></a>2</p>
<p><a href=""></a>3</p>
<p><a href=""></a>4</p>
</body>
</html>

Is this correct way or missing PHP?

<?
$device=new wurfl_class($HTTP_USER_AGENT);
if($device->browser_is_wap){
$xhtmlfile="mobileXML.html";
$xslfile="transformtoXSL.xsl";
$xsltransform=xslt_create();
$xslresult=xslt_process($xsltransform,$xhtmlfile,$xslfile);
print($xslresult);
xslt_free($xsltransform);}
?>
4:45 pm on Feb 11, 2011 (gmt 0)

Moderator This Forum from CA 

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 29, 2003
posts:4059
votes: 0


I'm not familiar with the wurfl_class(), but the other PHP looks OK.

The best way to debug/troubleshoot PHP is to open a shell window (Terminal, PuTTy, or whatever you have), SSH into the server (or localhost if you're testing locally), find your PHP error logs - they are often at /usr/local/apache/logs/ .

do this command:

#> tail -f error_log

where "error_log" is the name of the log file. Sometimes it's named something else.

Run your code, and see if any errors pop up. They'll be descriptive enough that you can diagnose any problems that are happening in the script.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members