Home
Page
Back to Papers
Introduction - Why WAP?
WML
XML
The Oracle XDK
An Example Application
Our first XSQL Page
Browser Sensitivity
A WML Stylesheet
WML Output
An HTML Stylesheet
Conclusion and Resources
|
Please note this page has moved to http://oracledoug.com/wap10.html. You will be redirected in 5 seconds but it would be better to update your bookmarks ;-)
An HTML Stylesheet
Although I've just illustrated WML output, we could create other stylesheets for other browsers and apply them conditionally, based on the browser used to access the XSQL page.
<?xml-stylesheet type="text/xsl"
media="Mozilla/4.0 (compatible; MSIE"
href="jobserve_html.xsl"?>
<?xml-stylesheet type="text/xsl"
media="Mozilla/3.0 (compatible; HandHTTP 1.1)"
href="jobserve_palm.xsl"?>
The two lines above instruct the XSL Servlet to use completely different stylesheets based on the user accessing the page from different browsers, the first for Internet Explorer, the second for a PalmOS browser that I used in development. Once the initial work on the XSQL page had been completed, implementing new stylesheets for new devices proved easy and I didn't have to touch any of the underlying data access code (other than to insert a new stylesheet reference in the XSQL page). Here is an example of the stylesheet for Internet Explorer. The output is very basic, but it's useful to compare the stylesheet to generate HTML with the one used earlier to generate WML
Example 7 - JOBSERVE_HTML.XSL
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<p><b>Recent Postings</b></p>
<xsl:for-each select="ROWSET/ROW">
<p><b><xsl:value-of select="TITLE"/></b></p>
<p><xsl:value-of select="LOCATION"/></p>
<p><xsl:value-of select="SKILLS"/></p>
</xsl:for-each>
</html>
</xsl:template>
</xsl:stylesheet>
Much simpler, isn't it?
Previous
|