homepage Welcome to WebmasterWorld Guest from 54.205.236.46
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
Is correct XHTML to mobile format?
toplisek




msg:4265685
 4:07 pm on Feb 11, 2011 (gmt 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);}
?>

 

httpwebwitch




msg:4265718
 4:45 pm on Feb 11, 2011 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved