spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / xml / column81

XML Features of Oracle 8i and 9i

Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

XSQL servlet

XSQL servlet - as distinct from the XSU described above - is a tool that processes SQL queries and outputs the result set as XML. As a standard java servlet it should work with any java enabled web server. As input it uses an "XSQL" file: an XML file containing embedded SQL queries. XSQL pages are similar to ASPs/JSPs but give XML as output and allow for standard XML processing using XSL.

Example XSQL file:

<?xml version="1.0"?>
<xsql:query connection="demo" xmlns:xsql="urn:oracle-xsql">
  SELECT Carrier, FlightNumber, Origin, ExpectedTime
  FROM FlightSchedule
  WHERE Destination = '{@City}'
</xsql:query>

Called via:

http://mywebserver/flights.xsql?City=LHR

Would result in this output:

<?xml version="1.0"?>
<ROWSET>
  <ROW num="1">
    <CARRIER>LH</CARRIER>
    <FLIGHTNUMBER>LH343</FLIGHTNUMBER>
    <ORIGIN>London</ORIGIN>
    <DUE>12:44</DUE>
  </ROW>
  <ROW num="2">
    <CARRIER>BA</CARRIER>
    <FLIGHTNUMBER>BA272</FLIGHTNUMBER>
    <ORIGIN>Birmingham</ORIGIN>
    <DUE>02:05</DUE>
  </ROW>
</ROWSET>

But XSQL pages can also contain references to stylesheets such as:

<?xml-stylesheet type="text/xsl" href="flight-list.xsl"?>

to convert the above into HTML or other formats.

Other features of XSQL pages:

XSQL servlet can be called in different ways:

Next is the XML class generator...


Produced by Michael Claßen

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji

URL: http://www.webreference.com/xml/column81/4.html
Created: May 10, 2003
Revised: May 10, 2003