Small issue with REXML output

C

Chris Large

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.
 
A

ara.t.howard

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.

if you do that it will not longer be valid xml. try

puts doc.pretty

hth.

-a
--
===============================================================================
| ara [dot] t [dot] howard [at] noaa [dot] gov
| all happiness comes from the desire for others to be happy. all misery
| comes from the desire for oneself to be happy.
| -- bodhicaryavatara
===============================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,652
Latest member
Campbellamy

Latest Threads

Top