I wasn't able to find any help in the lists or anywhere else on this, and had
to debug into Castor to figure it out. I'm writing this for posterity. It may
belong in the faqs, or it might be a bug - other folks can judge this.
The following code WON'T work:
Marshaller m = new Marshaller(writer);
m.setProperty("org.exolab.castor.indent", "true");
m.marshal(sysCfg);
The reason is that the properties are interpreted when the output Writer is set
- in this case, in the constructor.
Instead, set the Writer AFTER setting the property, like so:
Marshaller m = new Marshaller();
m.setProperty("org.exolab.castor.indent", "true");
m.setWriter(writer);
m.marshal(sysCfg);
-Ed Staub