|Oracle8i Application Developer's Guide - XML
Release 3 (8.1.7)
Part Number A86030-01
Using JDeveloper to Build Oracle XML Applications, 9 of 11
XSQL Servlet offers a productive and easy way to get XML in and out of the database.
Chapter 3, "Oracle XML Components and General FAQs" and Chapter 19, "Using XSQL Servlet" for information about how to use XSQL Servlet.
When using XSQL Servlet in JDeveloper, you do not need to include the XSQL Runtime in your project as this is already done for any new XSQL Page or XSQL wizard-based application.
Using simple scripts you can do the following from JDeveloper:
Consider a simple query in an XSQL file, which returns details about all the employees in the emp table. The XSQL code to get this information would be as shown in Example 2:
<?xml version="1.0"?> <xsql:query xmlns:xsql="urn:oracle-xsql" connection="demo"> select * from emp order by empno </xsql:query>
Figure 14-7 shows what the raw employee XML data displayed on the browser.
If you want to output your data in a tabular form as shown in Figure 14-6, make a small modification to your XSQL code to specify a stylesheet. The changes you would make in this example are shown below highlighted.
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="emp.xsl"?> <xsql:query xmlns:xsql="urn:oracle-xsql" connection="demo"> select * from emp order by empno </xsql:query>
The result would be like the table shown in Figure 14-6. You can do a lot more with XSQL Servlet of course.
Chapter 19, "Using XSQL Servlet" and also the XDK for Java, XSQL Servlet Release Notes on OTN at http://technet.oracle.com/tech/xml