[jdom-interest] JMS and XML

philip.nelson at omniresources.com philip.nelson at omniresources.com
Thu Mar 29 06:16:51 PST 2001


> The parses always uses File as medium, using JMS the messages 
> are already in
> the main Memory. 
> 
> My problem is there a method how I can parse XML data 
> directly out of the
> main memory.

If you mean that JMS gives you a java.io.File, then you can build from that
directly.

Say the jms returns a File like this

File theData = jmsObject.someMethodThatReturnsFile();

SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(theData);

If it returns it as a String

String theData = jmsObject.someMethodThatReturnsString();

StringReader sr = new StringReader(theData);
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(sr);



More information about the jdom-interest mailing list