This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
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 java.xml.transform.stream.StreamSource. 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.
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 www.wbrogden.com site - look for "XML Article Published." Bill