One Guestbook for both PC and WAP Browsers

Maintaining an updated website can require more time than you might expect. For those interested in maintaining a Mobile website in addition to their regular website, the time required can more than double. One powerful mechanism to provide content to both websites, involves the use of XSL Transform language to serve both HTML and WML code from a single source.

When both your PC and mobile websites are closely integrated, a common guestbook may make sense. To satisfy this need, we embarked upon the project of displaying an XML file used to store guestbook data by transforming it using an XSL Stylesheet. The transformation takes place via a Java servlet using an XSL Transformer. When a request is made by a browser, the servlet determines the type of browser by its user-agent parameter and selects the appropriate stylesheet. For example, if a Mobile browser makes the request, the XML file containing the guestbook data is transformed using a stylesheet that will provide WML code. If the browser is the normal PC type browser, the Java servlet will choose the html stylesheet, and thus transform the XML file into HTML code.

For those interested in the technical side, here is a list of text files which include the necessary data and transformation files. The Java code used in the servlet is not included.

Guestbook Data File
HTML XSL Stylesheet
WML XSL Stylesheet
The Socker Fan is a website for S. East PA Girls Soccer and used a single guestbook for its PC and Mobile websites. For those interested in seeing the results, you can access The Sockerfan's Guestbook from their PC website at and their mobile site from

Click here to return to The Fieldmaster home page...