O'Reilly logo

Building Oracle XML Applications by Steve Muench

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Serving XML in Any Format

We see something interesting in the Oracle XSQL Pages material explaining that we can create a new XSQL page that reuses the dynamic XML content produced by another page with a tag called <xsql:include-xsql> . We also notice that by including one extra line at the top of our page, like this:

<?xml-stylesheet type="text/xsl" href="FAQ-In-XML.xsl"?>

we can get the XSQL page processor to handle the XSLT transformation automatically before it returns the results to the requester. So we combine these two little pearls of information to create a new XSQL page called FAQXML.xsql:

<?xml version="1.0"?>
<!-- FAQXML.xsql: Show FAQ.xsql in Standard FAQ-List.dtd Vocabulary  -->
<?xml-stylesheet type="text/xsl" href="FAQ-In-XML.xsl"?>
<xsql:include-xsql href="FAQ.xsql" xmlns:xsql="urn:oracle-xsql"/>

This uses <xsql:include-xsql> to include the XML results from our previous work, and associates the FAQ-In-XML.xsl stylesheet we created above to this page. Now, when we try from our browser to request the new XSQL page for the jdev category of frequently asked questions, as shown in Figure 3.2, we see our dynamic information in our <FAQ-List> format with no manual steps involved. Pretty neat.

Viewing the dynamic FAQ in the FAQ-List XML format

Figure 3-2. Viewing the dynamic FAQ in the FAQ-List XML format

Just then, we learn that our CEO is expanding into Europe by acquiring another promising startup in London. In a parallel universe, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required