File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes SAX; multiple database queries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SAX; multiple database queries" Watch "SAX; multiple database queries" New topic

SAX; multiple database queries

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Recently, I successfully created an EJB which creates a PDF document from two inputs: data XML created from a single database query, and a stylesheet. To prepare for potentially large inputs, SAX is currently being used (together with XSLT-like STX), in creating streaming transformations from the streaming data XML and streaming stylesheet inputs.

My question concerns the fact that during the transformation step, the data XML created from a single database query is being passed into a new instance of Is it possible to input two data XML streams to the transformation process, if data XML input from more than one database query is required? Again, to prepare for potentially large inputs, we are not storing a tree in memory - everything is on-the-fly.

A point in the right direction is greatly appreciated.

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
If I understand your problem correctly - yes it is possible to combine multiple XML fragments into a single StreamSource. I wrote a utility class to do this for something very similar to your problem. Described in this article You can download the source from my site - look for "XML Article Published."
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Thank you for your timely response, William - I appreciate it.

Based on a cursory overview of your "An XML Fragment Reader" white paper, and the associated reader comments, I believe the information will be helpful in solving my problem.

Best wishes.
I agree. Here's the link:
subject: SAX; multiple database queries
It's not a secret anymore!