Forums Register Login

jsp to xml

+Pie Number of slices to send: Send
Hello,
Am having a hard time researching this one. I am currently using a jsp page with imbedded jsp's to display data from a database as html in a browser.
I would like to be able to convert the output to xml as well for additional processing but cannot figure out how to do that conversion on the fly.
My ultimate goal is to apply an xsl-fo style sheet to display the web page in a pdf document as well.
Has anybody come across this situation? I feel that once I can get the generated html page as a DOM it should be easy to use FOP for pdf display. Any thoughts or suggestions would be greatly appreciated.
Regards,
Richard
+Pie Number of slices to send: Send
 

Originally posted by Richard Elsberry:
Hello,
Am having a hard time researching this one. I am currently using a jsp page with imbedded jsp's to display data from a database as html in a browser.
I would like to be able to convert the output to xml as well for additional processing but cannot figure out how to do that conversion on the fly.
My ultimate goal is to apply an xsl-fo style sheet to display the web page in a pdf document as well.
Has anybody come across this situation? I feel that once I can get the generated html page as a DOM it should be easy to use FOP for pdf display. Any thoughts or suggestions would be greatly appreciated.
Regards,
Richard


--------------------------------------------------
To convert the output of JSP page to xml:
1- You have to be sure that the JSP page content is text/xml adding:
<%@ page contentType="text/xml"%>
2- You have to notify the JSP page which the xslt file should be used to process transformation like
<?xml:stylesheet type="text/xsl"
href="file.xsl"
version="1.0"
encoding="UTF-8"?>
+Pie Number of slices to send: Send
Djamel,
Thanks for you response. I would like to have the jsp file output to html as it already does. However, I would also like to convert a copy of the dynmaic output to another file for processing. I have been trying to figure out a way to do this but have not had much luck.
Richard
+Pie Number of slices to send: Send
It sounds like you are trying to get two outputs from the the same page at the same time, which I don't think can be done. You might want to have two different versions of the page with different outputs, the pages being reached by different URLs, or have essentially two different versions of the same page both on the same physical page with a parameter determining which part of the page is generating the output.
[ May 20, 2002: Message edited by: Edward Brode ]
+Pie Number of slices to send: Send
try using the same page but change the content-type based on a url parameter.
+Pie Number of slices to send: Send
Any info in converting this html to a pdf...any idea, tool ? and how it works..please advise...
Say I want to convert this html to PDF upon a submit button is click...?
Thanks
+Pie Number of slices to send: Send
You might be able to get a copy of the html if you use filters.
Filters are java code which sit in between the request/response and jsp/servlet. So, by using this filter mech, u should be able to create a xml doc on the fly.
(I haven't worked with filters; just theoritical knowledge. Pls explore in that area).
Regards,
Balaji
[ January 30, 2003: Message edited by: Jeya Balaji ]
+Pie Number of slices to send: Send
hi there i m trying very hard to display the contents of a pdf file whcih is stored in my oracle table as a blob field, but i m not able to stream it out through response object. i have tried everything..plzzzz help me out...
+Pie Number of slices to send: Send
Your are in luck ... checkout www.faceless.org ... they have a HTML to PDF servlet that converts well formatted HTML to PDF. I used this on a project and had good success with it.
Grab the PDF library.
http://big.faceless.org/products/download.jsp
--
steve
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2056 times.
Similar Threads
Escape HTML characters - what's the good practice?
Jsp to Pdf file using Apache Fop
How to make PDF render to handle HTML specific?
HTML to PDF possible?
JSP & PDF's
Generate PDF
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:27:09.