I have to interface 3rd party applications having data in XML format with my site. I am currently using JSPs and EJBs for my site. How can I take the instream data (XML format - text) , convert it to an object (DOM/SAX) and call it from my JSP page.

Bruce Martin

Simply invoke an XML parser on the server passing it the incoming XML stream. The parser will produce DOM objects or you can register for SAX events if you prefer an event based parse. Once you have DOM or SAX access to the XML on the server, you can process it as needed.

To return XML, you can write XML directly in your Java code to your output stream or you can create DOM objects and then ask the DOM to write it to your stream.