In JDeveloper, you can create an XSL style sheet that you can apply to your XSQL files in order to format the data for HTML, WML or another output. When you create an XSL style sheet, it is added to the selected XSQL project.
To create an XSL style sheet:
A skeleton XSL file is generated and appears in your active project.
You can edit it in the XML Editor to create your own custom style sheet. An example of an XSL style sheet that transforms XML data into wireless markup language (WML) is provided below. When you are finished, you can specify the style sheet name in your XSQL file to format the raw XML data.
This style sheet demonstrates the conversion of XML to WML. It uses the default DeptView in a BC4J application.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Root template -->
<xsl:output type="wml" media-type="text/x-wap.wml"
doctype-public="-//WAPFORUM//DTD WML 1.1//EN"
doctype-system="http://www.wapforum.org/DTD/wml_1.1.xml" indent="yes"
/>
<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>
<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>
<xsl:template match="/">
<wml>
<card id="C1">
<p mode="nowrap">
<big>DEPTLIST</big>
</p>
<xsl:for-each select="page/DeptView/DeptViewRow">
<p>
<strong><xsl:value-of select="Deptno"/> </strong>
<xsl:value-of select="Dname"/>
<xsl:value-of select="Loc"/>
</p>
</xsl:for-each>
</card>
</wml>
</xsl:template>
</xsl:stylesheet>
To see the result of using this style sheet, you can create a new BC4J project based on the DEPT table, create an XSQL page in which you reference this style sheet, and use the (BC4J) ViewObject Action Handler.