Additional XML Delivery Options

This section describes additional options available to you for delivery of XML in a variety of special cases.

Optimizing Presentation for Requesting Device

It is often desirable to serve the same data differently depending on what kind of program makes the request. For example, you may want to customize the XSLT-based presentation of an XSQL page to specifically optimize for the different capability Sets of the Netscape, Internet Explorer, and Lynx browsers. There are many reasons why you might want to differentiate in this way; here are a few of the most common:

  • Optimizing an interactive web page for Netscape 4’s layer-based dynamic HTML requires coding techniques that are different from those used in optimizing for Internet Explorer’s fully dynamic Document Object Model (DOM) in DHTML.

  • Internet Explorer 5.0 supports client-side XSLT, allowing the browser to handle the presentation of XML-based information instead of the server,

  • Lynx, because it’s a character-mode browser, supports only a subset of HTML that it can faithfully display on character terminals.

Luckily, the XSQL page processor makes targeted transformations like this very easy. You can add any number of <?xml-stylesheet?> processing instructions to the top of your XSQL page, each of which may specify an optional media attribute, as in the following example:

<!-- Use "SiteMenu-ie5.xsl" for an IE5 browser --> <?xml-stylesheet type="text/xsl" media="msie 5.0" href="SiteMenu-ie5.xsl"?> <!-- ...

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.