Chapter 8. Publishing Data with XSQL Pages

Once you discover the advantages of working with database information in XML, you’ll find yourself building XML datagrams from SQL statements for many common tasks. In addition to providing XML components that simplify this job for developers, Oracle has anticipated a much broader interest in serving database-driven XML, and has provided an easier route for non-programmers. Using Oracle’s XSQL Pages facility, anyone who is familiar with SQL can quickly and easily build XML data pages from easy-to-author templates.

Introduction to XSQL Pages

XSQL pages are templates in *.xsql files that allow anyone familiar with SQL to declaratively:

  • Assemble dynamic XML “data pages” based on one or more parametrized SQL queries

  • Transform a data page to produce a final result in any desired XML, HTML, or text-based format using an associated XSLT stylesheet

These templates are processed by a common XSQL page processor engine shared by the XSQL Servlet, the XSQL command-line utility, and the programmatic API for processing XSQL pages called the XSQLRequest class, as shown in Figure 8.1.

Overview of XSQL Pages architecture

Figure 8-1. Overview of XSQL Pages architecture

As this chapter will illustrate, you can accomplish surprising things in a declarative way by combining SQL, XML, and XSLT.

Tip

As part of the Oracle XML Developer’s Kit, Oracle XSQL Pages is included in Oracle JDeveloper 3.1 and ...

Get Building Oracle XML Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.