Another option is the Jakarta xsl taglib if that interests you. 

They have a variety of ways to point to your xml and xsl, I am pretty sure one allows 
you to pull the xml string from the session and give a url to the style sheet and it 
will transform for you. 

I'm certain that it allows you to include the xml as the content of the tag and have 
it apply the xsl to that body content. Here is an example that comes with the xsl.jar 
I believe. 

<xsl:apply xsl="/xml/employeeList.xsl">
<?xml version="1.0" encoding="ISO-8859-1"?>
<employees>
  <employee id="123">
    <first-name>John</first-name>
    <last-name>Doe</last-name>
    <telephone>800-555-1212</telephone>
  </employee>
  <employee id="456">
    <first-name>Jane</first-name>
    <last-name>Smith</last-name>
    <telephone>888-555-1212</telephone>
  </employee>
  <employee id="789">
    <first-name>George</first-name>
    <last-name>Taylor</last-name>
    <telephone>555-555-1212</telephone>
  </employee>
</employees>
</xsl:apply>


Burke





-----Original Message-----
From: Wendy Smoak [mailto:Wendy.Smoak@;asu.edu]
Sent: Wednesday, October 23, 2002 11:18 AM
To: 'Struts Users Mailing List'
Subject: Struts & XML



Currently I'm calling a database subroutine (in an Action) that returns a
list of keys, and then using a DAO in a loop to build up a List of Java
objects that contain the data I need to display.  That List gets put in
session scope and then it's off to the resolution.jsp to display it with a
<logic:iterate> tag.

*IF* I changed the database subroutine to return XML, what would I do with
it?  I'd have something like this coming back:

<content>
 <person>
  <name>John Smith</name>
  <birthdate>05/25/1965</birthdate>
  <status>PP</status>
  <address>
      123 State Street 
      City, ST, 12345
  </address>
  <source>ALUM</source>
  <reunion_class>ML1999</reunion_class>
  <reunion_class>ME2002</reunion_class>
 </person
</content>

(I'm unclear on how to format the address which has multiple lines.)

Anyway, would I put that String in session scope?  And then... I'm just
reading about XSLT now.  Can someone point me in the general direction of
which Struts (or other) taglibs I might need?  I'm on Tomcat 4.1.12 & a
recent Struts nightly build with the -el tags.

Thanks in advance,

-- 
Wendy Smoak
http://sourceforge.net/projects/unidbtags 


**********************************************************************
This e-mail is the property of Enron Corp. and/or its relevant affiliate and may 
contain confidential and privileged material for the sole use of the intended 
recipient (s). Any review, use, distribution or disclosure by others is strictly 
prohibited. If you are not the intended recipient (or authorized to receive for the 
recipient), please contact the sender or reply to Enron Corp. at 
[EMAIL PROTECTED] and delete all copies of the message. This 
e-mail (and any attachments hereto) are not intended to be an offer (or an acceptance) 
and do not create or evidence a binding and enforceable contract between Enron Corp. 
(or any of its affiliates) and the intended recipient or any other party, and may not 
be relied on by anyone as the basis of a contract by estoppel or otherwise. Thank you. 
**********************************************************************


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to