commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oscar Picasso <oscgoo...@yahoo.com>
Subject Re: Bewixt - SAXBeanWriter for a SAXSource
Date Sat, 05 Jun 2004 22:00:32 GMT
Just found a solution to my problem. For those interested, it's quite simple.
Something like:

SAXTransformerFactory factory = (SAXTransformerFactory)
TransformerFactory.newInstance();
TransformerHandler handler = factory.newTransformerHandler();
handler.setResult(new StreamResult(System.out));
SAXBeanWriter writer = new SAXBeanWriter(handler);
writer.write(myObject);



--- Oscar Picasso <oscgoogle@yahoo.com> wrote:
> Hi,
> 
> I would like to transform the SAX events generated from a Bean with a
> SAXBeanWriter to an arbitrary Result (DOMResult or StreamResult).
> 
> This kind of transformation is usually quite trivial. 
> 
> For example, if we use streams as source and result we could write something
> like:
> 
> transformer.transform(new StreamSource(inputStream), new
> StreamResult(outputStream));
> 
> Any idea of using the SAXBeanWriter to perform this kind of transformation.
> 
> I have tried many things without success. I don't see if it is possible to
> create a SAXSource with the SAXBeanWriter. I have also tried several ways to
> provide the ContentHandler needed by the SAXBeanWriter.
> 
> Any snippet of  code is welcome.
> 
> Oscar
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/ 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message