Oracle8i Application Developer's Guide - XML
Release 3 (8.1.7)

Part Number A86030-01


Solution Area



Go to previous page Go to beginning of chapter Go to next page

Using XSQL Servlet, 12 of 24

XSQL Servlet Examples in demo/

Table 23-1 lists the XSQL Servlet example applications supplied with the software in demo/. Instructions for installing the demos are included in the Installation section of these release notes.

Table 19-3 XSQL Servlet Examples Supplied in demo/  
Demonstration Name (File Name)  Description 

Hello World (helloworld) 

Simplest possible XSQL page.  

Do You XML Site (doyouxml) 

XSQL page shows how a to build a data-driven web site with an XSQL page. Uses SQL, XSQL-substitution variables in queries, and XSLT to format.

Uses substitution parameters in SQL statements in <xsql:query> tags, and in attributes to <xsql:query> tags, to control for example how many records to display, or to skip, for paging through query results. 

Employee Page (emp) 

XSQL page displays XML data from EMP table, using XSQL page parameters to control employees and data sorting.

Uses an associated XSLT Stylesheet to format results as HTML version of emp.xsql page. This is the form action hence you can fine tune your search criteria. 

Insurance Claim Page (insclaim) 

Shows sample queries over a structured, Insurance Claim object view. insclaim.sql sets up the INSURANCE_CLAIM_VIEW object view and populates it with sample data.  

Invalid Classes Page (classerr) 

XSQL Page uses invalidclasses.xsl to format a "live" list of current Java class compilation errors in your schema. The .sql script sets up XSQLJavaClassesView object view for the demo. Master/detail information from object view is formatted into HTML by the invalidclasses.xsl stylesheet in the server. 

Airport Code Validation (airport) 

XSQL page returns a "datagram" of information about airports based on their three-letter codes. Uses <xsql:no-rows-query> as alternative queries when initial queries return no rows. After attempting to match the airport code passed in, the XSQL page tries a fuzzy match based on the airport description.

airport.htm page demonstrates how to use the XML results of airport.xsql page from a web page using JavaScript to exploit built-in XML Document Object Model (DOM) functionality in Internet Explorer 5.0.

When you enter the three-letter airport code on the web page, a JavaScript fetches the XML datagram from XSQL Servlet over the web corresponding to the code you entered. If the return indicates no match, the program collects a "picklist" of possible matches based on information returned in the XML "datagram" from XSQL Servlet 

Airport Code Display (airport) 

Demonstrates using the same XSQL page as the Airport Code Validation example but supplying an XSLT Stylesheet name in the request. This causes the airport information to be formatted as an HTML form instead of being returned as raw XML.  

Emp/Dept Object View Demo (empdept) 

How to use an object view to group master/detail information from two existing "flat" tables like EMP and DEPT. empdeptobjs.sql script creates the object view and INSTEAD OF INSERT triggers, allowing the use of master/detail view as an insert target of xsql:insert-request.

empdept.xsl stylesheet illustrates an example of the "simple form" of an XSLT stylesheet that can look just like an HTML page without the extra xsl:stylesheet or xsl:transform at the top. Part of XSLT 1.0 specification called using a Literal Result Element as Stylesheet.

Shows how to generate an HTML page that includes the <link rel="stylesheet"> to allow the generated HTML to fully leverage CSS for centralized HTML style information, found in the coolcolors.css file. 

Adhoc Query Visualization (adhocsql)  

Shows how to pass an SQL query and XSLT Stylesheet to use as parameters to the server. 

XML Document Demo (document) 

How to insert XML documents into relational tables.

docdemo.sql script creates a user-defined type called XMLDOCFRAG containing an attribute of type CLOB.

  • Insert the text of the document in ./xsql/demo/xml99.xml and provide the name xml99.xsl as the stylesheet

  • Insert the text of the document in./xsql/demo/JDevRelNotes.xml with the stylesheet relnotes.xsl.



docstyle.xsql page illustrates an example of the <xsql:include-xsql> action element to include the output of the doc.xsql page into its own page before transforming the final output using a client-supplied stylesheet name.

XML Document demo uses client-side XML features of Internet Explorer 5.0 to check the document for well-formedness before it is posted to the server. 

XML Insert Request Demo (insertxml)

Posts XML from a client to an XSQL Page that inserts the posted XML information into a database table using the <xsql:insert-request> action element.

The demo accepts XML documents in the XML-based news format. The program posting the XML is a client-side web page using Internet Explorer 5.0 and the XMLHttpRequest object from JavaScript.

The source for insertnewsstory.xsql page, specifies a table name and XSLT Transform name.

moreover-to-newsstory.xsl stylesheet transforms the incoming XML into canonical format that OracleXMLSave utility can insert. Copy and paste the example <article> element several times within the <moreovernews> element to insert several new articles in one shot.

newsstory.sql shows how INSTEAD OF triggers can be used on the database views into which you ask XSQL Pages to insert to the data to customize how incoming data is handled, default primary key values,.... 

SVG Demo (svg) 

deptlist.xsql page displays a simple list of departments with hyperlinks to SalChart.xsql page.

SalChart.xsql page queries employees for a given department passed in as a parameter and uses the SalChart.xsql stylesheet to format the result into a Scalable Vector Graphics drawing, a bar chart comparing salaries of the employees in that department.

Browse http://localhost/xsql/index.html to see a list of all the demos.  

Go to previous page Go to beginning of chapter Go to next page
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.


Solution Area