CompactWriter

View: New views
4 Messages — Rating Filter:   Alert me  

CompactWriter

by PHILLIMORE-BROWN, Michael, GBM :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
 
I have just started using XStream and found it was a complete doddle, great work.  I now want to remove all the whitespace from the XML document, and I can see from the docs I need a CompactWriter for this.  Perhaps I'm being really dumb here, but I cannot see for the life of me how I would tell XStream to use the CompactWriter.  Please could someone put a simple example on the wiki?
 
Many thanks,
 
    Mike
***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised and regulated by the Financial Services Authority 
 
This e-mail message is confidential and for use by the 
addressee only. If the message is received by anyone other 
than the addressee, please return the message to the sender 
by replying to it and then delete the message from your 
computer. Internet e-mails are not necessarily secure. The 
Royal Bank of Scotland plc does not accept responsibility for 
changes made to this message after it was sent. 

Whilst all reasonable care has been taken to avoid the 
transmission of viruses, it is the responsibility of the recipient to 
ensure that the onward transmission, opening or use of this 
message and any attachments will not adversely affect its 
systems or data. No responsibility is accepted by The 
Royal Bank of Scotland plc in this regard and the recipient should carry 
out such virus and other checks as it considers appropriate. 
Visit our websites at: 
www.rbs.com
www.rbs.com/gbm
www.rbsgc.com
***********************************************************************************

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

Re: CompactWriter

by Joe Walnes-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Mike,

xstream.marshal(someObject, new CompactWriter(out));

thanks
-Joe

On 7/10/07, PHILLIMORE-BROWN, Michael, GBM <Michael.Phillimore-Brown@...> wrote:
Hi,
 
I have just started using XStream and found it was a complete doddle, great work.  I now want to remove all the whitespace from the XML document, and I can see from the docs I need a CompactWriter for this.  Perhaps I'm being really dumb here, but I cannot see for the life of me how I would tell XStream to use the CompactWriter.  Please could someone put a simple example on the wiki?
 
Many thanks,
 
    Mike
***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority

This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.
Visit our websites at:
www.rbs.com www.rbs.com/gbm www.rbsgc.com ***********************************************************************************

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


Parent Message unknown RE: CompactWriter

by PHILLIMORE-BROWN, Michael, GBM :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Joe,
 
Thanks, this did the trick (if anyone else runs across this):

CharArrayWriter writer = new CharArrayWriter();

xstream.marshal(someObject, new CompactWriter(writer));

return new String(writer.toCharArray());

Cheers,
 
    Mike
 

From: joe.walnes@... [mailto:joe.walnes@...] On Behalf Of Joe Walnes
Sent: 10 July 2007 10:27
To: user@...
Subject: Re: [xstream-user] CompactWriter

Hi Mike,

xstream.marshal(someObject, new CompactWriter(out));

thanks
-Joe

On 7/10/07, PHILLIMORE-BROWN, Michael, GBM <Michael.Phillimore-Brown@...> wrote:
Hi,
 
I have just started using XStream and found it was a complete doddle, great work.  I now want to remove all the whitespace from the XML document, and I can see from the docs I need a CompactWriter for this.  Perhaps I'm being really dumb here, but I cannot see for the life of me how I would tell XStream to use the CompactWriter.  Please could someone put a simple example on the wiki?
 
Many thanks,
 
    Mike
***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority

This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.
Visit our websites at:
www.rbs.com www.rbs.com/gbm www.rbsgc.com ***********************************************************************************

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

RE: CompactWriter

by dudleygb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys,

I'd like to do the opposite, remove the whitespace coming from the XML, during unmarshalling to POJO?


PHILLIMORE-BROWN, Michael, GBM wrote:
Hi Joe,
 
Thanks, this did the trick (if anyone else runs across this):
CharArrayWriter writer = new CharArrayWriter();

xstream.marshal(someObject, new CompactWriter(writer));

return new String(writer.toCharArray());

Cheers,
 
    Mike
 
  _____  

From: joe.walnes@gmail.com [mailto:joe.walnes@gmail.com] On Behalf Of Joe
Walnes
Sent: 10 July 2007 10:27
To: user@xstream.codehaus.org
Subject: Re: [xstream-user] CompactWriter


Hi Mike,

xstream.marshal(someObject, new CompactWriter(out));

thanks
-Joe


On 7/10/07, PHILLIMORE-BROWN, Michael, GBM <
<mailto:Michael.Phillimore-Brown@rbs.com> Michael.Phillimore-Brown@rbs.com>
wrote:

Hi,
 
I have just started using XStream and found it was a complete doddle, great
work.  I now want to remove all the whitespace from the XML document, and I
can see from the docs I need a CompactWriter for this.  Perhaps I'm being
really dumb here, but I cannot see for the life of me how I would tell
XStream to use the CompactWriter.  Please could someone put a simple example
on the wiki?
 
Many thanks,
 
    Mike
****************************************************************************
*******
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered
Office: 36 St Andrew Square, Edinburgh EH2 2YB.


Authorised and regulated by the Financial Services Authority
 
This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender


by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.



Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its


systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.
Visit our websites at:


www.rbs.com <http://www.rbs.com>

www.rbs.com/gbm <http://www.rbs.com/gbm>

www.rbsgc.com <http://www.rbsgc.com>

****************************************************************************
*******

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
<http://www.messagelabs.com/email>  
______________________________________________________________________





______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________