Chad Minick
Software Developer


XSL Transformation with JAXB

The goal here is to take the output of a JAXB Marshaller and pass it straight to an xslt processor like JAXP. The issue with this is that JAXP takes it's input from various sorts of input streams and JAXB marshaller outputs usually in some sort of output stream. I saw some (bad) solutions about changing an output stream into an input stream and then pass it to JAXP. eww. The cool thing about JAXB is that it can marshall into a SAX ContentHandler. And there is an implementation of ContentHandler that handles XSL transformations for us! Here is an example of a http servlet that will do an xslt transformation on a JAXB marshalled POJO and dump the results right into into the servlet's output stream: Read More ...
November 17, 2009 Comments, , , , ,
Chad Minick | Software Developer
Twitter | Github | LinkedIn