[Download-List] Re: Download alternating color rows

Wendy Smoak Wendy.Smoak at asu.edu
Mon Sep 29 17:17:14 EDT 2003


Phil wrote:
> I would be interested in seeing some example of complicated output
produced by 
> download such as incorporating css or xsl type handling.

This is what I was going to suggest, but I see you've already thought of
it!  Produce XML output with DOWNLOAD, then apply an XSL stylesheet to
it.

Newer browsers will do the transformation for you, if you put the 
<?xml-stylesheet type="text/xsl" href="/path/to/stylesheet.xsl"?>
in the XML.

We're also using JSTL tags to do the transform on the server side.
(J2EE web application running under Tomcat 4.1.)  The JSP is short and
sweet:

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/xml"  prefix="x" %>
<c:import var="xml" url="data-file.xml" />
<c:import var="xslt" url="stylesheet.xsl" />
<x:transform xml="${xml}" xslt="${xslt}" />

(Before you get to the JSP, a UniBasic program or subroutine runs to
create the XML file and move it to a location accessible from the web,
with an .htaccess file to restrict access to only the IP address that
requested it.)

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM 



More information about the download-list mailing list