Can I pass an xml document object to a transformer?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Joe_Filtz
Posted On:   Friday, October 24, 2003 06:56 AM

I have a question regarding xml, xlst, and jsp I'm using... WebSphere 4.04 Xerces 2.5.1 Xalan 2.5.1 I am currently developing an application that retreives an xml document from a database, applies any of several different xslt documents to the xml file and displays it inside of a jsp. I have done some research and found that most people have the xml and xsl documents as files and use a Transform.transform(Source, OutputStream) to display the transformed xml document. My questions are... 1. Since my xml document lives in a database is there a way to pass the xml document object to the transformer, or do I HAVE to save it as a file to the serve   More>>





I have a question regarding xml, xlst, and jsp

I'm using...

WebSphere 4.04

Xerces 2.5.1

Xalan 2.5.1

I am currently developing an application that retreives an xml document from a database, applies any of several different xslt documents to the xml file and displays it inside of a jsp.

I have done some research and found that most people have the xml and xsl documents as files and use a Transform.transform(Source, OutputStream) to display the transformed xml document.

My questions are...

1. Since my xml document lives in a database is there a way to pass the xml document object to the transformer, or do I HAVE to save it as a file to the server's file system and then pass the path to the 'temporary' document as an argument?


2. All of the transformer examples I have looked at create an output stream to get the transformed data to the client.

Is there anyway I can capture the output and store it into a String or StringBuffer?

I realize this is more of an IO issue but I am trying to generate this output to an object that can placed into the session and displayed inside of a jsp page.


Based on what I have seen, I have to treat the generation of the transformed document as I would the generation of an image (i.e. I create a jsp with an include tag that calls a url with arguments).

That url is to a servlet/action class combo that retrieves the xml transforms it and just spits the data back to the client via the output stream.

3. Is this a "best practice", acceptable solution or am I going down a wrong path?

Just looking for validation and/or other options.
Thanks for your time.


Joe Filtz

   <<Less
About | Sitemap | Contact