[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Small issue with REXML output

Chris Large

12/23/2005 5:08:00 AM

I've just started working with REXML recently and have encountered a
small problem. After composing an XML document I want to output it to
file, currently I'm using xmlDoc.write theFile, problem is, the
resultant file does not have newlines after each element. When openning
the file in a text editor it comes in as one big line.

Any idea how to inject newline characters without a bunch of post
processing? Must be a pretty straightforward.

Thanks.
Chris.



2 Answers

Ara.T.Howard

12/23/2005 5:28:00 AM

0

Christian Neukirchen

12/23/2005 2:27:00 PM

0

Chris Large <ChrisLarge@shaw.ca> writes:

> I've just started working with REXML recently and have encountered a
> small problem. After composing an XML document I want to output it to
> file, currently I'm using xmlDoc.write theFile, problem is, the
> resultant file does not have newlines after each element. When
> openning the file in a text editor it comes in as one big line.

IIRC, there is an parameter to xmlDoc.write. Try xmlDoc.write(STDOUT, 2).

> Any idea how to inject newline characters without a bunch of post
> processing? Must be a pretty straightforward.
>
> Thanks.
> Chris.

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneuk...